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.46k stars 3.23k forks source link

incompatible with this version of YARA #1173

Closed c4u53 closed 5 years ago

c4u53 commented 5 years ago

ENVIRONMENT

OS and Version: Linux kali 5.2.0-kali2-686-pae #1 SMP Debian 5.2.9-2kali1 (2019-08-22) i686 GNU/Linux

Python Version: Python 3.7.5

MobSF Version: v2.0 beta

EXPLANATION OF THE ISSUE

After uploading the apk it gives me error 

rules file "/usr/local/lib/python3.7/dist-packages/apkid/rules/rules.yarc" is incompatible with this version of YARA

STEPS TO REPRODUCE THE ISSUE

1. Install in kali as  in docs 
2. run the server
3. upload the apk then the error message appear

LOG FILE

[INFO] 16/Nov/2019 11:49:26 - 
  __  __       _    ____  _____         ____    ___  
 |  \/  | ___ | |__/ ___||  ___| __   _|___ \  / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_    \ \ / / __) || | | |
 | |  | | (_) | |_) |__) |  _|    \ V / / __/ | |_| |
 |_|  |_|\___/|_.__/____/|_|       \_/ |_____(_)___/ 

[INFO] 16/Nov/2019 11:49:26 - Mobile Security Framework v2.0.7 Beta
[INFO] 16/Nov/2019 11:49:26 - OS: Linux
[INFO] 16/Nov/2019 11:49:26 - Platform: Linux-5.2.0-kali2-686-pae-i686-with-debian-kali-rolling
[INFO] 16/Nov/2019 11:49:26 - Dist: kali 2019.3 kali-rolling
[INFO] 16/Nov/2019 11:49:26 - MobSF Basic Environment Check
[WARNING] 16/Nov/2019 11:49:27 - Dynamic Analysis related functions will not work. 
Make sure a Genymotion Android VM is running before performing Dynamic Analyis.
[INFO] 16/Nov/2019 11:49:27 - Checking for Update.
[INFO] 16/Nov/2019 11:49:27 - No updates available.
[INFO] 16/Nov/2019 11:49:28 - 
  __  __       _    ____  _____         ____    ___  
 |  \/  | ___ | |__/ ___||  ___| __   _|___ \  / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_    \ \ / / __) || | | |
 | |  | | (_) | |_) |__) |  _|    \ V / / __/ | |_| |
 |_|  |_|\___/|_.__/____/|_|       \_/ |_____(_)___/ 

[INFO] 16/Nov/2019 11:49:28 - Mobile Security Framework v2.0.7 Beta
[INFO] 16/Nov/2019 11:49:28 - OS: Linux
[INFO] 16/Nov/2019 11:49:28 - Platform: Linux-5.2.0-kali2-686-pae-i686-with-debian-kali-rolling
[INFO] 16/Nov/2019 11:49:28 - Dist: kali 2019.3 kali-rolling
[INFO] 16/Nov/2019 11:49:28 - MobSF Basic Environment Check
[WARNING] 16/Nov/2019 11:49:28 - Dynamic Analysis related functions will not work. 
Make sure a Genymotion Android VM is running before performing Dynamic Analyis.
[INFO] 16/Nov/2019 11:49:28 - Checking for Update.
[INFO] 16/Nov/2019 11:49:29 - No updates available.
[INFO] 16/Nov/2019 11:49:30 - 
  __  __       _    ____  _____         ____    ___  
 |  \/  | ___ | |__/ ___||  ___| __   _|___ \  / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_    \ \ / / __) || | | |
 | |  | | (_) | |_) |__) |  _|    \ V / / __/ | |_| |
 |_|  |_|\___/|_.__/____/|_|       \_/ |_____(_)___/ 

[INFO] 16/Nov/2019 11:49:30 - Mobile Security Framework v2.0.7 Beta
[INFO] 16/Nov/2019 11:49:30 - OS: Linux
[INFO] 16/Nov/2019 11:49:30 - Platform: Linux-5.2.0-kali2-686-pae-i686-with-debian-kali-rolling
[INFO] 16/Nov/2019 11:49:30 - Dist: kali 2019.3 kali-rolling
[INFO] 16/Nov/2019 11:49:30 - MobSF Basic Environment Check
[WARNING] 16/Nov/2019 11:49:30 - Dynamic Analysis related functions will not work. 
Make sure a Genymotion Android VM is running before performing Dynamic Analyis.
[INFO] 16/Nov/2019 11:49:30 - Checking for Update.
[INFO] 16/Nov/2019 11:49:30 - No updates available.
[INFO] 16/Nov/2019 11:49:31 - 
  __  __       _    ____  _____         ____    ___  
 |  \/  | ___ | |__/ ___||  ___| __   _|___ \  / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_    \ \ / / __) || | | |
 | |  | | (_) | |_) |__) |  _|    \ V / / __/ | |_| |
 |_|  |_|\___/|_.__/____/|_|       \_/ |_____(_)___/ 

