mirror of
https://github.com/MobSF/Mobile-Security-Framework-MobSF.git
synced 2026-10-12 02:06:59 +00:00
Dynamic Analysis with Genymotion. Supports Android 4.1 -9.0 Static Analyzer Threaded baksmali Improved Recent Scan Browser PDF Generation Dynamic Analyzer Restructuring Dynamic Analyzer Code QA and Modularization Automatic MobSFy with Xposed and Frida Full pass on all versions of android with basic features Streaming logcat Live API Monitor Better SQlite DB View In line frida scripting + loading from frida code share basic frida env, ssl unpin, root check, debugger detection bypass. Custom Frida Scripts and integration Frida Log Viewer Frida scripts loader Frida custom user script loader
64 lines
1.6 KiB
Python
64 lines
1.6 KiB
Python
import os
|
|
|
|
from django.conf import settings
|
|
|
|
from DynamicAnalyzer.views.android.operations import strict_package_check
|
|
|
|
|
|
def get_content(file_name):
|
|
content = ''
|
|
script = os.path.join(settings.TOOLS_DIR,
|
|
'frida_scripts',
|
|
'auxiliary',
|
|
file_name)
|
|
|
|
with open(script, 'r') as scp:
|
|
content = scp.read()
|
|
return content
|
|
|
|
|
|
def get_loaded_classes():
|
|
"""Get Loaded classes."""
|
|
return get_content('get_loaded_classes.js')
|
|
|
|
|
|
def string_catch():
|
|
"""Capture all runtime strings."""
|
|
return get_content('string_catch.js')
|
|
|
|
|
|
def string_compare():
|
|
"""Capture all runtime string comparisons."""
|
|
return get_content('string_compare.js')
|
|
|
|
|
|
def get_methods(klazz):
|
|
"""Get Class methods and implementations."""
|
|
if not strict_package_check(klazz):
|
|
return ''
|
|
content = get_content('get_methods.js')
|
|
return content.replace('{{CLASS}}', klazz)
|
|
|
|
|
|
def class_pattern(pattern):
|
|
"""Search in loaded classes based on pattern."""
|
|
pattern = pattern.replace(
|
|
'/', '\\/').replace(';', '')
|
|
content = get_content('search_class_pattern.js')
|
|
return content.replace('{{PATTERN}}', pattern)
|
|
|
|
|
|
def class_trace(classes):
|
|
"""Trace all methods of a class."""
|
|
filtered = []
|
|
if ',' not in classes:
|
|
filtered.append(classes.strip())
|
|
else:
|
|
for clz in classes.split(','):
|
|
filtered.append(clz.strip())
|
|
for klz in filtered:
|
|
if not strict_package_check(klz):
|
|
return ''
|
|
content = get_content('class_trace.js')
|
|
return content.replace('{{CLASSES}}', str(filtered))
|