Git Product home page Git Product logo

android-pin-bruteforce's Introduction

๐Ÿ”“๐Ÿ“ฑ Android-PIN-Bruteforce

Unlock Android devices by bruteforcing the lockscreen PIN.

Transform your Kali Nethunter phone into a PIN cracking powerhouse for Android devices!

๐Ÿ“ฑ How it Works

Android-PIN-Bruteforce utilizes a USB OTG cable to connect the locked phone to the Nethunter device. It emulates a keyboard, automatically tries PINs, and waits after attempting too many wrong guesses.

How to Connect Phones

[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, simulating plugging a keyboard into the locked phone and pressing keys.

โฑ With a Samsung S5, it takes just over 16.6 hours to try all possible 4-digit PINs, but with the optimized PIN list, it should take much less time.

Requirements

  • 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
  • No need for ADB or USB debugging enabled on the locked phone
  • The locked Android phone does not need to be rooted
  • No need to buy special hardware (e.g., Rubber Ducky, Teensy, Cellebrite, XPIN Clip, etc.)
  • Easily modify the backoff time to crack other types of devices
  • It works!

โญ Features

  • Crack PINs of any length from 1 to 10 digits
  • Use config files to support different phones
  • Optimized PIN lists for 3, 4, 5, and 6 digit PINs
  • Bypass phone pop-ups including the Low Power warning
  • Detect when the phone is unplugged or powered off, and wait while retrying every 5 seconds
  • Configurable delays after every X PIN attempts
  • Log file

Installation

TBC

Executing the Script

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

./android-pin-bruteforce

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

Usage

Android-PIN-Bruteforce (0.2) is used to unlock an Android phone (or device) by bruteforcing the lockscreen PIN.
  Find more information at: https://github.com/urbanadventurer/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
  version              Display version information and exit

Options:
  -f, --from PIN       Resume from this PIN
  -a, --attempts       Starting from NUM incorrect attempts
  -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
  -c, --config FILE    Specify configuration file to load
  -p, --pinlist FILE   Specify a custom PIN list
  -d, --dry-run        Dry run for testing. Doesn't send any keys.
  -v, --verbose        Output verbose logs

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

Supported Android Phones/Devices

Successfully tested with various phones including Samsung S5, S7, Motorola G4 Plus, and G5 Plus.

It can unlock Android versions 6.0.1 through 10.0. The ability to perform a bruteforce attack doesn't depend on the Android version but on how the device vendor developed their lockscreen.

Check the Phone Database for more details: Phone Database

๐ŸŽณ PIN Lists

Optimized PIN lists are used by default unless a custom PIN list is selected.

Cracking PINs of Different Lengths

Use the --length command-line option.

  • To crack a 3-digit PIN: ./android-pin-bruteforce crack --length 3
  • To crack a 6-digit PIN: ./android-pin-bruteforce crack --length 6

Optimized PIN Lists Source

The optimized PIN lists were generated from Ga$$Pacc DB Leak and mandatoryprogrammer's GitHub repository.

The 4-digit PIN list comes from Justin Engler & Paul Vines from Senior Security Engineer, iSEC Partners, used in their Defcon talk.

Cracking with Masks

Masks use regular expressions with the standard grep extended format.

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

Configuration for Different Phones

Device manufacturers create their own lock screens. To find out what keys your phone needs, plug a keyboard into the phone and try out different combinations.

Load a different configuration file with the --config FILE command-line parameter.

Example: ./android-pin-bruteforce --config ./config.samsung.s5 crack

You can also edit the config file by customizing the timing and keys sent.

Popups

We send keys before the end of the cooldown period or optionally during the cooldown period to keep the lockscreen app active and to dismiss any popups about the number of incorrect PIN attempts or a low battery warning.

Test Sending Keys from the NetHunter Phone

Test Sending Keys from the Terminal

Use SSH from your laptop to the NetHunter phone and use this command to test sending keys:

In this example, the enter key is sent.

echo "enter" | /system/xbin/hid-keyboard /dev/hidg0 keyboard

Test Sending Keys from an App

Use this Android app, a virtual USB Keyboard, to test sending keys: Remote HID Keyboard Client

How to Send Special Keys

Refer to the provided list in the readme for sending special keys.

๐Ÿ”ง Troubleshooting

Check the readme for troubleshooting steps.

๐Ÿ’ฃ Known Issues

Check the readme for known issues.

๐Ÿš€ Roadmap

Check the readme for the project's roadmap.

๐Ÿ™‹ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

๐Ÿ˜Ž Authors and Acknowledgments

Developed by Andrew Horton (@urbanadventurer).

๐Ÿ‘ The following people have been very helpful:

  • Vlad Filatov (@v1adf): Testing many phones for the Wiki

, adding new masks, and providing additional feedback.

  • Gabriele Corrado (@GabrieleCM): Providing additional feedback and testing.
  • Aleksejs Popovs (@aleksejspopovs): Providing feedback and testing.
  • Ghee (@ghee22): Providing feedback and testing.
  • Shimon Das (@shimon835): Providing feedback and testing.
  • Henry (@hexatrope): Providing feedback and testing.
  • Maksim (@maaaaksym): Testing and providing feedback.

๐Ÿ” License

Apache License 2.0

๐Ÿ“š Further Reading

Check the readme for more details and information.


This script is powerful and versatile, but please use it responsibly and legally. Unauthorized access to someone else's device without permission is illegal and unethical. Always obtain proper authorization before attempting to unlock any device.

android-pin-bruteforce's People

Contributors

urbanadventurer avatar lightyagami28 avatar psyhomb avatar

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.