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)
3.97k stars 721 forks source link

Pattern cracking implementation #11

Open cyb3rm00n opened 3 years ago

cyb3rm00n commented 3 years ago

Hi! I'm interested in pattern cracking "feature" so I'd like to know if there's an idea of how it could be implemented. I don't know much and I'd like to try to code it myself if it's not planned to be implemented soon, so any help would be appreciated :)

urbanadventurer commented 3 years ago

Hi @cyb3rm00n, an unlock pattern can be sent through an emulated mouse device. It can't be sent as keyboard input (EDITED)

Perhaps you could help by finding and sharing some more up to date resources on how the Android pattern is implemented for 4x4 or 5x5 grids?

There's some good resources on this topic:

Android Pattern Lock Cracker Really, the pattern lock is the SHA1 hash sequence of digits (0-8) with length from 3 (4 since Android 2.3.3) to 8.

https://github.com/sch3m4/androidpatternlock

On User Choice for Android Unlock Patterns Abstract—Android Unlock Patterns are one of the most widelyused graphical password schemes. However, the scheme’s securityis limited by users not choosing patterns uniformly but with aspecific bias. In this work we take a closer look at this bias, inparticular how personal traits influence the chosen patterns. Weconducted a user study with 800 participants and demonstratethat certain factors such as age, gender, and experience inIT significantly influence the strength or length of the chosenpatterns. This has implications both for how we can help usersto select stronger patterns and for forensic applications.

https://www.ei.ruhr-uni-bochum.de/media/mobsec/veroeffentlichungen/2019/06/19/01-on-user-choice-for-android-unlock-patterns.pdf

Note: this has data on the most popular unlock patterns.

cyb3rm00n commented 3 years ago

Thank you for the resources. Although If I have understood correctly, I could use any wireless keyboard to connect to a phone and unlock de pattern with the corresponding numbers. That doesn't work (or at least it doesn't work for me), that's why I'm interested in that missing feature.

urbanadventurer commented 3 years ago

You could use a regular wired keyboard. Plug a USB OTG adaptor into the locked phone, then plug a regular keyboard into the adaptor. Now you can press numbers and it will interact with the pattern lockscreen.

A wireless keyboard would need to be connected to the device first and that would be more complicated.

urbanadventurer commented 3 years ago

Another approach for pattern cracking is to emulate mouse movements on the phone.

cyb3rm00n commented 3 years ago

I think I didn't explain myself properly. When I said wireless keyboard I meant a keyboard connected by USB OTG, my fault. At least for me, - i've tried with two different phones - doesn't work the pressing number method to interact with the pattern, the phone doesn't react to the numbers been pressed. I've tried with a wired mouse plugged on a USB OTG but the pressing is not consistent enough so it's not posible to form the pattern (i don't know why).

urbanadventurer commented 3 years ago

Pattern cracking will have to be implemented through an emulated mouse device.

JMRMEDEV commented 2 years ago

I would like to contribute with this feature. Just need resources on how to send mouse signals over your implementation and how to develop scripts with your tool.