Closed vijithvellora closed 4 years ago
can you upgrade to Python 3.7.X ?
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?
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.
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.
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
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
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.
its working fine now, thanks for the support @ajinabraham @superpoussin22
I'm closing it @anupshaw50
ENVIRONMENT
EXPLANATION OF THE ISSUE
STEPS TO REPRODUCE THE ISSUE
LOG FILE