Mobile Security Framework (MobSF) 安装使用
目录
用 [TOC]
来生成目录:
Mobile Security Framework (MobSF) 安装使用
虽然已经有很多关于MobSF的文章,但是根据那些文章搭建时,还是会踩坑,所以我重新写了一遍。
本人的基础环境:
- python 2.7.10
- windows 7
- jdk 1.7.0_79
其他环境和更具体的安装过程请参考:MobSF官方安装文档
安装MobSF
下载MobSF
git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git
cd Mobile-Security-Framework-MobSF
【注意】以下的命令都是在Mobile-Security-Framework-MobSF目录下运行,为了省事,把Mobile-Security-Framework-MobSF重命名为MobSF。
使用pip安装环境依赖:
C:\MobSF\python -m pip install -r requirements.txt
使用MobSF
启动MobSF服务
安装完依赖后,运行如下命令:
C:\MobSF\python manage.py runserver
这时候有可能会报错:
c:\MobSF>python manage.py runserver
[INFO] Running first time setup for windows.
[*] Reading config file..
[*] Creating other folders…
[*] Downloading nuget..
Traceback (most recent call last):
File “manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “C:\Python27\lib\site-packages\django\core\management__init__.py”, line 364, in execute_from_command_line
utility.execute()
File “C:\Python27\lib\site-packages\django\core\management__init__.py”, line 308, in execute
settings.INSTALLED_APPS
File “C:\Python27\lib\site-packages\django\conf__init__.py”, line 56, in _getattr
….此处省略部分…
File “C:\Python27\lib\httplib.py”, line 1266, in connect
HTTPConnection.connect(self)
File “C:\Python27\lib\httplib.py”, line 832, in connect
self.timeout, self.source_address)
File “C:\Python27\lib\socket.py”, line 575, in create_connection
raise err
IOError: [Errno socket error] [Errno 10060]
出现这个错误时,再执行一次命令:python manage.py runserver
可以看到成功了:
初始化数据库
在官方文档中,直接使用python manage.py runserver命令会漏掉了2条重要语句,当访问http://127.0.0.1:8000/上传apk后导致报错:
Don’t Play Around. An Error just popped in!
None
no such table: StaticAnalyzer_staticanalyzerandroid
原因是没有对数据库进行初始化。所以,我们要执行如下两条命令完成数据库初始化工作:
c:\MobSF>python manage.py makemigrations
c:\MobSF>python manage.py migrate
上传apk
重新执行python manage.py runserver命令,访问http://127.0.0.1:8000,上传apk,稍微等待一下,
MobSF就完成对apk的分析工作: