jake9050 / advanced_privatized_proxy

Sets up one squid + 8 privoxy + 8 tor workers for relatively fast/private surfing
GNU General Public License v2.0
1 stars 1 forks source link

Script not working #1

Open OxMarco opened 8 years ago

OxMarco commented 8 years ago

I have tried to execute the script on an Ubuntu 12.4 VPS and setting the environment variable "http_proxy" causes all connections to be blocked. I have opened all ports in use looking at netstat -ntlup but still, even when trying to ping a website, it reports:

Connecting to 192.168..:3400... failed: Connection refused.

How to fix it? Thanks

P.S. Around the end of the script there is a " missing in an echo statement

jake9050 commented 8 years ago

Hi and thanks for reporting! Can you provide the commands and full errors please? Looks like squid is either unresponsive or blocking you. Can you paste the output of the netstat command and your squid.conf please? Also, http_port is not what should be exported, it's http_proxy but i think you did it correctly on commandline, otherwise the error would not be there ;-)

OxMarco commented 8 years ago

Hi, thanks for your reply.

I tried reinstalling on a clean VM (Ubuntu 12.04), I set the global var and I keep getting:

curl -I www.google.com curl: (7) couldn't connect to host

which automatically solves once I unset "http_proxy".

Netstat output:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:9150          0.0.0.0:*               LISTEN      16713/tor       
tcp        0      0 127.0.0.1:8321          0.0.0.0:*               LISTEN      16690/privoxy   
tcp        0      0 127.0.0.1:8129          0.0.0.0:*               LISTEN      16635/privoxy   
tcp        0      0 127.0.0.1:9250          0.0.0.0:*               LISTEN      16716/tor       
tcp        0      0 127.0.0.1:8421          0.0.0.0:*               LISTEN      16693/privoxy   
tcp        0      0 127.0.0.1:9350          0.0.0.0:*               LISTEN      16719/tor       
tcp        0      0 127.0.0.1:8230          0.0.0.0:*               LISTEN      16666/privoxy   
tcp        0      0 127.0.0.1:6823          0.0.0.0:*               LISTEN      16699/privoxy   
tcp        0      0 127.0.0.1:9450          0.0.0.0:*               LISTEN      16722/tor       
tcp        0      0 127.0.0.1:8522          0.0.0.0:*               LISTEN      16696/privoxy   
tcp        0      0 127.0.0.1:9550          0.0.0.0:*               LISTEN      16725/tor       
tcp        0      0 127.0.0.1:9650          0.0.0.0:*               LISTEN      16728/tor       
tcp        0      0 127.0.0.1:8724          0.0.0.0:*               LISTEN      16702/privoxy   
tcp        0      0 127.0.0.1:9750          0.0.0.0:*               LISTEN      16731/tor       
tcp        0      0 127.0.0.1:8118          0.0.0.0:*               LISTEN      16610/privoxy   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      11974/sshd      
tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      16710/tor       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           926/dhclient3   

I opened all the ports listed (on TCP protocol only) on the VM firewall.

The squid.conf, untouched, is as follows:

http_access deny malware_domains
http_access allow home_network
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access deny all
http_port 192.168.0.233:3400
icp_port 0
hierarchy_stoplist cgi-bin ?
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
cache_peer localhost parent 8118 0 round-robin no-query
cache_peer localhost2 parent 8129 0 round-robin no-query
cache_peer localhost3 parent 8230 0 round-robin no-query
cache_peer localhost4 parent 8321 0 round-robin no-query
cache_peer localhost5 parent 8421 0 round-robin no-query
cache_peer localhost6 parent 8522 0 round-robin no-query
cache_peer localhost7 parent 8623 0 round-robin no-query
cache_peer localhost8 parent 8724 0 round-robin no-query
never_direct allow all
always_direct deny all
all apache rep_header Server ^Apache
forwarded_for off
coredump_dir /home/squid-cache
cache_dir ufs /home/squid-cache 20000 16 256
pid_filename /var/run/squid-in.pid
access_log /var/log/squid3/access.squid-in.log
cache_store_log /var/log/squid3/store.squid-in.log
cache_log /var/log/squid3/cache.squid-in.log

Thank you

jake9050 commented 8 years ago

I think i see what is causing the problem. In squid.conf the http_port ip address is propably not the external ip of your vm. Can you try swapping it and reload squid after that?

OxMarco commented 8 years ago

Still can't connect I also tried to set it to the localhost ip (127.xxx) and to the local network ip (192.xxx).

--- updates --- Ok, I set http_port to 3400 in squid.conf and it seems I can connect via cURL but I get the following response: ` <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

ERROR: The requested URL could not be retrieved

ERROR

The requested URL could not be retrieved


The following error was encountered while trying to retrieve the URL: http://ipinfo.io/ip

Access Denied.

Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.

Your cache administrator is webmaster.



`

OxMarco commented 8 years ago

If I connect from PC to the proxy server, squid seems to be working as it blocks certain websites but the IP and headers sent are the same as normal browsing. I block headers like User-Agent with: request_header_access User-Agent deny all

OxMarco commented 8 years ago

@jake9050 hello, any news? Thanks