explaingit

urbanadventurer/android-pin-bruteforce

4,623ShellAudience · developerComplexity · 2/5Setup · moderate

TLDR

A shell script that automatically tries every possible PIN on a locked Android phone by connecting a Kali NetHunter phone via USB cable, using it as an automated keyboard to type guesses one at a time.

Mindmap

mindmap
  root((repo))
    What It Does
      Guesses Android PINs
      Sends keys via USB
      Handles lockout delays
    How It Works
      Kali NetHunter phone
      USB HID emulation
      Cooldown management
    PIN Lists
      Common PIN database
      4 and 6 digit lists
      Custom list support
    Supported Devices
      Samsung phones
      Motorola phones
      Android 6 to 10
    Requirements
      No root needed
      No USB debugging
      Two phones plus cable
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Test how long it takes to crack a 4-digit PIN on your own locked Android phone using the pre-sorted common-PIN list.

USE CASE 2

Demonstrate USB HID keyboard attack risks to a security training class.

USE CASE 3

Recover access to your own phone by providing a custom PIN list based on patterns you remember using.

Tech stack

ShellKali NetHunter

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires a second phone running Kali NetHunter and a USB OTG cable, cannot be done with a standard Android phone as the attacker device.

In plain English

Android-PIN-Bruteforce is a shell script that tries to unlock a locked Android phone by automatically guessing its PIN, one attempt at a time. It works by connecting two phones together with a USB cable: a Kali Nethunter phone acts as an automated keyboard, and the locked Android phone receives the keystrokes. No special hardware is required beyond the cable, and the locked phone does not need to have USB debugging turned on or be rooted. The way it works is that the Nethunter phone pretends to be a USB keyboard plugged into the locked device. The script then types out PIN combinations in sequence, waiting after each wrong guess to avoid triggering the phone's lockout timer. It handles the cooldown periods that Android enforces after too many failed attempts, and it can dismiss pop-up warnings that appear on screen during the process. The script supports PINs from 1 to 10 digits long. For common lengths like 4 or 6 digits, it ships with pre-sorted PIN lists built from real-world password database leaks, meaning the most commonly chosen PINs are tried first. This can reduce the time needed to crack a PIN compared to trying every combination in order. You can also provide a custom PIN list or use a pattern mask if you already know some of the digits. Configuration files let you adjust the script's behavior for different phone models, since manufacturers build their lockscreens differently. You can tune the timing between key presses, the cooldown schedule, and which keys are sent before each PIN attempt. The script has been tested on Samsung and Motorola devices running Android 6 through 10. A full brute-force of all 10,000 possible 4-digit PINs takes roughly 16 hours on a Samsung S5. Using the optimized list shortens that considerably by front-loading the most likely guesses. The project is aimed at security researchers and phone owners who are locked out of their own devices.

Copy-paste prompts

Prompt 1
Write me a shell script that sends a list of strings as USB HID keystrokes using Kali NetHunter to an attached Android device.
Prompt 2
Generate an optimized 4-digit PIN wordlist sorted by real-world frequency for use with android-pin-bruteforce.
Prompt 3
How do I configure the android-pin-bruteforce timing and cooldown settings for a Samsung Galaxy device to avoid the wipe-after-10-attempts lockout?
Prompt 4
Show me how to use a pattern mask in android-pin-bruteforce to only try PINs where I know the first two digits are 19.
Open on GitHub → Explain another repo

← urbanadventurer on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.