Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit ff1b121

Browse files
authored
Merge pull request #565 from 18z/master
Add URL parser for apk module
2 parents 5ab9794 + 39d59ac commit ff1b121

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

viper/modules/apk.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(self):
2626
self.parser.add_argument('-i', '--info', action='store_true', help='Show general info')
2727
self.parser.add_argument('-p', '--perm', action='store_true', help='Show APK permissions')
2828
self.parser.add_argument('-f', '--file', action='store_true', help='Show APK file list')
29+
self.parser.add_argument('-u', '--url', action='store_true', help='Show URLs in APK')
2930
self.parser.add_argument('-a', '--all', action='store_true', help='Run all options excluding dump')
3031
self.parser.add_argument('-d', '--dump', metavar='dump_path', help='Extract all items from archive')
3132

@@ -129,6 +130,13 @@ def andro_perm(a):
129130
for perms in a.permissions:
130131
self.log('item', perms)
131132

133+
# List all URL in the dex file
134+
def andro_url(vm):
135+
url_set = vm.get_regex_strings("http(s){0,1}://")
136+
self.log('info', "APK URLs")
137+
for url in url_set:
138+
self.log('item', url.encode('utf-8'))
139+
132140
# Decompile and Dump all the methods
133141
def andro_dump(vm, vmx, dump_path):
134142
# Export each decompiled method
@@ -204,6 +212,8 @@ def _load_params():
204212
andro_perm(a)
205213
elif self.args.file:
206214
andro_file(a)
215+
elif self.args.url:
216+
andro_url(vm)
207217
elif self.args.all:
208218
andro_info(a)
209219
andro_perm(a)

0 commit comments

Comments
 (0)