Answer the question
In order to leave comments, you need to log in
How to make php work through system proxy?
the task is to log all the data sent by the PHP code to the outside.
running mitmproxy localhost:9901
cat /etc/profile.d/http_proxy.sh
export http_proxy=http://localhost:9001
export https_proxy=https://localhost:9001
export no_proxy=localhost,::1
iptables -t nat -A OUTPUT -p tcp -m multiport --dport 80,443 -m owner --uid-owner 33 -j DNAT --to-destination 127.0.0.1:9001
Invalid HTTP request form (expected: authority or absolute, got: relative)- on HTTP request
ProtocolException('Cannot connect to server, no server address given.')- for HTTPS request
Answer the question
In order to leave comments, you need to log in
uh php perfectly knows how to proxy, what's the point of inventing a bicycle?
https://gist.github.com/codedokode/ea0503ecb0efbc3...
You need a local proxy that supports transparent proxying. For example
https://3proxy.ru/plugins/TransparentPlugin/
plugin /path/to/TransparentPlugin.ld.so transparent_plugin
log /path/to/log
auth iponly
allow * * * 80
parent 1000 http 0.0.0.0 0
allow *
parent 1000 socks5 SOCKS5_IP SOCKS5_PORT USER PASSWORD
transparent
tcppm -i127.0.0.1 12345 127.0.0.1 11111
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question