Python3 program that creates a duckyscript payload to brute force a 4-digit pin on Android.
It uses an improved pin list (most common keys first).
I tested the script with a Flipper Zero (BadUsb).
Tested Devices:
| Device | Android Version |
|---|---|
| Xiaomi Redmi Note 10 Pro | Android 11.0 |
| Samsung Samsung Galaxy Tab A T580 (2016) | Android 7.0 |
Because of the security rules it is really time demanding and kind of impossible/not worth it to get the pin with this approach, if it’s not in the range of x (time you could afford).
The pin security rules on those devices work like this:
| Try | tries without lock | Lock time in seconds |
|---|---|---|
| 1-5 | 5 | 30 |
| 6-10 | 5 | 30 |
| 11-20 | 1 | 30 |
| 21-30 | 1 | 60 |
| 31-40 | 1 | 120 |
| 41-50 | 1 | 240 |
| 51-60 | 1 | 480 |
I just tested it until i hit 480 (8 minutes).
It seems like it is increasing by the factor of 2 every 10 tries. So it is absolutely not worth it after x tries to move on.
The lock timer doesn't reset if the device gets rebooted (only if the device was successfully was unlocked).
Sadly i don’t have an older device with a lower Android version or from another brand to test with.
If the lock timer stayed at 30 seconds, it would only take 16.6 hours to brute force a 4 digit pin in the worst case scenario.