[INFO] 16/Nov/2019 11:49:31 - Mobile Security Framework v2.0.7 Beta
[INFO] 16/Nov/2019 11:49:31 - OS: Linux
[INFO] 16/Nov/2019 11:49:31 - Platform: Linux-5.2.0-kali2-686-pae-i686-with-debian-kali-rolling
[INFO] 16/Nov/2019 11:49:31 - Dist: kali 2019.3 kali-rolling
[INFO] 16/Nov/2019 11:49:31 - MobSF Basic Environment Check
[WARNING] 16/Nov/2019 11:49:31 - Dynamic Analysis related functions will not work. 
Make sure a Genymotion Android VM is running before performing Dynamic Analyis.
[INFO] 16/Nov/2019 11:49:31 - Checking for Update.
[INFO] 16/Nov/2019 11:49:32 - No updates available.
[INFO] 16/Nov/2019 11:49:34 - 
  __  __       _    ____  _____         ____    ___  
 |  \/  | ___ | |__/ ___||  ___| __   _|___ \  / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_    \ \ / / __) || | | |
 | |  | | (_) | |_) |__) |  _|    \ V / / __/ | |_| |
 |_|  |_|\___/|_.__/____/|_|       \_/ |_____(_)___/ 

[INFO] 16/Nov/2019 11:49:34 - Mobile Security Framework v2.0.7 Beta
[INFO] 16/Nov/2019 11:49:34 - OS: Linux
[INFO] 16/Nov/2019 11:49:34 - Platform: Linux-5.2.0-kali2-686-pae-i686-with-debian-kali-rolling
[INFO] 16/Nov/2019 11:49:34 - Dist: kali 2019.3 kali-rolling
[INFO] 16/Nov/2019 11:49:34 - MobSF Basic Environment Check
[WARNING] 16/Nov/2019 11:49:34 - Dynamic Analysis related functions will not work. 
Make sure a Genymotion Android VM is running before performing Dynamic Analyis.
[INFO] 16/Nov/2019 11:49:34 - Checking for Update.
[INFO] 16/Nov/2019 11:49:34 - No updates available.
[INFO] 16/Nov/2019 11:49:40 - MIME Type: application/vnd.android.package-archive FILE: notion.apk
[INFO] 16/Nov/2019 11:49:40 - Performing Static Analysis of Android APK
[INFO] 16/Nov/2019 11:49:40 - Starting Analysis on : notion.apk
[INFO] 16/Nov/2019 11:49:40 - Generating Hashes
[INFO] 16/Nov/2019 11:49:40 - Unzipping
[INFO] 16/Nov/2019 11:49:41 - Getting Hardcoded Certificates/Keystores
[INFO] 16/Nov/2019 11:49:41 - APK Extracted
[INFO] 16/Nov/2019 11:49:41 - Converting AXML to XML
[INFO] 16/Nov/2019 11:49:51 - Reading Android Manifest
[INFO] 16/Nov/2019 11:49:51 - Parsing AndroidManifest.xml
[INFO] 16/Nov/2019 11:49:52 - Fetching icon path
[INFO] 16/Nov/2019 11:49:52 - Extracting Manifest Data
[INFO] 16/Nov/2019 11:49:52 - Fetching Details from Play Store: notion.id
[INFO] 16/Nov/2019 11:49:53 - Manifest Analysis Started
[INFO] 16/Nov/2019 11:49:53 - Static Android Binary Analysis Started
[INFO] 16/Nov/2019 11:49:54 - Static Android Resource Analysis Started
[INFO] 16/Nov/2019 11:49:54 - Reading Code Signing Certificate
[INFO] 16/Nov/2019 11:49:54 - Running APKiD 2.0.3
[ERROR] 16/Nov/2019 11:49:54 - Error Performing Static Analysis
Traceback (most recent call last):
  File "/root/Desktop/tools/Mobile-Security-Framework-MobSF/StaticAnalyzer/views/android/static_analyzer.py", line 186, in static_analyzer
    'app_dir'], app_dic['app_path'], app_dic['app_name'])
  File "/root/Desktop/tools/Mobile-Security-Framework-MobSF/MalwareAnalyzer/views/apkid.py", line 40, in apkid_analysis
    rules = options.rules_manager.load()
  File "/usr/local/lib/python3.7/dist-packages/apkid/rules.py", line 43, in load
    self.rules = yara.load(self.rules_path)
yara.Error: rules file "/usr/local/lib/python3.7/dist-packages/apkid/rules/rules.yarc" is incompatible with this version of YARA
[ERROR] 16/Nov/2019 11:49:54 - rules file "/usr/local/lib/python3.7/dist-packages/apkid/rules/rules.yarc" is incompatible with this version of YARA
[ERROR] 16/Nov/2019 11:49:54 - Internal Server Error: /StaticAnalyzer/
Sicks3c commented 5 years ago

What apk have you used ?

c4u53 commented 5 years ago

InsecureBankv2 , and I've tried multiple other apk and the same error happens

c4u53 commented 5 years ago

Yara Version

Requirement already satisfied: yara-python in /usr/lib/python3/dist-packages (3.10.0)
Sicks3c commented 5 years ago

You have kali on Vbox or WSL ?

c4u53 commented 5 years ago

vmware , and the image is from kali's website

Sicks3c commented 5 years ago

before running run.sh did you source venv/bin/activate ?

ajinabraham commented 5 years ago

Make sure you uninstall yara-python that's already in your system and run setup.sh again

ajinabraham commented 5 years ago

This is not a bug, use slack channel for support