Android 开源安全测试工具 Drozer,安装过程中的问题

Android 开源安全测试工具 Drozer,安装过程中的问题

记录安装过程中出现的问题

    • Android 开源安全测试工具 Drozer,安装过程中的问题
      • 错误一
      • 错误二
      • 错误三
      • 错误四
      • 错误五
      • 错误六
      • 错误七
      • 错误八
      • 错误九

错误一

输入命令行:

E:\>dorzer\Scripts\drozer.bat

报错提示:

'python.exe'不是内部或外部命令,也不是可运行的程序或批处理文件

分析:

没有安装 python 2.7.× 安装包,去官网安装,链接:https://www.python.org/getit/,Windows 系统选 Windows 版的

解决思路及方案:

安装 python 2.7.× 安装包

注意点:

1. 安装包安装过程中,记得选上 Add python.exe to Path,不然要自己在环境变量中配置其路径
2. 若是没选上  Add python.exe to Path,自己配置环境变量,然后重启机子才能生效

错误二

输入命令行:

E:\>dorzer\Scripts\drozer.bat console connect

报错提示:

Traceback (most recent call last):
  File "E:\dorzer\Scripts\drozer", line 30, in <module>
    __import__("drozer.cli.%s" % (sys.argv[1]))
ImportError: No module named drozer.cli.console

效果图,如下所示:

分析:

Python 安装环境模块和 Drozer 安装模块不能交互

解决思路及方案:

1. 重新安装 Drozer,记得把 Python from anther location 选上,选定安装目录。不选上的话,就只有 C 盘作为默认路径,而且看不到安装目录。选上的话,就有两个安装路径了
2. 重新安装 python 2.7.× 安装包,记得选上 Add python.exe to Path

注意点:

1. 第一次安装 Drozer,若是没有选上 Python from anther location,则两个安装目录 Lib 和 Scripts 会出现在当前安装包的文件夹下
2. 删除第一次安装 Drozer 的两个安装目录,再次安装 Drozer 没有选上 Python from anther location,则默认安装在 C 盘中,但不显示安装目录
3. 第三次再次安装,选上 Python from anther location,则 C 盘默认安装路径,还有就是另一个安装路径

重点选第三种安装流程,选上 Python from anther location

错误三

输入命令行:

C:\Users\segno>drozer.bat console connect

报错提示:

Traceback (most recent call last):
  File "E:\Python27\Scripts\drozer", line 30, in 
    __import__("drozer.cli.%s" % (sys.argv[1]))
  File "E:\Python27\lib\site-packages\drozer\cli\console.py", line 8, in 
    from drozer.console import Console
  File "E:\Python27\lib\site-packages\drozer\console\__init__.py", line 4, in 
    from drozer.console.console import Console
  File "E:\Python27\lib\site-packages\drozer\console\console.py", line 5, in 
    from pydiesel.api.protobuf_pb2 import Message
  File "E:\Python27\lib\site-packages\pydiesel\api\__init__.py", line 9, in 
    from pydiesel.api.frame import Frame
  File "E:\Python27\lib\site-packages\pydiesel\api\frame.py", line 3, in 
    from pydiesel.api.protobuf_pb2 import Message
  File "E:\Python27\lib\site-packages\pydiesel\api\protobuf_pb2.py", line 3, in

    from google.protobuf import descriptor
ImportError: No module named google.protobuf

分析:

缺少谷歌的 protobuf 组件,安装 protobuf 组件

解决思路及方案:

C:\Users\segno>pip install protobuf

效果图,如下所示:

错误四

输入命令行:

C:\Users\segno>drozer.bat console connect

报错提示:

Traceback (most recent call last):
  File "E:\Python27\Scripts\drozer", line 30, in 
    __import__("drozer.cli.%s" % (sys.argv[1]))
  File "E:\Python27\lib\site-packages\drozer\cli\console.py", line 8, in 
    from drozer.console import Console
  File "E:\Python27\lib\site-packages\drozer\console\__init__.py", line 4, in 
    from drozer.console.console import Console
  File "E:\Python27\lib\site-packages\drozer\console\console.py", line 6, in 
    from pydiesel.api.transport.exceptions import ConnectionError
  File "E:\Python27\lib\site-packages\pydiesel\api\transport\__init__.py", line
