diff --git a/mobsf/MalwareAnalyzer/views/android/apkid.py b/mobsf/MalwareAnalyzer/views/android/apkid.py index 14f2b82371..375e73a14c 100644 --- a/mobsf/MalwareAnalyzer/views/android/apkid.py +++ b/mobsf/MalwareAnalyzer/views/android/apkid.py @@ -1,6 +1,6 @@ # -*- coding: utf_8 -*- import logging -import os +from pathlib import Path from django.conf import settings @@ -24,9 +24,6 @@ def apkid_analysis(checksum, apk_file): logger.error(msg) append_scan_status(checksum, msg, repr(exp)) return {} - if not os.path.exists(apk_file): - logger.error('APKiD - APK not found') - return {} apkid_ver = apkid.__version__ from apkid.apkid import Scanner, Options @@ -87,5 +84,7 @@ def apkid_analysis(checksum, apk_file): filename = item['filename'] if '!' in filename: filename = filename.split('!', 1)[1] + else: + filename = Path(filename).name sanitized[filename] = item['matches'] return sanitized diff --git a/mobsf/MobSF/init.py b/mobsf/MobSF/init.py index 0214c642f0..e393f4d47a 100644 --- a/mobsf/MobSF/init.py +++ b/mobsf/MobSF/init.py @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) -VERSION = '4.1.7' +VERSION = '4.1.8' BANNER = r""" __ __ _ ____ _____ _ _ _ | \/ | ___ | |__/ ___|| ___|_ _| || | / | diff --git a/mobsf/MobSF/tools_download.py b/mobsf/MobSF/tools_download.py index a763a5e0e9..2039944678 100644 --- a/mobsf/MobSF/tools_download.py +++ b/mobsf/MobSF/tools_download.py @@ -14,7 +14,8 @@ logging.basicConfig( level=logging.INFO, - format='%(asctime)s - %(levelname)s - %(message)s') + format='[%(levelname)s] %(asctime)-15s - %(message)s', + datefmt='%d/%b/%Y %H:%M:%S') logger = logging.getLogger(__name__) @@ -41,7 +42,7 @@ def download_file(url, file_path): # Print progress if file_size > 0: done = int(50 * downloaded / file_size) - fmt = (f'\r[{"#" * done}{"-" * (50-done)}] ' + fmt = (f'\r[{"#" * done}{"-" * (50 - done)}] ' f'{downloaded * 100 / file_size:.2f}%') sys.stdout.write(fmt) sys.stdout.flush() diff --git a/mobsf/MobSF/utils.py b/mobsf/MobSF/utils.py index 0b9fbebcc2..46ce6fbd50 100755 --- a/mobsf/MobSF/utils.py +++ b/mobsf/MobSF/utils.py @@ -752,6 +752,11 @@ def replace(value, arg): return value.replace(what, to) +def pathify(value): + """Convert to path.""" + return value.replace('.', '/') + + def relative_path(value): """Show relative path to two parents.""" sep = None diff --git a/mobsf/StaticAnalyzer/views/android/static_analyzer.py b/mobsf/StaticAnalyzer/views/android/static_analyzer.py index 91300c5712..a778aca104 100755 --- a/mobsf/StaticAnalyzer/views/android/static_analyzer.py +++ b/mobsf/StaticAnalyzer/views/android/static_analyzer.py @@ -28,6 +28,7 @@ is_file_exists, is_md5, key, + pathify, print_n_send_error_response, relative_path, ) @@ -107,6 +108,7 @@ register.filter('key', key) register.filter('android_component', android_component) register.filter('relative_path', relative_path) +register.filter('pathify', pathify) @login_required diff --git a/mobsf/templates/base/list_href.html b/mobsf/templates/base/list_href.html new file mode 100644 index 0000000000..bebee28766 --- /dev/null +++ b/mobsf/templates/base/list_href.html @@ -0,0 +1,8 @@ +{% if list|length != 0 %} +
+ {% if list|length < limit %}Showing{% else %}Show{% endif %} all {{ list | length }} {{ type }} + {% for val in list %} + {{ val }}
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/mobsf/templates/dynamic_analysis/android/dynamic_analysis.html b/mobsf/templates/dynamic_analysis/android/dynamic_analysis.html index 16cd4e5bea..5336c33dac 100644 --- a/mobsf/templates/dynamic_analysis/android/dynamic_analysis.html +++ b/mobsf/templates/dynamic_analysis/android/dynamic_analysis.html @@ -89,13 +89,13 @@

Android Runtime not found!

MobSF Dynamic Analyzer Supports

• Genymotion Android VM version 4.1 - 11.0 (arm64, x86, upto API 30)
- • Android Emulator AVD (non production) version 5.0 - 9.0 (arm, arm64, x86, and x86_64 upto API 28)
+ • Android Emulator AVD (non production) version 5.0 - 11.0 (arm, arm64, x86, and x86_64 upto API 30)
• Corellium Android VM (userdebug builds) version 7.1.2 - 11.0 (arm64 upto API 30)

{% if android_version %} Android version >= 9.0 recommended
- Detected Android Version: {{android_version}}, SDK: {{ android_sdk }}
+ Detected Android Version: {{android_version}}, SDK: API level {{ android_sdk }}
{% if android_sdk|floatformat > android_supported|floatformat %}