Closed deepakexodia closed 7 years ago
Should be fine. Does this break anything?
not yet, so far Dynamic Analyser seems to wok fine
BTW thanks for prompt reply
Hello, first of all thank the creation of this Framework because it is very useful.
I am ending the dynamic analysis, I click Finish and gives me this error, unable to finish the task. Any ideas?
[ERROR] Device Data Dump (/home/android/Documents/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android.py, LINE 332 "if "MOBSEC-TAR-CREATED" in subprocess.check_output([adb, "-s", getIdentifier(), "shell", "cat", "/sdcard/mobsec_status"]):"): Command '['/home/android/Documents/Mobile-Security-Framework-MobSF/DynamicAnalyzer/tools/adb/linux/adb', '-s', '192.168.1.61:5555', 'shell', 'cat', '/sdcard/mobsec_status']' returned non-zero exit status 255
The error is fine most of the time. Are you getting the Dynamic Analysis Result?
No, I get the final result. Throws that error in the Terminal, and the Web part (test completed) do not let anything else.
I mean, does not end the dynamic analysis and therefore do not get the results.
PS: It happens with different APK'S
So are you telling that the analyisis get stuck and the results page doesn't show up? Are you using MobSF VM or a different one?
Exact. Each view that attempt to "finalize" a dynamic analysis (always talk of dynamic analysis) of the apk, I returned the mistake I commented:
"[ERROR] Device Data Dump (/home/android/Documents/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android.py, LINE 332" if "MOBSEC-TAR-CREATED" in ....... ................ "and then everything is" frozen "and can not get the report / results of the dynamic analysis of MobSF.
Use Android Tamer VM, with MobSF downloaded via github (latest version), and use a terminal physical android, rooted. Basically because I have many problems with virtual machines (VMs) for detecting adb, ethernet network as they are in other subnets and continually I have problems to "look" between them. Therefore use a physical terminal.
If VM is giving trouble, you can try using a real device. https://github.com/ajinabraham/Mobile-Security-Framework-MobSF/wiki/1.-Documentation#configuring-rooted-android-devicecustom-vm-with-mobsf
The above error should not affect you ideally.
@ajinabraham im getting a similar issue, i run the dynamic analyzer and get several of these... (im using latest mobsf version and on real device. thanks!
[ERROR] adb_command (/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/shared.py, LINE 67 "result = subprocess.check_output(args)"): Command '['/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/tools/adb/linux/adb', '-s', '192.168.1.16:5555', 'pull', '/data/local/screen.png', '/opt/Mobile-Security-Framework-MobSF/uploads/9cc1f13ea9f9f88a3c28f698300ccf84/screenshots-apk/expact-1.png']' returned non-zero exit status 1.
then it finishes and and i hit the finish button and it states that its dumping logs, etc, etc and it prints out the following... (i also get no report, page displays "Don't Play Around. An Error just popped in!")
[INFO] Collecting Data and Cleaning Up
[INFO] Downloading Logcat logs
[2018-09-11 17:34:36] [ERROR] adb_command (/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/shared.py, LINE 67 "result = subprocess.check_output(args)"): Command '['/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/tools/adb/linux/adb', '-s', '192.168.1.16:5555', 'pull', '/data/data/de.robv.android.xposed.installer/log/error.log', '/opt/Mobile-Security-Framework-MobSF/uploads/9cc1f13ea9f9f88a3c28f698300ccf84/x_logcat.txt']' returned non-zero exit status 1.
[INFO] Downloading Droidmon API Monitor Logcat logs
[INFO] Downloading Dumpsys logs
[INFO] Stopping Application
[INFO] Stopping ScreenCast Service [11/Sep/2018 17:34:58] "POST /FinalTest/ HTTP/1.1" 200 16
[INFO] Downloading Application Data from Device 127.0.0.1:37366: clientconnect [INFO] Killing CapFuzz UI 127.0.0.1:37366: HTTP protocol error in client request: Invalid HTTP request form (expected: authority or absolute, got: relative) 127.0.0.1:37366: clientdisconnect 127.0.0.1:37368: clientconnect
[INFO] Deleting Dump Status File
[INFO] Creating TAR of Application Files.
[INFO] Waiting for TAR dump to complete...
[ERROR] TAR Generation Failed. Process timed out.
[INFO] Dumping Application Files from Device/VM
[2018-09-11 17:39:59] [ERROR] adb_command (/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/shared.py, LINE 67 "result = subprocess.check_output(args)"): Command '['/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/tools/adb/linux/adb', '-s', '192.168.1.16:5555', 'pull', '/data/local/com.chipotle.ordering.tar', '/opt/Mobile-Security-Framework-MobSF/uploads/9cc1f13ea9f9f88a3c28f698300ccf84/com.chipotle.ordering.tar']' returned non-zero exit status 1.
[INFO] Stopping ADB [11/Sep/2018 17:39:59] "POST /DumpData/ HTTP/1.1" 200 15
[INFO] Dynamic Analysis Report Generation
[INFO] Dynamic API Analysis
[2018-09-11 17:39:59] [ERROR] Dynamic API Analysis (/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/analysis.py, LINE 42 "with open(location, "r") as flip:"): [Errno 2] No such file or directory: '/opt/Mobile-Security-Framework-MobSF/uploads/9cc1f13ea9f9f88a3c28f698300ccf84/x_logcat.txt'
[INFO] Dynamic File Analysis
[2018-09-11 17:39:59] [ERROR] Dynamic Analysis Report Generation (/opt/Mobile-Security-Framework-MobSF/DynamicAnalyzer/views/android/dynamic.py, LINE 660 "analysis_result = run_analysis(app_dir, md5_hash, package)"): [Errno 2] No such file or directory: '/opt/Mobile-Security-Framework-MobSF/uploads/9cc1f13ea9f9f88a3c28f698300ccf84/x_logcat.txt'
From the logs it looks like the Device is preventing file access. Is it rooted properly?
Try running the following command independently and see if adb can pull files from the device. If not, fix that first.
adb -s 192.168.1.16:5555 pull /data/data/de.robv.android.xposed.installer/log/error.log /tmp/x_logcat.txt
@ajinabraham yes it is rooted properly.
root@kaliMachine:~/Downloads# adb -s 192.168.1.16:5555 pull /data/data/de.robv.android.xposed.installer/log/error.log /tmp/x_logcat.txt adb: error: remote object '/data/data/de.robv.android.xposed.installer/log/error.log' does not exist but file is there....i assume its a permissions issue. ive tinkered with it and cant get it right. root@hammerhead:/data/data/de.robv.android.xposed.installer/log # ls error.log root@hammerhead:/data/data/de.robv.android.xposed.installer/log # ls -l -rwxrw-rw- root root 1224 2018-09-14 10:42 error.log
@ITmustang You need to mount the storage before trying to access the file. Once you mount and access the file let me know the mounting command that you have used.
@ajinabraham sorry for delay. so ive come to the conclusion that something isnt right with the root on my android test phone, ive checked and recheck permissions, etc and everything looks good permissions wise. I can do this adb -s command on my rooted android tablet and it works perfectly. for now i need to work on perhaps resetting and re-rooting my android phone.
Following. My configuration is Android 5.0.0 running on GenyMotion and Xposed is working properly so is adb. I tried increasing the timeout since it had a timeout error but i am getting the exact same error still after timeout
Static Analysis works correclty but i have same problem on Dynamic Analysis; and got some error but do not stuck, before reporting the result ,it stuck and return Error. in VM(vb+genymotion) i have similar problem too : could you please gimme some information about it ?
You need to enable 32 bit execution support in Kali. If your Kali Linux is a VM it won't work. MobSF has to run on host machine.
I have a special thanks to you; That problem solved after modifying and checking all configuration from beginning. I have another question; is there any way to analysis all applications with any api level dynamically? I checked some apk files and found that MobSF on vm (ova) can do dynamic analysis on some of application.
Sincerely; Zackariya
On Wed, Jul 17, 2019 at 7:34 PM Ajin Abraham notifications@github.com wrote:
You need to enable 32 bit execution support in Kali. If your Kali Linux is a VM it won't work. MobSF has to run on host machine.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MobSF/Mobile-Security-Framework-MobSF/issues/206?email_source=notifications&email_token=AMRJU3OUXUATJ4D5DVMXEC3P74YGTA5CNFSM4CLGEB32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2EQEXI#issuecomment-512295517, or mute the thread https://github.com/notifications/unsubscribe-auth/AMRJU3KEVSZ32C7JL6HU7WDP74YGTANCNFSM4CLGEB3Q .
Use a real rooted android device that support the API version you need.
Hello, I installed the application on the MacOS. But when I install the .apk file I get an error like this. Can you help me?
Error Raised when run() is called with check=True and the process returns a non-zero exit status. Attributes: cmd, returncode, stdout, stderr, output
Command '['java', '-jar', '/Users/macbookpro/Desktop/Mobsf/Mobile-Security-Framework-MobSF/StaticAnalyzer/tools/baksmali-2.3.4.jar', 'list', 'classes', '/Users/macbookpro/Desktop/Mobsf/Mobile-Security-Framework-MobSF/uploads/5056143f11c8a34b5d875d808360d3be/classes2.dex']' returned non-zero exit status 1.
You need to install required version of Java and set JAVA_HOME environment variable or set JAVA path in settings.py
I keep getting this any ideas? [INFO] 14/Apr/2024 05:42:24 - Connecting to Android adb://192.168.56.101:5555 [INFO] 14/Apr/2024 05:42:24 - Waiting for 2 seconds... [ERROR] 14/Apr/2024 05:42:26 - Error Running ADB Command Traceback (most recent call last): File "/home/mobsf/Mobile-Security-Framework-MobSF/mobsf/DynamicAnalyzer/views/android/environment.py", line 167, in adb_command result = subprocess.check_output( File "/usr/lib/python3.10/subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/usr/bin/adb', '-s', 'adb://192.168.56.101:5555', 'shell', 'getprop', 'ro.build.version.release']' returned non-zero exit status 1. [INFO] 14/Apr/2024 05:42:34 - MobSFying Android instance [INFO] 14/Apr/2024 05:42:37 - ADB Restarted [INFO] 14/Apr/2024 05:42:37 - Waiting for 2 seconds... [INFO] 14/Apr/2024 05:42:39 - Connecting to Android adb://192.168.56.101:5555 [INFO] 14/Apr/2024 05:42:39 - Waiting for 2 seconds... [INFO] 14/Apr/2024 05:42:41 - Restarting ADB Daemon as root adb: unable to connect for root: device 'adb://192.168.56.101:5555' not found [ERROR] 14/Apr/2024 05:42:41 - MobSFying Android instance failed
pls find the logs of the issue
[2016-08-01 17:50:57] [ERROR] Device Data Dump (C:\MobSF\DynamicAnalyzer\views\android.py, LINE 332 "if "MOBSEC-TAR-CREATED" in subprocess.check_output([adb, "-s", getIdentifier(), "shell", "cat", "/sdcard/mobsec_status"]):"): Command '['C:\MobSF\DynamicAnalyzer/tools/adb/windows/adb.exe', '-s', '192.168.56.101:5555', 'shell', 'cat', '/sdcard/mobsec_status']' returned non-zero exit status -1
and let me know how to resolve it