Combo Breaker
doneArduino device that spins a Master Lock dial and brute-forces its combination.
June 15, 2021
Inspired by Samy Kamkar, a man who famously went to prison for accidentally hacking MySpace, I chose to undertake this project simply because I thought it was cool. This project is displayed for educational purposes only. No malicious, criminal, or otherwise illegal acts are promoted, endorsed, or encouraged by this documentation. The code involved has been modified to prevent duplication.
Project Overview
This device uses an Arduino, a stepper motor, a servo, and some 3D printed parts to spin the dial of a standard Master Lock padlock and brute force combinations.
I began making this device around 2015, when I found a YouTube video of Samy Kamkar describing his version of the project and how it works. The nonchalant-ness with which he described concepts far above my head immediately tipped me off that I was watching someone who knew their stuff — I had no idea who Samy was at that point, this was the first I'd seen of him. He had discovered an exploit in Master Locks that allowed the correct combination to be narrowed down to 16 possibilities. Not to be inconvenienced with trying these combos by hand, he then created an Arduino-based device that would run through them quickly. Samy had built a pretty thorough prototype, including posting his own Arduino code, 3D models, and loose instructions on how he found the exploit. Full credit to him for the original research this project is built on.
Bill of Materials
Materials
- Arduino
- Stepper motor
- Servo
- Rotary encoder
- Custom 3D-printed parts (Samy's originals weren't strong enough and broke under pressure)
Tools
- Dremel
- Soldering iron
- Wire cutters
- Superglue
Code
- Samy's original code
- My code
Build / Process
Simply put, I dumped an ungodly amount of time into this project. Most of it coming from the language barrier between me and C++. My first step was to implement the calculations done to find the possible correct combinations. The only way to find these combos was to use Samy's website — he built a calculator using a formula he created. But he didn't publish the code-cracking formula anywhere, and I wanted it in my Arduino code.
I wondered if I could rip the formula out of his calculator. I loaded it up in my browser, killed my internet connection, and tried using it — it still worked. That meant the formula was client-side, not server-side, embedded somewhere in the webpage itself. Knowing next to nothing about HTML or JavaScript, it took some fumbling around in the F12 menu to find it, then translate it into C++. To oversimplify, the Arduino code uses the results of this formula to store the possible combinations as arrays, then runs the lock through them, using a servo to check whether it's opened after each try.
The largest part of my time went into changing and adding to Samy's original script — it ended up as a near-complete rewrite, because I couldn't get his code to work with my pea-brain code. It seemed like this entire project took Samy no more than an afternoon; I'm not trying to say I know more than Samy, I still think he's got a polished, flawless version of this somewhere and uses it to break into high school lockers at night to finish students' homework. Anyway — I eventually realized his original code was "dumb": it blindly tossed the motor directions and had no way of knowing if the motor "skipped" and missed the correct numbers. Once the Master Lock wasn't brand new and the dial had some resistance to turning, the dumb code would miss its combinations.
To make the code "smart" and able to correct for that added resistance, I implemented a rotary encoder — a sensor that reads where the shaft of the stepper motor is at all times. Most of my remaining coding time went into editing Samy's code and adding my own to accommodate this sensor.