MobSF / Mobile-Security-Framework-MobSF

Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
https://opensecurity.in
GNU General Public License v3.0
17.25k stars 3.22k forks source link

Static analysis Windows 10 report bug #1424

Closed 0xJs closed 4 years ago

0xJs commented 4 years ago

ENVIRONMENT

OS and Version: Windows 10
Python Version: 
MobSF Version: latest

EXPLANATION OF THE ISSUE

What happens, under which versions, under what conditions, when, and what were you expecting instead.

When creating a PFD:

[ERROR] 09/Jun/2020 09:45:15 - Error Generating PDF Report Traceback (most recent call last): File "C:\Tools\Mobile-Security-Framework-MobSF\StaticAnalyzer\views\shared_func.py", line 188, in pdf pdf_dat = pdfkit.from_string(html, False, options=options) File "c:\tools\mobile-security-framework-mobsf\venv\lib\site-packages\pdfkit\api.py", line 72, in from_string return r.to_pdf(output_path) File "c:\tools\mobile-security-framework-mobsf\venv\lib\site-packages\pdfkit\pdfkit.py", line 156, in to_pdf raise IOError('wkhtmltopdf reported an error:\n' + stderr) OSError: wkhtmltopdf reported an error: Exit with code 1 due to network error: ProtocolUnknownError

[ERROR] 09/Jun/2020 09:45:15 - Internal Server Error: /PDF/ ERROR:django.request:Internal Server Error: /PDF/

STEPS TO REPRODUCE THE ISSUE

1. Load in the APK
2. Go to the recent scans
3. Click on the pdf button next to static report

Yes the wkhtmltox binary is in the PATH variables and I can call wkhtmltopdf in my terminal.

LOG FILE

Paste the contents of logs/debug.log here or attach the log file.

| \/ | _ | |_/ || | | / / \ | |\/| |/ | '_ _ | | \ \ / / | | | | | | | | | () | |) |) | _| \ V / ) | || | || ||_/|_./__/|| _/ |____()___/

[INFO] 09/Jun/2020 09:44:24 - Mobile Security Framework v3.0.9 Beta [INFO] 09/Jun/2020 09:44:24 - OS: Windows [INFO] 09/Jun/2020 09:44:24 - Platform: Windows-10-10.0.18362-SP0 [INFO] 09/Jun/2020 09:44:24 - Dist:
[INFO] 09/Jun/2020 09:44:24 - MobSF Basic Environment Check [INFO] 09/Jun/2020 09:44:24 - Checking for Update. [INFO] 09/Jun/2020 09:44:24 - No updates available. [INFO] 09/Jun/2020 09:44:41 - MIME Type: application/octet-stream FILE: medspacenl.medweb.medspacev3.0.5.apk [INFO] 09/Jun/2020 09:44:41 - Performing Static Analysis of Android APK [INFO] 09/Jun/2020 09:44:41 - Starting Analysis on : MedSpacenl.medweb.medspacev3.0.5.apk [INFO] 09/Jun/2020 09:44:41 - Generating Hashes [INFO] 09/Jun/2020 09:44:41 - Unzipping [INFO] 09/Jun/2020 09:44:41 - Getting Hardcoded Certificates/Keystores [INFO] 09/Jun/2020 09:44:41 - APK Extracted [INFO] 09/Jun/2020 09:44:41 - Converting AXML to XML [INFO] 09/Jun/2020 09:44:45 - Reading Android Manifest [INFO] 09/Jun/2020 09:44:45 - Parsing AndroidManifest.xml [INFO] 09/Jun/2020 09:44:45 - Fetching icon path [INFO] 09/Jun/2020 09:44:45 - Extracting Manifest Data [INFO] 09/Jun/2020 09:44:45 - Fetching Details from Play Store: nl.medweb.medspace [INFO] 09/Jun/2020 09:44:45 - Manifest Analysis Started [INFO] 09/Jun/2020 09:44:45 - Static Android Binary Analysis Started [INFO] 09/Jun/2020 09:44:45 - Static Android Resource Analysis Started [INFO] 09/Jun/2020 09:44:45 - Reading Code Signing Certificate [INFO] 09/Jun/2020 09:44:45 - Running APKiD 2.1.0 [INFO] 09/Jun/2020 09:44:47 - Trackers Database is outdated! [INFO] 09/Jun/2020 09:44:47 - Updating Trackers Database.... [INFO] 09/Jun/2020 09:44:47 - Detecting Trackers [INFO] 09/Jun/2020 09:44:48 - APK -> JAVA [INFO] 09/Jun/2020 09:44:48 - Decompiling to Java with jadx [INFO] 09/Jun/2020 09:44:53 - DEX -> SMALI [INFO] 09/Jun/2020 09:44:53 - Converting classes.dex to Smali Code [INFO] 09/Jun/2020 09:44:53 - Static Android Code Analysis Started [INFO] 09/Jun/2020 09:44:53 - Code Analysis Started on - java_source [INFO] 09/Jun/2020 09:44:53 - Finished Code Analysis, Email and URL Extraction [INFO] 09/Jun/2020 09:44:53 - Extracting Strings from APK [INFO] 09/Jun/2020 09:44:54 - Detecting Firebase URL(s) [INFO] 09/Jun/2020 09:44:54 - Performing Malware Check on extracted Domains [INFO] 09/Jun/2020 09:44:56 - Malware Database is up-to-date [INFO] 09/Jun/2020 09:44:56 - Connecting to Database [INFO] 09/Jun/2020 09:44:56 - Saving to Database [INFO] 09/Jun/2020 09:45:14 - Fetching data from DB for PDF Report Generation (Android) [INFO] 09/Jun/2020 09:45:14 - Analysis is already Done. Fetching data from the DB... [INFO] 09/Jun/2020 09:45:14 - Generating PDF report for android apk [ERROR] 09/Jun/2020 09:45:15 - Error Generating PDF Report Traceback (most recent call last): File "C:\Tools\Mobile-Security-Framework-MobSF\StaticAnalyzer\views\shared_func.py", line 188, in pdf pdf_dat = pdfkit.from_string(html, False, options=options) File "c:\tools\mobile-security-framework-mobsf\venv\lib\site-packages\pdfkit\api.py", line 72, in from_string return r.to_pdf(output_path) File "c:\tools\mobile-security-framework-mobsf\venv\lib\site-packages\pdfkit\pdfkit.py", line 156, in to_pdf raise IOError('wkhtmltopdf reported an error:\n' + stderr) OSError: wkhtmltopdf reported an error: Exit with code 1 due to network error: ProtocolUnknownError

ajinabraham commented 4 years ago

This might be a network issue or error with wkhtmltopdf. Please report it here: https://github.com/wkhtmltopdf/wkhtmltopdf