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.57k stars 3.25k forks source link

Error Connecting to Frida while Starting Instrumentation. #1192

Closed vijithvellora closed 4 years ago

vijithvellora commented 4 years ago

ENVIRONMENT

OS and Version: ubuntu 16.04
Python Version: Python 3.6.9
MobSF Version: v2.0 beta

EXPLANATION OF THE ISSUE

After successfully finished the static analysis and going for the dynamic analysis its all good up-to the stage where we need to click the Start Instrumentation. Its showing Frida server is running and suddenly it falling into an error, which is Error Connecting to Frida.

STEPS TO REPRODUCE THE ISSUE

1. Uploading APK and Completed the static Analysis
2. Moving to Dynamic analysis tab and completed the MobSFy Android Run time Successfully without any error
3.  Selecting an app for Dynamic analysis and clicking on the Start instrumentation
4.  log showing frida server is running 
5.  Next the error occurring Error Connecting To Frida

LOG FILE

[2019-12-06 15:36:51 +0530] [31620] [INFO] Starting gunicorn 20.0.0
[2019-12-06 15:36:51 +0530] [31620] [INFO] Listening at: http://0.0.0.0:8000 (31620)
[2019-12-06 15:36:51 +0530] [31620] [INFO] Using worker: threads
[2019-12-06 15:36:51 +0530] [31624] [INFO] Booting worker with pid: 31624
[INFO] 06/Dec/2019 10:06:58 - 
  __  __       _    ____  _____         ____    ___  
 |  \/  | ___ | |__/ ___||  ___| __   _|___ \  / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_    \ \ / / __) || | | |
 | |  | | (_) | |_) |__) |  _|    \ V / / __/ | |_| |
 |_|  |_|\___/|_.__/____/|_|       \_/ |_____(_)___/ 

[INFO] 06/Dec/2019 10:06:59 - Mobile Security Framework v2.0.7 Beta
REST API Key: 900d48052fd0534005f3c70975e286c2611df751710dafca14588a537eae2edd
[INFO] 06/Dec/2019 10:06:59 - OS: Linux
[INFO] 06/Dec/2019 10:06:59 - Platform: Linux-4.15.0-70-generic-x86_64-with-Ubuntu-16.04-xenial
[INFO] 06/Dec/2019 10:06:59 - Dist: ubuntu 16.04 xenial
[INFO] 06/Dec/2019 10:06:59 - MobSF Basic Environment Check
[WARNING] 06/Dec/2019 10:06:59 - Multiple ADB locations found. Set adb path, ADB_BINARY in MobSF/settings.py with same adb binary location used by Genymotion VM/Android VM.
[WARNING] 06/Dec/2019 10:06:59 - {'/home/ubuntu/Android/platform-tools/adb', '/home/ubuntu/Downloads/genymotion/tools/adb'}
[INFO] 06/Dec/2019 10:06:59 - Checking for Update.
[WARNING] 06/Dec/2019 10:07:00 - Not Found: /robots.txt
[INFO] 06/Dec/2019 10:07:01 - No updates available.
[2019-12-06 15:37:08 +0530] [31620] [INFO] Handling signal: winch
[INFO] 06/Dec/2019 10:08:18 - MobSFying Android instance
* daemon not running; starting now at tcp:5037
* daemon started successfully
[INFO] 06/Dec/2019 10:08:21 - ADB Restarted
[INFO] 06/Dec/2019 10:08:21 - Waiting for 2 seconds...
[INFO] 06/Dec/2019 10:08:23 - Connecting to Android 192.168.56.102
[INFO] 06/Dec/2019 10:08:23 - Remounting /system
[INFO] 06/Dec/2019 10:08:23 - Android Version identified as 8.0
[INFO] 06/Dec/2019 10:08:23 - Android instance architecture identified as x86
[INFO] 06/Dec/2019 10:08:23 - Copying frida server
[INFO] 06/Dec/2019 10:08:24 - Installing MobSF RootCA
[INFO] 06/Dec/2019 10:08:25 - Installing MobSF Clipboard Dumper
[INFO] 06/Dec/2019 10:08:26 - MobSFying Completed!
[INFO] 06/Dec/2019 10:09:01 - Creating Dynamic Analysis Environment
* daemon not running; starting now at tcp:5037
* daemon started successfully
[INFO] 06/Dec/2019 10:09:04 - ADB Restarted
[INFO] 06/Dec/2019 10:09:04 - Waiting for 2 seconds...
[INFO] 06/Dec/2019 10:09:06 - Connecting to Android 192.168.56.102
[INFO] 06/Dec/2019 10:09:06 - Remounting /system
[INFO] 06/Dec/2019 10:09:06 - Android Version identified as 8.0
[INFO] 06/Dec/2019 10:09:06 - Environment MobSFyed Check
[INFO] 06/Dec/2019 10:09:07 - Starting HTTPs Proxy on 1337
[INFO] 06/Dec/2019 10:09:07 - Enabling ADB Reverse TCP on 1337
[INFO] 06/Dec/2019 10:09:07 - Setting Global Proxy for Android VM
[INFO] 06/Dec/2019 10:09:07 - Starting Clipboard Monitor
[INFO] 06/Dec/2019 10:09:07 - Getting screen resolution
[INFO] 06/Dec/2019 10:09:07 - Installing APK
[INFO] 06/Dec/2019 10:09:12 - Testing Environment is Ready!
[INFO] 06/Dec/2019 10:09:16 - Starting Instrumentation
[INFO] 06/Dec/2019 10:09:16 - Frida Server is running
[ERROR] 06/Dec/2019 10:09:20 - Error Connecting to Frida
Traceback (most recent call last):
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/frida_core.py", line 109, in connect
    device = frida.get_device(get_device(), settings.FRIDA_TIMEOUT)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/__init__.py", line 86, in get_device
    return get_device_manager().get_device(id, timeout, **kwargs)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/core.py", line 48, in get_device
    return self.get_device_matching(lambda d: d.id == id, timeout, **kwargs)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/core.py", line 58, in get_device_matching
    return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found
