Android native library scanner for .so files.
This tool extracts strings, scans for sensitive data, API keys, tokens, CTF flags, base64-encoded secrets, and JNI methods. It also supports custom regex search.
- Pure-Python string extraction: ASCII + UTF-16LE with offsets.
- Optional external tools:
readelfandnmintegration (if available). - Sensitive patterns: Detect Google API keys, OpenAI keys, GitHub tokens, AWS secrets, JWTs, passwords, PEM keys, database URIs, internal hosts, and more.
- CTF/flag detection: Detect
CTF{}andFLAG{}patterns. - Base64 detection: Auto-decode likely base64 strings.
- Custom search: Supply your own string or regex patterns (overrides default patterns).
- Silent mode: Print only matches.
- Save output: Optionally save results to a file.
- No external modifications: Removed suggestions for
objcopyor section removal.
Clone the repository:
git clone https://github.com/7absec/AndroidNativeScanner.git
cd AndroidNativeScannerInstall dependencies (optional, for colored output):
pip install termcolorUsing built-in sensitive and flag patterns:
python NativeScanner.py path/to/lib***.sopython NativeScanner.py path/to/libs/Using user-supplied search patterns:
# Plain string search
python NativeScanner.py libnativeflag.so -s "CTF{"
# Regex search
python NativeScanner.py libnativeflag.so -s "re:CTF\{[A-Za-z0-9_!@\-\.\+]{1,256}\}"If custom search is provided, default patterns are ignored.
python NativeScanner.py libnativeflag.so -qpython NativeScanner.py libnativeflag.so --save report.txtpython NativeScanner.py libnativeflag.so -v| Argument | Description |
|---|---|
path |
Path to a .so file or directory containing .so files. |
-s, --search |
Custom search pattern. Can be repeated. Use re: prefix for regex. Overrides default patterns. |
-q, --silent |
Silent mode: print only matches. |
--save FILE |
Save human-readable report to FILE. |
-v, --verbose |
Verbose mode: prints full external tool output if available. |
[*] Analyzing: libnativeflag.so
[!] CTF Flag: CTF{Android_Native_Hakure} (offset=0x1234)
[*] Base64: SGVsbG8gd29ybGQ= (offset=0x5678)
→ Decoded (snippet): Hello world
[-] No other matches found.
Feel free to open issues or submit pull requests. Future plans include:
- Raw binary pattern search.
- Automatic risk scoring and reporting.
- Extended CTF/flag heuristics.
MIT License

