iOS Dynamic Analysis with Corellium (#2194)

* iOS Dynamic Analysis Support with Corellium Jailbroken iOS devices
* Corellium API layer for complete device and project management
* Frida instrumentation (attach, spawn and inject) over SSH local port forward
* Shell access over SSH
* MobSF httptools proxy integration over SSH remote port forward
* Device File upload and download over SSH
* Frida scripts for core defense bypass, monitoring, and tracing
* Helper iOS Frida scripts for pentesting and malware analysis
* Screen cast with touch, swipe and text input support from web UI
* Dynamic Analysis device data dump and  report Generation
* Android Certificate analysis, replaced oscrypto with cryptography for public key parsing
* Python minimum support is 3.10
* Bumped httptools to latest, fixes httptools repeat bug
* Added unzip to docker to fix a bug
This commit is contained in:
Ajin Abraham
2023-12-03 02:01:10 -08:00
committed by GitHub
parent 4685d8e73d
commit 2aecb905b3
148 changed files with 10446 additions and 1606 deletions
@@ -1,7 +1,6 @@
# -*- coding: utf_8 -*-
"""Frida tests."""
import base64
import glob
import os
import re
import json
@@ -14,16 +13,17 @@ from django.conf import settings
from django.views.decorators.http import require_http_methods
from mobsf.DynamicAnalyzer.views.android.frida_core import Frida
from mobsf.DynamicAnalyzer.views.android.operations import (
get_package_name,
from mobsf.DynamicAnalyzer.views.common.shared import (
invalid_params,
is_attack_pattern,
send_response,
)
from mobsf.DynamicAnalyzer.views.android.operations import (
get_package_name,
)
from mobsf.MobSF.utils import (
is_file_exists,
is_md5,
is_safe_path,
print_n_send_error_response,
)
@@ -32,22 +32,6 @@ logger = logging.getLogger(__name__)
# AJAX
@require_http_methods(['GET'])
def list_frida_scripts(request, api=False):
"""Get frida scripts from others."""
scripts = []
others = os.path.join(settings.TOOLS_DIR,
'frida_scripts',
'others')
files = glob.glob(others + '**/*.js', recursive=True)
for item in files:
scripts.append(Path(item).stem)
return send_response({'status': 'ok',
'files': scripts},
api)
# AJAX
@require_http_methods(['POST'])
def get_runtime_dependencies(request, api=False):
"""Get App runtime dependencies."""
@@ -71,32 +55,6 @@ def get_runtime_dependencies(request, api=False):
# AJAX
@require_http_methods(['POST'])
def get_script(request, api=False):
"""Get frida scripts from others."""
data = {'status': 'ok', 'content': ''}
try:
scripts = request.POST.getlist('scripts[]')
others = os.path.join(settings.TOOLS_DIR,
'frida_scripts',
'others')
script_ct = []
for script in scripts:
script_file = os.path.join(others, script + '.js')
if not is_safe_path(others, script_file):
data = {
'status': 'failed',
'message': 'Path traversal detected.'}
return send_response(data, api)
if is_file_exists(script_file):
script_ct.append(Path(script_file).read_text())
data['content'] = '\n'.join(script_ct)
except Exception:
pass
return send_response(data, api)
# AJAX
@require_http_methods(['POST'])
def instrument(request, api=False):
"""Instrument app with frida."""
@@ -119,6 +77,7 @@ def instrument(request, api=False):
if cls_trace:
extras['class_trace'] = cls_trace.strip()
if (is_attack_pattern(default_hooks)
or is_attack_pattern(auxiliary_hooks)
or not is_md5(md5_hash)):
return invalid_params(api)
package = get_package_name(md5_hash)