gpt4 book ai didi

java - 在适用于 Linux 的 Windows 子系统 (WSL) 上安装 mitmproxy

转载 作者:行者123 更新时间:2023-12-04 13:20:01 25 4
gpt4 key购买 nike

我一直在使用 Fiddler修改服务器发送的 HTTPS 响应,该响应由客户端的 POST 请求发起,工作正常。

Windows 上使用 Java 我想实现同样的中间人攻击,所以我正在寻找可以处理系统范围的代码 HTTPS 流量。将证书导入系统的信任库也是必要的,但我正在努力启动实际的 Java 代码。 mitmproxy例如有一个 Windows 安装程序,但它不提供 mitmproxy 可执行文件 so it cannot be used .同样使用 WSL 我得到以下 Python 异常:

$ sudo apt-get -y install mitmproxy
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mitmproxy is already the newest version (2.0.2-3).
0 upgraded, 0 newly installed, 0 to remove and 106 not upgraded.
root@mypc:~$ mitmproxy --port 1080
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 574, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 783, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (urwid 2.0.1 (/usr/lib/python3/dist-packages), Requirement.parse('urwid<1.4,>=1.3.1'), {'mitmproxy'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/mitmproxy", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3088, in <module>
@_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3072, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 576, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 589, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 778, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'urwid<1.4,>=1.3.1' distribution was not found and is required by mitmproxy

<罢工> LittleProxy-mitm的 Maven 依赖导致 java.lang.NoClassDefFoundError: org/bouncycastle/util/Encodable

我该如何解决这些问题,或者我还可以使用什么来使用 Java 编程来捕获和修改任何系统范围的 HTTPS 流量?它只需要在 Windows 上工作。

最佳答案

pip3 installation guide工作:

sudo apt install python3-pip && sudo pip3 install -U pip && sudo pip3 install mitmproxy

注意:此命令适用于Ubuntu

关于java - 在适用于 Linux 的 Windows 子系统 (WSL) 上安装 mitmproxy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54610786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com