urbanadventurer / Android-PIN-Bruteforce

Unlock an Android phone (or device) by bruteforcing the lockscreen PIN. Turn your Kali Nethunter phone into a bruteforce PIN cracker for Android devices! (no root, no adb)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hid-Keyboard binary fix

Gr1MM-Hond0 opened this issue · comments

I think this script is great, It has allowed me to unlock the mobile device of a family member who has passed.
After many hours of troubleshooting I stumbled onto this solution, I have done a small write up to see if this will help anyone else.
This method should fix the error 126/127 if all other items are implemented correctly

Compiling the binary yourself:

If the binary is not on your device you will need to compile yourself. You will need to go and grab the hid-gadget-test utility as a basis for the file you will need. Using git:

git clone- https://github.com/aagallag/hid_gadget_test

Edit the hid_gadget_test.c file. You need to edit 3 sections:
First you add the values for the number keys to the static struct options kval on line 32.

{.opt = "1",		.val = 0x1e},
{.opt = "2",		.val = 0x1f},
{.opt = "3",		.val = 0x20},
{.opt = "4",		.val = 0x21},
{.opt = "5",		.val = 0x22},
{.opt = "6",		.val = 0x23},
{.opt = "7",		.val = 0x24},
{.opt = "8",		.val = 0x25},
{.opt = "9",		.val = 0x26},
{.opt = "0",		.val = 0x27},

Secondly remove the print_options section on lines from 209 – 239. 
Thirdly remove the print_options function call around line 260. 

Now you can move the directory to the device being used for the brute forcing. You have to compile the binary ON THAT DEVICE. The binary will not work if compiled on another device then transferred.

On the device navigate to the directory you just transferred across. Run the “make” command In that directory.
Rename the new binary to match what the script looks for “hid-keyboard”, you can either move that file or keep it in that directory.
Edit the config file for the Android-PIN-Bruteforce.
On line 67 change the path for the hid-keyboard variable to where your new binary is, you will also need to edit this value in any pre-made configs that come with the script.

This should now work. Some tweaking may be required depending on the phone being brute forced.

Thank you for this @Gr1MM-Hond0 ! 🎉

I'm doing as in this description and nothing works :/

Anyone else got any ideas on how to fix this?
IMG_20230531_085626