[INFO] 06/Dec/2019 10:09:33 - Starting Instrumentation
[INFO] 06/Dec/2019 10:09:33 - Frida Server is running
[ERROR] 06/Dec/2019 10:09:37 - Error Connecting to Frida
Traceback (most recent call last):
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/frida_core.py", line 109, in connect
    device = frida.get_device(get_device(), settings.FRIDA_TIMEOUT)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/__init__.py", line 86, in get_device
    return get_device_manager().get_device(id, timeout, **kwargs)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/core.py", line 48, in get_device
    return self.get_device_matching(lambda d: d.id == id, timeout, **kwargs)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "/home/ubuntu/Desktop/Tools/Mobile-Security-Framework-MobSF/venv/lib/python3.6/site-packages/frida/core.py", line 58, in get_device_matching
    return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found
superpoussin22 commented 4 years ago

can you upgrade to Python 3.7.X ?

ajinabraham commented 4 years ago

What did you see as ip address of the device when you are at the dynamic analysis page? Is the Genymotion device already running when you click on start instrumentation?

ajinabraham commented 4 years ago

Also there is a conflicting adb in your system. Make sure you are not running Android studio, android emulator or your own phone connected to your computer in developer mode.

I see two adb location

INFO] 06/Dec/2019 10:06:59 - MobSF Basic Environment Check
[WARNING] 06/Dec/2019 10:06:59 - Multiple ADB locations found. Set adb path, ADB_BINARY in MobSF/settings.py with same adb binary location used by Genymotion VM/Android VM.
[WARNING] 06/Dec/2019 10:06:59 - {'/home/ubuntu/Android/platform-tools/adb', '/home/ubuntu/Downloads/genymotion/tools/adb'}

You need to set ADB_BINARY with the Genymotion adb path.

vijithvellora commented 4 years ago

What did you see as ip address of the device when you are at the dynamic analysis page? Is the Genymotion device already running when you click on start instrumentation?

Yes the genymotion started before the dynamic analysis. IP address is showing as set in the settings.py

Also there is a conflicting adb in your system. Make sure you are not running Android studio, android emulator or your own phone connected to your computer in developer mode.

I see two adb location

INFO] 06/Dec/2019 10:06:59 - MobSF Basic Environment Check
[WARNING] 06/Dec/2019 10:06:59 - Multiple ADB locations found. Set adb path, ADB_BINARY in MobSF/settings.py with same adb binary location used by Genymotion VM/Android VM.
[WARNING] 06/Dec/2019 10:06:59 - {'/home/ubuntu/Android/platform-tools/adb', '/home/ubuntu/Downloads/genymotion/tools/adb'}

You need to set ADB_BINARY with the Genymotion adb path.

Please allow me to check this, My friend was also having the same issue while doing, im not sure whether he is also running more adb. I will respond after checking this.

anupshaw50 commented 4 years ago

I am having the same issue, Please find my logs

2019-12-09 14:49:40 +0530] [18084] [INFO] Starting gunicorn 20.0.4
[2019-12-09 14:49:40 +0530] [18084] [INFO] Listening at: http://0.0.0.0:8000 (18084)
[2019-12-09 14:49:40 +0530] [18084] [INFO] Using worker: threads
[2019-12-09 14:49:40 +0530] [18087] [INFO] Booting worker with pid: 18087
[INFO] 09/Dec/2019 09:19:46 - 
  __  __       _    ____  _____       _____  ___  
 |  \/  | ___ | |__/ ___||  ___|_   _|___ / / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_  \ \ / / |_ \| | | |
 | |  | | (_) | |_) |__) |  _|  \ V / ___) | |_| |
 |_|  |_|\___/|_.__/____/|_|     \_/ |____(_)___/

