Mobile-Security-Framework-MobSF icon indicating copy to clipboard operation
Mobile-Security-Framework-MobSF copied to clipboard

Can't use feature show screen in Dyanamic Analysis

Open Kongwarriors opened this issue 1 year ago • 2 comments

ENVIRONMENT

OS and Version: window 11
Python Version: 3.11.5
MobSF Version: i clone newest project from github.

EXPLANATION OF THE ISSUE

When i click button show screen in dynamic analysis. I receive some error logs:

[ERROR] 18/Oct/2024 16:29:39 - Internal Server Error: /touch_events/ Traceback (most recent call last): File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\deprecation.py", line 136, in call response = self.process_response(request, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\contrib\sessions\middleware.py", line 46, in process_response patch_vary_headers(response, ("Cookie",)) File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\cache.py", line 309, in patch_vary_headers if response.has_header("Vary"): ^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'has_header' ERROR:django.request:Internal Server Error: /touch_events/ Traceback (most recent call last): File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\deprecation.py", line 136, in call response = self.process_response(request, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\contrib\sessions\middleware.py", line 46, in process_response patch_vary_headers(response, ("Cookie",)) File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\cache.py", line 309, in patch_vary_headers if response.has_header("Vary"): ^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'has_header' [ERROR] 18/Oct/2024 16:29:40 - Internal Server Error: /touch_events/ Traceback (most recent call last): File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\deprecation.py", line 136, in call response = self.process_response(request, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\contrib\sessions\middleware.py", line 46, in process_response patch_vary_headers(response, ("Cookie",)) File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\cache.py", line 309, in patch_vary_headers if response.has_header("Vary"): ^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'has_header' ERROR:django.request:Internal Server Error: /touch_events/ Traceback (most recent call last): File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\deprecation.py", line 136, in call response = self.process_response(request, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\contrib\sessions\middleware.py", line 46, in process_response patch_vary_headers(response, ("Cookie",)) File "C:\Users\PC\AppData\Local\pypoetry\Cache\virtualenvs\mobsf-xBcp37gi-py3.11\Lib\site-packages\django\utils\cache.py", line 309, in patch_vary_headers if response.has_header("Vary"): ^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'has_header'

After test, i click button generate report. I have 1 log:

[ERROR] 18/Oct/2024 16:01:01 - [ERROR] Performing Maltrail Check Traceback (most recent call last): File "D:\App\ToolTestList\Mobile-Security-Framework-MobSF\mobsf\MalwareAnalyzer\views\MalwareDomainCheck.py", line 138, in maltrail_check with io.open(mal_db, ^^^^^^^^^^^^^^^ OSError: [Errno 22] Invalid argument: 'C:\Users\PC\.MobSF\signatures\maltrail-malware-domains.txt'

STEPS TO REPRODUCE THE ISSUE

1. Run application in cmd by "run.bat 127.0.0.1:8000 MOBSF_ANALYZER_IDENTIFIER=emulator-5554"
2. Upload file and static analysis
3. Choose Dynamic analysis.
4. Choose show screen.
5. Testing
6. Choose generate report

Kongwarriors avatar Oct 18 '24 09:10 Kongwarriors

👋 @Kongwarriors Issues is only for reporting a bug/feature request. For limited support, questions, and discussions, please join MobSF Slack channel Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

github-actions[bot] avatar Oct 18 '24 09:10 github-actions[bot]

This is not how you run MobSF on windows. These errors does not corresponds to screen casting.

You can fix C:\Users\PC\.MobSF\signatures\maltrail-malware-domains.txt' by copying over https://github.com/MobSF/Mobile-Security-Framework-MobSF/blob/master/mobsf/signatures/maltrail-malware-domains.txt to the location. I am suspecting this is due to Windows defender deleting this file.

ajinabraham avatar Oct 19 '24 00:10 ajinabraham

This is not how you run MobSF on windows. These errors does not corresponds to screen casting.

You can fix C:\Users\PC\.MobSF\signatures\maltrail-malware-domains.txt' by copying over https://github.com/MobSF/Mobile-Security-Framework-MobSF/blob/master/mobsf/signatures/maltrail-malware-domains.txt to the location. I am suspecting this is due to Windows defender deleting this file.

Sorry for the inconvenience, actually window defender deleted a file that MobSF needed (even if I downloaded it manually). Does this cause any problems and how can I fix it? Also I still cannot use the show screen feature.

Kongwarriors avatar Oct 21 '24 07:10 Kongwarriors

You need to add this directory to the excluded directories in Windows definder. C:\Users\PC.MobSF\

ohyeah521 avatar Oct 21 '24 07:10 ohyeah521

Thank you for your help. Can you help me with the consequences if the above file is missing? In addition, the screen show function still cannot be used.

Kongwarriors avatar Oct 21 '24 07:10 Kongwarriors

Either you turn off the definder, or you use docker, or you change the environment. If it doesn't work, just give up. It's another good day.

ohyeah521 avatar Oct 21 '24 10:10 ohyeah521