I just want make internet anonymous transparent proxy that bypass traffic just want hide client ip but its not work for https ..
I dont want to use sslbump or etc just want to bypass traffic
I search a lot in google and serverfault.com and stackoverflow.com and test these solution for bypass https traffic:
Bypass Transparent Squid With IPTables
my squid configuration is:
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow all
short_icon_urls on
http_port 0.0.0.0:13128 accel vhost
always_direct allow all
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
coredump_dir /var/spool/squid
forwarded_for off
and my iptables conf is now just:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 13128
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 13128
I try to use these command but not work:
iptables -t filter -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -i lo -j ACCEPT
iptables -t nat -A PREROUTING -d x.x.x.x -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -s x.x.x.x -m tcp --dport 443 -j REDIRECT --to-ports 13128
That x.x.x.x is my valid internet ip
and my client config for using proxy is like this:
added somedomain.com in /etc/hosts x.x.x.x somedomain.com
and i want browse https://somedomain.com in my browser
you can find a lot of ip port proxy that work like this for example using this ip 173.161.0.227
if i add a line in to my client /etc/hosts
173.161.0.227 www.iplocation.net
i can browse https://www.iplocation.net
my server is CentOS 7