[INFO] 09/Dec/2019 09:19:46 - Mobile Security Framework v3.0.0 Beta
REST API Key: 7f19f94738161bfa3bb1945fdc0d9da02667e35438fe296f95824b8b3ef888f9
[INFO] 09/Dec/2019 09:19:46 - OS: Linux
[INFO] 09/Dec/2019 09:19:46 - Platform: Linux-5.0.0-37-generic-x86_64-with-Ubuntu-19.04-disco
[INFO] 09/Dec/2019 09:19:46 - Dist: ubuntu 19.04 disco
[INFO] 09/Dec/2019 09:19:46 - MobSF Basic Environment Check
[INFO] 09/Dec/2019 09:19:46 - Checking for Update.
[INFO] 09/Dec/2019 09:19:46 - No updates available.
[WARNING] 09/Dec/2019 09:19:46 - Not Found: /static/favicon.ico
[INFO] 09/Dec/2019 09:20:16 - MIME Type: application/vnd.android.package-archive FILE: hr.apk
[INFO] 09/Dec/2019 09:20:16 - Performing Static Analysis of Android APK
[INFO] 09/Dec/2019 09:20:16 - Starting Analysis on : HR.apk
[INFO] 09/Dec/2019 09:20:16 - Generating Hashes
[INFO] 09/Dec/2019 09:20:16 - Unzipping
[INFO] 09/Dec/2019 09:20:16 - Getting Hardcoded Certificates/Keystores
[INFO] 09/Dec/2019 09:20:16 - APK Extracted
[INFO] 09/Dec/2019 09:20:16 - Converting AXML to XML
[INFO] 09/Dec/2019 09:20:19 - Reading Android Manifest
[INFO] 09/Dec/2019 09:20:19 - Parsing AndroidManifest.xml
[INFO] 09/Dec/2019 09:20:19 - Fetching icon path
[INFO] 09/Dec/2019 09:20:19 - Extracting Manifest Data
[INFO] 09/Dec/2019 09:20:19 - Fetching Details from Play Store: sg.com.income.hrappuat
[INFO] 09/Dec/2019 09:20:19 - Manifest Analysis Started
[INFO] 09/Dec/2019 09:20:19 - Static Android Binary Analysis Started
[INFO] 09/Dec/2019 09:20:19 - Static Android Resource Analysis Started
[INFO] 09/Dec/2019 09:20:19 - Reading Code Signing Certificate
[INFO] 09/Dec/2019 09:20:19 - Running APKiD 2.0.3
[INFO] 09/Dec/2019 09:20:23 - Trackers Database is up-to-date
[INFO] 09/Dec/2019 09:20:23 - Detecting Trackers
[INFO] 09/Dec/2019 09:20:24 - APK -> JAVA
[INFO] 09/Dec/2019 09:20:24 - Decompiling to Java with jadx
[INFO] 09/Dec/2019 09:20:34 - DEX -> SMALI
[INFO] 09/Dec/2019 09:20:34 - Converting classes.dex to Smali Code
[INFO] 09/Dec/2019 09:20:34 - Static Android Code Analysis Started
[INFO] 09/Dec/2019 09:20:34 - Code Analysis Started on - java_source
[INFO] 09/Dec/2019 09:20:36 - Finished Code Analysis, Email and URL Extraction
[INFO] 09/Dec/2019 09:20:36 - Extracting Strings from APK
[INFO] 09/Dec/2019 09:20:36 - Detecting Firebase URL(s)
[INFO] 09/Dec/2019 09:20:37 - Performing Malware Check on extracted Domains
[INFO] 09/Dec/2019 09:20:40 - Malware Database is up-to-date
[INFO] 09/Dec/2019 09:20:40 - Connecting to Database
[INFO] 09/Dec/2019 09:20:40 - Saving to Database
[INFO] 09/Dec/2019 09:20:57 - MobSFying Android instance
* daemon not running; starting now at tcp:5037
* daemon started successfully
[INFO] 09/Dec/2019 09:21:00 - ADB Restarted
[INFO] 09/Dec/2019 09:21:00 - Waiting for 2 seconds...
[INFO] 09/Dec/2019 09:21:02 - Connecting to Android 192.168.58.102
[INFO] 09/Dec/2019 09:21:02 - Remounting /system
[INFO] 09/Dec/2019 09:21:02 - Android Version identified as 7.0
[INFO] 09/Dec/2019 09:21:02 - Android instance architecture identified as x86
[INFO] 09/Dec/2019 09:21:02 - Copying frida server
[INFO] 09/Dec/2019 09:21:03 - Installing MobSF RootCA
[INFO] 09/Dec/2019 09:21:03 - Installing MobSF Clipboard Dumper
[INFO] 09/Dec/2019 09:21:03 - MobSFying Completed!
[INFO] 09/Dec/2019 09:21:08 - Creating Dynamic Analysis Environment
* daemon not running; starting now at tcp:5037
* daemon started successfully
[INFO] 09/Dec/2019 09:21:11 - ADB Restarted
[INFO] 09/Dec/2019 09:21:11 - Waiting for 2 seconds...
[INFO] 09/Dec/2019 09:21:13 - Connecting to Android 192.168.58.102
[INFO] 09/Dec/2019 09:21:13 - Remounting /system
[INFO] 09/Dec/2019 09:21:13 - Android Version identified as 7.0
[INFO] 09/Dec/2019 09:21:13 - Environment MobSFyed Check
[INFO] 09/Dec/2019 09:21:13 - Starting HTTPs Proxy on 1337
[INFO] 09/Dec/2019 09:21:13 - Enabling ADB Reverse TCP on 1337
[INFO] 09/Dec/2019 09:21:13 - Setting Global Proxy for Android VM
[INFO] 09/Dec/2019 09:21:13 - Starting Clipboard Monitor
[INFO] 09/Dec/2019 09:21:13 - Getting screen resolution
[INFO] 09/Dec/2019 09:21:13 - Installing APK
[INFO] 09/Dec/2019 09:21:15 - Testing Environment is Ready!
[INFO] 09/Dec/2019 09:21:20 - Starting Instrumentation
[INFO] 09/Dec/2019 09:21:20 - Frida Server is running
[ERROR] 09/Dec/2019 09:21:24 - Error Connecting to Frida
Traceback (most recent call last):
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/frida_core.py", line 109, in connect
    device = frida.get_device(get_device(), settings.FRIDA_TIMEOUT)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/__init__.py", line 86, in get_device
    return get_device_manager().get_device(id, timeout, **kwargs)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/core.py", line 48, in get_device
    return self.get_device_matching(lambda d: d.id == id, timeout, **kwargs)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/core.py", line 58, in get_device_matching
    return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found

Please let me know how can i fix this

python version Python 3.7.3

vijithvellora commented 4 years ago

I am having the same issue, Please find my logs

