A cli(command-line-interface) tool to fuzz android broadcasts
Installation:
Option 1:
pip3 install git+ssh://[email protected]/shrsurya/broadcast-fuzzer.git
Option 2:
git clone https://github.com/shrsurya/broadcast-fuzzer.git
cd broadcast-fuzzer
pip3 install .
-
Add path the to adb command line tool as an environment variable
export ADB_PATH='path/to/adb'
OR
While using buzz, provide adb path with each run. example.
buzz --adb 'path to adb executable'
-
Create a
SEED
folder with seed data example -
You can use an android emulator or a physical device but make sure that only one is connected/active at a time
-
If using a physical device, enable USB debugging.
-
Ensure that the target application is installed on the device.
-
Ensure that the target application has permission to access files and folders on the phone.
Source Code Available:
- If the source code of the target application is available then the manifest can be obtained from the app source code.
Source Code Unavailable:
-
If the source code is unavailable the manifest can be obtained by decompiling the target APK using Apktool.
The following steps explain how use Apktool and adb to extract the manifest file from the target APK.
-
Pull the APK from the android device - Instructions
-
Use Apktool on the APK to decompile it as follows.
$ apktool d test.apk -o decompiledApp
-
AndroidManifest.xml
can now be obtained from thedecompiledApp
directory
-
buzz --help
- Learn more about each optionbuzz -m 'path to AndroidManifest.xml'
- parse manifest filebuzz -m 'path to AndroidManifest.xml' -p
- parse manifest file and printbuzz -m 'path to AndroidManifest.xml' -g -dr 100
- generate 100 fuzzed data files for each intent in the AndroidManifestbuzz -m 'path to AndroidManifest.xml' -g -dr 3 -e -sp 'path to SEED folder' -dp 'path to data generation folder' -adb 'path to adb executable'
generate 3 fuzzed data files for each intent. -adb, -sp and -dp are used to specify the paths
Error keyword filter in buzz can be modified to listen to only specific errors. This can be done by changing the ERROR_PHRASES
list in SOURCES/broadcast_fuzzer/constants.py
. Currently the error listener runs a simple string search for these given keywords and the package name.
We have tested a few apps using our tool. The video recording of these tests are available on this repository.