简体   繁体   English

在Raspberry Pi上安装mitmproxy时python出现问题

[英]issues with python when installing mitmproxy on Raspberry Pi

I am trying to install mitmproxy on a Raspberry Pi, but getting the below issues, which I believe are related to Python. 我正在尝试在Raspberry Pi上安装mitmproxy,但是遇到了以下问题,我认为这些问题与Python有关。 I have tried numerous attempts and searches but no luck at all. 我已经尝试了无数次尝试和搜索,但都没有运气。

Not sure if this is due to dependencies with libraries need by mitmproxy or else the python installation I have which I built a number of times. 不知道这是否是由于mitmproxy需要的库的依赖关系,或者我构建了很多次的python安装。

I also attemtpted to use Wifi pumpkin, however this also makes use of mitmproxy which once again due to a dependency on Python I was unable to install. 我也曾尝试使用Wifi南瓜,但是这也使用了mitmproxy,这又一次是由于我无法安装对Python的依赖。 Any other tools were I can MITM traffic coming from a device to the internet? 我还可以使用其他工具从设备到Internet的MITM流量吗? ( I am doing this as part of my dissertation) (这是我的论文的一部分)

+ echo Creating dev environment in ./venv...
Creating dev environment in ./venv...
+ python3 -m venv venv
+ . venv/bin/activate
+ deactivate nondestructive
+ [ -n  ]
+ [ -n  ]
+ [ -n  -o -n  ]
+ [ -n  ]
+ unset VIRTUAL_ENV
+ [ ! nondestructive = nondestructive ]
+ VIRTUAL_ENV=/home/pi/Desktop/mitmproxy/venv
+ export VIRTUAL_ENV
+ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ PATH=/home/pi/Desktop/mitmproxy/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ export PATH
+ [ -n  ]
+ [ -z  ]
+ _OLD_VIRTUAL_PS1=#
+ [ x(venv)  != x ]
+ PS1=(venv) #
+ export PS1
+ [ -n  -o -n  ]
+ pip3 install -U pip setuptools
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Requirement already up-to-date: pip in ./venv/lib/python3.7/site-packages (18.1)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
Could not fetch URL https://pypi.org/simple/setuptools/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Requirement already up-to-date: setuptools in ./venv/lib/python3.7/site-packages (40.6.2)
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
+ pip3 install -r requirements.txt
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Obtaining file:///home/pi/Desktop/mitmproxy (from -r requirements.txt (line 1))
Collecting blinker<1.5,>=1.4 (from mitmproxy==5.0.0.dev0->-r requirements.txt (line 1))
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/blinker/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/blinker/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/blinker/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/blinker/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/blinker/
  Could not fetch URL https://pypi.org/simple/blinker/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/blinker/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  Could not find a version that satisfies the requirement blinker<1.5,>=1.4 (from mitmproxy==5.0.0.dev0->-r requirements.txt (line 1)) (from versions: )
No matching distribution found for blinker<1.5,>=1.4 (from mitmproxy==5.0.0.dev0->-r requirements.txt (line 1))
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

Any other tools were I can MITM traffic coming from a device to the internet? 我还可以使用其他工具从设备到Internet的MITM流量吗?

Yes, you can use PolarProxy instead of mitmproxy on the Raspberry Pi, as described here: https://netresec.com/?b=199DC9A 是的,您可以在Raspberry Pi上使用PolarProxy代替mitmproxy,如下所示: https ://netresec.com/?b=199DC9A

With PolarProxy you'll get PCAP files with decrypted HTTP traffic (including HTTP/2), which can be opened in Wireshark. 使用PolarProxy,您将获得带有解密HTTP流量(包括HTTP / 2)的PCAP文件,可以在Wireshark中打开它们。

Discalmer: PolarProxy is a free tool that is developed and maintained by us at Netresec Discalmer:PolarProxy是我们由Netresec开发和维护的免费工具

It's working for me without venv. 它对我没有作用。

apt-get install python-pyasn1 python-flask python-urwid python-dev libxml2-dev libxslt-dev libffi-dev

and then simple install 然后简单安装

sudo pip install mitmproxy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM