Code Monkey home page Code Monkey logo

android-pin-bruteforce's Introduction


Android Pin Bruteforce
Android PIN Bruteforce

Unlock an Android phone or device
by bruteforcing the lockscreen PIN.
Turn any Kali Nethunter phone into
bruteforce PIN cracker of Android!


๐Ÿงญ How it works

Buy Me A Coffeeโ€Ž โ€Ž โ€Ž โ€Ž โ€Ž โ€Ž โ€Ž โ€Ž

To learn about the commands and other usage details Click Here.
It uses a USB OTG cable to connect the locked phone to the Nethunter device.
It emulates a keyboard, automatically tries PINs, and waits after trying too many wrong guesses.

[Nethunter phone] โ‡Œ [USB cable] โ‡Œ [USB OTG adaptor] โ‡Œ [Locked Android phone]

The USB HID Gadget driver provides emulation of USB Human Interface Devices (HID).
This enables an Android Nethunter device to emulate keyboard input to the locked phone.
It's just like plugging a keyboard into the locked phone and pressing keys.

โณ This takes a bit over 16.6 hours to try all possible 4 digit PINs,
but with the optimised PIN list it should take you much less time.

โœ… You will need

  • A locked Android phone
  • A Nethunter phone (or any rooted Android with HID kernel support)
  • USB OTG (On The Go) cable/adapter (USB male Micro-B to female USB A),
    and a standard charging cable (USB male Micro-B to male A).

โœจ Benefits

  • Turn your NetHunter phone into an Android PIN cracking machine
  • Unlike other methods, you do not need ADB or USB debugging enabled on the locked phone
  • You don't need to buy special hardware, e.g. Rubber Ducky, Teensy, Cellebrite, XPIN Clip, etc.
  • You can easily modify the backoff time to crack other types of devices
  • It works!

๐Ÿ‘‰๐Ÿป Features

  • Optimised PIN list
  • Bypasses phone pop-ups including the Low Power warning
  • Detects when the phone is unplugged or powered off, and waits while retrying every 5 seconds
  • Configurable delays of N seconds after every X PIN attempts
  • Log file gets created for further debugging

โš™ Installation & Usage


Android-PIN-Bruteforce is used to unlock an Android phone (or device) by bruteforcing the lockscreen PIN.

  Find more information at: https://github.com/utsanjan/Android-Pin-Bruteforce

Commands:
  crack             Begin cracking PINs
  resume            Resume from a chosen PIN
  rewind            Crack PINs in reverse from a chosen PIN
  diag              Display diagnostic information

Options:
  -f, --from PIN    Resume from this PIN
  -m, --mask REGEX  Use a mask for known digits in the PIN
  -t, --type TYPE   Select PIN or PATTERN cracking
  -l, --length NUM  Crack PINs of NUM length
  -d, --dry-run     Dry run for testing. Doesn't send any keys.
  -v, --verbose     Output verbose logs.

Usage:
  android-pin-bruteforce <command> [options]

๐Ÿ“Œ PIN Lists

Optimised PIN list

pinlist.txt is an optimised list of all possible 4 digit PINs,
sorted by order of likelihood. pinlist.txt is from the following:
https://github.com/mandatoryprogrammer/droidbrute

This list is used with permission from Justin Engler & Paul Vines from Senior Security Engineer, iSEC Partners, and was used in their Defcon talk, Electromechanical PIN Cracking with Robotic Reconfigurable Button Basher (and C3BO)

๐ŸŽญ Cracking with Masks

Masks use regular expressions with the standard grep extended format.

./android-pin-bruteforce crack --mask "...[45]" --dry-run

  • To try all years from 1900 to 1999, use a mask of 19..
  • To try PINs that have a 1 in the first digit, and a 1 in the last digit, use a mask of 1..1
  • To try PINs that end in 4 or 5, use ...[45]

๐Ÿ™ Troubleshooting

Executing the script

If you installed the script to /sdcard/, you can
execute it with the following command.

bash ./android-pin-bruteforce

Note that Android mounts /sdcard with the noexec flag. You can verify this with mount.

Check the cables

The OTG cable should be connected to the locked Android phone.
The regular USB cable should be connected to the Nethunter phone.

Diagnostics

Use the diagnostic command.

bash ./android-pin-bruteforce diag

Note that Nethunter USB HID support was inconsistent during testing and development.
However after it starts working, it should continue working until you crack the PIN.

If you receive this message when the USB cable is plugged in then try taking
the battery out of the locked Android phone and power cycling it.

[FAIL] HID USB device not ready. Return code from /system/xbin/hid-keyboard was 5.

Known Issues

  • This cannot detect when it unlocks

Tips & Tricks

  • Try powering off the phone and taking out the battery
  • Try sending keys to your PC or laptop
  • Note that the Device not Found messages
    are not as important as sending keys successfully.

๐Ÿง‘๐Ÿปโ€๐Ÿ’ป Technical Details

This works from an Android phone because the USB ports
are not bidirectional, unlike the ports on a laptop.

Keys are sent using /system/xbin/hid-keyboard.
To test this and send the key 1 you can use the following:
echo 1 | /system/xbin/hid-keyboard dev/hidg0 keyboard

Before each PIN, we send the escape and enter keys. This is to keep the Android responsive and dismiss any popups about the number of incorrect PIN attempts or a low battery warning. My original motivation to develop this was to unlock a Samsung S5 Android phone. It had belonged to someone who had passed away, and their family needed access to the data on it. As I didn't have a USB Rubber Ducky or any other hardware handy, I tried using a variety of methods, and eventually realised I had to develop something new.

โœ’๏ธ Credits

Work: Andrew Horton designed the Bruteforce tool
which helped me a lot to design my piece of Bash Script

Click here to visit his Bruteforce Bash Script Repository.

Work: The optimised PIN list is from Justin Engler & Paul Vines
from Senior Security Engineer, iSEC Partners and was used in their
Defcon talk, Electromechanical PIN Cracking with Robotic
Reconfigurable Button Basher and C3BO.

๐ŸŒŽ Contact me

For Queries: My Instagram Profile
Check Out My YouTube Channel

android-pin-bruteforce's People

Contributors

utsanjan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-pin-bruteforce's Issues

OTG On/Off ?

What will happen if in target Android the OTG option is not enabled

can i use it on kali linux vm?

I have kali linux installed in vmware workstation but when i run this script it says no hid device found. but the feature of this script says it is supported by kali linux.

"Turn your Kali Linux PC or Kali Nethunter phone into a brute-force PIN cracker of Android devices"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.