5, in 
    from socket_transport import SocketTransport
  File "E:\Python27\lib\site-packages\pydiesel\api\transport\socket_transport.py
", line 8, in 
    from drozer.ssl.provider import Provider # TODO: eugh
  File "E:\Python27\lib\site-packages\drozer\ssl\__init__.py", line 1, in 
    from drozer.ssl.ssl_manager import SSLManager
  File "E:\Python27\lib\site-packages\drozer\ssl\ssl_manager.py", line 6, in 
    from drozer.ssl.provider import Provider
  File "E:\Python27\lib\site-packages\drozer\ssl\provider.py", line 2, in 
    import OpenSSL
ImportError: No module named OpenSSL

分析:

缺少 OpenSSL 组件,安装 OpenSSL 组件

解决思路及方案:

C:\Users\segno>pip install pyOpenSSL

效果图,如下所示:

错误五

输入命令行:

C:\Users\segno>drozer.bat console connect

报错提示:

drozer Server requires Twisted to run.
Run 'pip install twisted' to fetch this dependency.

效果图,如下所示:

分析:

运行'pip install twisted'来获取此依赖项

解决思路及方案:

C:\Users\segno>pip install twisted

接着又报错:

Command "e:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\segno\\appdata\\local\\temp\\pip-build-7vaymo\\twisted\\setup.py';f=geta
ttr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\segno\appdata\local\temp\pip-u8gtwo-record\install-record.txt --single-version-externally-m
anaged --compile" failed with error code 1 in c:\users\segno\appdata\local\temp\
pip-build-7vaymo\twisted\
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

效果图,如下所示:

分析:

您应该考虑通过'python -m pip install --upgrade pip'命令进行升级

解决思路及方案:

C:\Users\segno>python -m pip install --upgrade pip

效果图,如下所示:

接着又报错:

error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

分析:

缺少 Microsoft Visual C++ 9.0 

解决思路及方案:

安装 Microsoft Visual C++ Compiler for Python 2.7,链接:https://www.microsoft.com/en-us/download/details.aspx?id=44266

最后,输入命令行:

C:\Users\segno>drozer.bat console connect

报错提示:

drozer Server requires Twisted to run.
Run 'pip install twisted' to fetch this dependency.

分析:

运行'pip install twisted'来获取此依赖项

解决思路及方案:

C:\Users\segno>pip install twisted

成功

效果图,如下所示:

错误六

输入命令行:

C:\Users\segno>drozer.bat console connect

报错提示:

:0: UserWarning: You do not have a working installation of the service_identity
module: 'No module named service_identity'.  Please install it from  and make sure all of its dependencies are sa
tisfied.  Without the service_identity module, Twisted can perform only rudiment
ary TLS client hostname verification.  Many valid certificate/hostname mappings
may be rejected.

效果图,如下所示:

分析:

缺少 service_identity 组件

解决思路及方案:

C:\Users\segno>pip install service_identity

效果图,如下所示:

错误七

输入命令行:

C:\Users\segno>drozer.bat console connect

报错提示:

[Errno 10054]

分析:

手机端与 PC 端,连接错误

解决思路及方案:

在手机端,把agent关闭,重新打开,则可以解决

错误八

输入命令行:

dz> run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Pas
swords/ --vertical

报错提示:

[Errno 10053]

分析:

手机端与 PC 端,连接错误

解决思路及方案:

客户端重启 agent,PC 端重新连接

错误九

输入命令行:

dz> list

报错提示:

没有任何提示效果

分析:

不知名错误

解决思路及方案:

进到 Drozer 的安装目录 Scripts 下,敲打命令行:drozer console connect,
然后再敲打:dz> list 即可

正确效果:

dz> list
app.activity.forintent      Find activities that can handle the given intent

app.activity.info           Gets information about exported activities.

app.activity.start          Start an Activity

app.broadcast.info          Get information about broadcast receivers

app.broadcast.send          Send broadcast using an intent

app.broadcast.sniff         Register a broadcast receiver that can sniff

drozer console connect -c "run app.package.manifest cn.jac.fund">>E:/a.xml

效果图,如下所示:

你可能感兴趣的:(Android,安全测试)