Android Pentest Lab Setup: MobSF Installation on Windows+ [ERROR] Python3 is not installed solved
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.
The installation of it on Linux is pretty straightforward, however that is not something we can say about Windows hosts. So since it took me quite a while, I figured I make a full post just about the installation process on Windows.
Get your seatbelts on and let’s hashtalk!
Prerequisites before installation
- Install Git — — — after downloading Git make sure you open Environment Variables -> System Variables -> Path and see if there is C:\Program Files\Git\cmd
- Install Python 3.8–3.9 — — — install the latest 3.9 version and insert Python path in System Variables, you should have 2 entries that should usually look like C:\Users\username\AppData\Local\Programs\Python\Python39;C:\Users\username\AppData\Local\Programs\Python\Python39\Scripts
- Install JDK 8+ — — — Follow this guide to set Java JDK in Windows Path https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
- Install Microsoft Visual C++ Build Tools
- Install OpenSSL (non-light) — — — Insert OpenSSL binary into System Variables Path Variable, usually it should look something like C:\Program Files\OpenSSL-Win64\bin
- Download & Install wkhtmltopdf — — — Insert wkhtmltopdf binary folder (C:\Program Files\wkhtmltopdf\bin) in System Variables Path Variable
Installation
git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git cd Mobile-Security-Framework-MobSF
Now you did all this and the next command is setup.bat, you ran the .bat file and you have [ERROR] python3 is not installed error. You have a few options that might do the charm:
- Run python -V, that should print the python version, if it doesn’t you really don’t have python installed or you don’t have it in path
- Run python3 -V, this should also print the python version, if it doesn’t, go to the folder where python.exe is, copy python.exe and rename it in python3, so now you should have two python files in the same folder, python and python3, now re run python3 -V, that should print out the version
3. Last resort and probably the solution is try and run the command where in cmd. If where is installed you should see a manual for usage, if it’s not you’ll get ‘where’ is not recognized as internal or external command.
where.exe is a file in System32, so the first thing you can do is check if it’s really there, in C:\Windows\System32 folder
If you can detect it and cmd can’t, then you should add C:\Windows\System32 in System Variables -> Path. When added, close the current cmd, open a new one and type the command where again. If now it’s detected, execute setup.bat and that should do it.
Running MobSF
run.bat 127.0.0.1:8000
In your web browser, navigate to http://localhost:8000/
to access MobSF web interface.
And that’s it. You have MobSF installed. I hope this little hashtalk saved you a few hours, since it cost me so much more.
The full documentation where they don’t do troubleshooting of python3 error can be found here: https://mobsf.github.io/docs/#/