2019-12-09 14:49:40 +0530] [18084] [INFO] Starting gunicorn 20.0.4
[2019-12-09 14:49:40 +0530] [18084] [INFO] Listening at: http://0.0.0.0:8000 (18084)
[2019-12-09 14:49:40 +0530] [18084] [INFO] Using worker: threads
[2019-12-09 14:49:40 +0530] [18087] [INFO] Booting worker with pid: 18087
[INFO] 09/Dec/2019 09:19:46 - 
  __  __       _    ____  _____       _____  ___  
 |  \/  | ___ | |__/ ___||  ___|_   _|___ / / _ \ 
 | |\/| |/ _ \| '_ \___ \| |_  \ \ / / |_ \| | | |
 | |  | | (_) | |_) |__) |  _|  \ V / ___) | |_| |
 |_|  |_|\___/|_.__/____/|_|     \_/ |____(_)___/

[INFO] 09/Dec/2019 09:19:46 - Mobile Security Framework v3.0.0 Beta
REST API Key: 7f19f94738161bfa3bb1945fdc0d9da02667e35438fe296f95824b8b3ef888f9
[INFO] 09/Dec/2019 09:19:46 - OS: Linux
[INFO] 09/Dec/2019 09:19:46 - Platform: Linux-5.0.0-37-generic-x86_64-with-Ubuntu-19.04-disco
[INFO] 09/Dec/2019 09:19:46 - Dist: ubuntu 19.04 disco
[INFO] 09/Dec/2019 09:19:46 - MobSF Basic Environment Check
[INFO] 09/Dec/2019 09:19:46 - Checking for Update.
[INFO] 09/Dec/2019 09:19:46 - No updates available.
[WARNING] 09/Dec/2019 09:19:46 - Not Found: /static/favicon.ico
[INFO] 09/Dec/2019 09:20:16 - MIME Type: application/vnd.android.package-archive FILE: hr.apk
[INFO] 09/Dec/2019 09:20:16 - Performing Static Analysis of Android APK
[INFO] 09/Dec/2019 09:20:16 - Starting Analysis on : HR.apk
[INFO] 09/Dec/2019 09:20:16 - Generating Hashes
[INFO] 09/Dec/2019 09:20:16 - Unzipping
[INFO] 09/Dec/2019 09:20:16 - Getting Hardcoded Certificates/Keystores
[INFO] 09/Dec/2019 09:20:16 - APK Extracted
[INFO] 09/Dec/2019 09:20:16 - Converting AXML to XML
[INFO] 09/Dec/2019 09:20:19 - Reading Android Manifest
[INFO] 09/Dec/2019 09:20:19 - Parsing AndroidManifest.xml
[INFO] 09/Dec/2019 09:20:19 - Fetching icon path
[INFO] 09/Dec/2019 09:20:19 - Extracting Manifest Data
[INFO] 09/Dec/2019 09:20:19 - Fetching Details from Play Store: sg.com.income.hrappuat
[INFO] 09/Dec/2019 09:20:19 - Manifest Analysis Started
[INFO] 09/Dec/2019 09:20:19 - Static Android Binary Analysis Started
[INFO] 09/Dec/2019 09:20:19 - Static Android Resource Analysis Started
[INFO] 09/Dec/2019 09:20:19 - Reading Code Signing Certificate
[INFO] 09/Dec/2019 09:20:19 - Running APKiD 2.0.3
[INFO] 09/Dec/2019 09:20:23 - Trackers Database is up-to-date
[INFO] 09/Dec/2019 09:20:23 - Detecting Trackers
[INFO] 09/Dec/2019 09:20:24 - APK -> JAVA
[INFO] 09/Dec/2019 09:20:24 - Decompiling to Java with jadx
[INFO] 09/Dec/2019 09:20:34 - DEX -> SMALI
[INFO] 09/Dec/2019 09:20:34 - Converting classes.dex to Smali Code
[INFO] 09/Dec/2019 09:20:34 - Static Android Code Analysis Started
[INFO] 09/Dec/2019 09:20:34 - Code Analysis Started on - java_source
[INFO] 09/Dec/2019 09:20:36 - Finished Code Analysis, Email and URL Extraction
[INFO] 09/Dec/2019 09:20:36 - Extracting Strings from APK
[INFO] 09/Dec/2019 09:20:36 - Detecting Firebase URL(s)
[INFO] 09/Dec/2019 09:20:37 - Performing Malware Check on extracted Domains
[INFO] 09/Dec/2019 09:20:40 - Malware Database is up-to-date
[INFO] 09/Dec/2019 09:20:40 - Connecting to Database
[INFO] 09/Dec/2019 09:20:40 - Saving to Database
[INFO] 09/Dec/2019 09:20:57 - MobSFying Android instance
* daemon not running; starting now at tcp:5037
* daemon started successfully
[INFO] 09/Dec/2019 09:21:00 - ADB Restarted
[INFO] 09/Dec/2019 09:21:00 - Waiting for 2 seconds...
[INFO] 09/Dec/2019 09:21:02 - Connecting to Android 192.168.58.102
[INFO] 09/Dec/2019 09:21:02 - Remounting /system
[INFO] 09/Dec/2019 09:21:02 - Android Version identified as 7.0
[INFO] 09/Dec/2019 09:21:02 - Android instance architecture identified as x86
[INFO] 09/Dec/2019 09:21:02 - Copying frida server
[INFO] 09/Dec/2019 09:21:03 - Installing MobSF RootCA
[INFO] 09/Dec/2019 09:21:03 - Installing MobSF Clipboard Dumper
[INFO] 09/Dec/2019 09:21:03 - MobSFying Completed!
[INFO] 09/Dec/2019 09:21:08 - Creating Dynamic Analysis Environment
* daemon not running; starting now at tcp:5037
* daemon started successfully
[INFO] 09/Dec/2019 09:21:11 - ADB Restarted
[INFO] 09/Dec/2019 09:21:11 - Waiting for 2 seconds...
[INFO] 09/Dec/2019 09:21:13 - Connecting to Android 192.168.58.102
[INFO] 09/Dec/2019 09:21:13 - Remounting /system
[INFO] 09/Dec/2019 09:21:13 - Android Version identified as 7.0
[INFO] 09/Dec/2019 09:21:13 - Environment MobSFyed Check
[INFO] 09/Dec/2019 09:21:13 - Starting HTTPs Proxy on 1337
[INFO] 09/Dec/2019 09:21:13 - Enabling ADB Reverse TCP on 1337
[INFO] 09/Dec/2019 09:21:13 - Setting Global Proxy for Android VM
[INFO] 09/Dec/2019 09:21:13 - Starting Clipboard Monitor
[INFO] 09/Dec/2019 09:21:13 - Getting screen resolution
[INFO] 09/Dec/2019 09:21:13 - Installing APK
[INFO] 09/Dec/2019 09:21:15 - Testing Environment is Ready!
[INFO] 09/Dec/2019 09:21:20 - Starting Instrumentation
[INFO] 09/Dec/2019 09:21:20 - Frida Server is running
[ERROR] 09/Dec/2019 09:21:24 - Error Connecting to Frida
Traceback (most recent call last):
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/frida_core.py", line 109, in connect
    device = frida.get_device(get_device(), settings.FRIDA_TIMEOUT)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/__init__.py", line 86, in get_device
    return get_device_manager().get_device(id, timeout, **kwargs)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/core.py", line 48, in get_device
    return self.get_device_matching(lambda d: d.id == id, timeout, **kwargs)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "/home/anup/Documents/Mobile-Security-Framework-MobSF/venv/lib/python3.7/site-packages/frida/core.py", line 58, in get_device_matching
    return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found

Please let me know how can i fix this

python version Python 3.7.3

so this is the output we are receiving after checking with python 3.7.3 @superpoussin22

and there is no multiple adb running while doing this, and the genymotion ip is alredy added in settings.py. @ajinabraham

ajinabraham commented 4 years ago

Do not add IP to settings.py when you are running normally. MobSF should auto detect it.

From the exception it looks like you have a wrong IP

get_device_matching
    return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found

Just make sure Genymotion VM is running before you attempt dynamic analysis and this pagehttp://127.0.0.1:8000/dynamic_analysis/ doesn't show any connectivity errors.

vijithvellora commented 4 years ago

its working fine now, thanks for the support @ajinabraham @superpoussin22

I'm closing it @anupshaw50