chiark / gitweb /
update: support working with old versions of PIL/Pillow
[fdroidserver.git] / docker / drozer.py
1 #!/usr/bin/env python2
2
3 import pexpect
4 import sys
5
6 prompt = "dz>"
7 target = sys.argv[1]
8
9 drozer = pexpect.spawn("drozer console connect")
10 drozer.logfile = open("/tmp/drozer_report.log", "w")
11
12
13 # start
14 drozer.expect(prompt)
15
16
17 def send_command(command, target):
18     cmd = "run {0} -a {1}".format(command, target)
19     drozer.sendline(cmd)
20     drozer.expect(prompt)
21
22 scanners = [
23     "scanner.misc.native",          # Find native components included in packages
24     #"scanner.misc.readablefiles",   # Find world-readable files in the given folder
25     #"scanner.misc.secretcodes",     # Search for secret codes that can be used from the dialer
26     #"scanner.misc.sflagbinaries",   # Find suid/sgid binaries in the given folder (default is /system).
27     #"scanner.misc.writablefiles",   # Find world-writable files in the given folder
28     "scanner.provider.finduris",    # Search for content providers that can be queried.
29     "scanner.provider.injection",   # Test content providers for SQL injection vulnerabilities.
30     "scanner.provider.sqltables",   # Find tables accessible through SQL injection vulnerabilities.
31     "scanner.provider.traversal"    # Test content providers for basic directory traversal
32 ]
33
34 for scanner in scanners:
35     send_command(scanner, target)