timvisee / apbf

Tool to brute force Android security pattern through TWRP recovery. https://gitlab.com/timvisee/apbf
GNU General Public License v3.0
112 stars 23 forks source link
adb android brute-force decrypt pattern-lock twrp

Pipeline status on GitLab CI

Android Pattern Brute Force

A tool for brute forcing an Android security pattern through TWRP recovery.

Screenshot

One day I forgot what security pattern I used on my phone. Therefore I build a tool which brute forces the pattern.

I succeeded to crack my 3x3 pattern in about 1.9 hours.

Requirements

Speed

TWRP recovery enforces a hidden timeout of 10 seconds for each pattern attempt, all consecutive attempts within that time fail with no warning. Because of this a brute force attempt will take a long while when the pattern search space is large.

It is highly recommended to constrain the search space as much as possible if you partially know the pattern to greatly improve the brute force duration.

In the config.rs file you can tweak a few constants for:

This tool does brute forcing on the actual device. A brute force attempt could probably be greatly sped up by performing the attempt locally on a computer, to work around the timeouts. That's however a lot more work to implement (if even possible), so it's outside the scope of this project.

Usage

License

This project is released under the GNU GPL-3.0 license. Check out the LICENSE file for more information.