How to Block Anonymous Proxies With a Linux Firewall
Block anonymous proxies on a Linux computer by using the Apache Web server software. To do this, you'll need to edit the Apache configuration file and update the code to instruct the server to block incoming, anonymous proxy calls to the computer. Blocking incoming proxies is helpful in securing your system from malicious hacking attacks.
Instructions
-
-
1
Click the "Applications" menu on the desktop's task bar, then go to "Accessories" and click the "Text Editor" option.
-
2
Click the "Open" icon in the text editor program, then browse to the "/etc/init.d/" path on the computer's hard drive and click the ".htaccess" file in that directory.
-
-
3
Turn on Apache's rewrite engine by adding this line of code:
RewriteEngine on
-
4
Add the following lines of code; this is the main script that blocks incoming proxy calls:
RewriteCond %{HTTP:VIA} !^$ [OR]
RewriteCond %{HTTP:FORWARDED} !^$ [OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
RewriteRule ^(.*)$ - [F] -
5
Click the "Save" icon at the top of the text editor. You can now close the program; you won't need it from this point forward.
-
6
Click the "Applications" menu again, go to "System" and click the "Terminal" option.
-
7
Type the following command at the terminal prompt:
sudo /etc/init.d/apache start
-
8
Replace the word "start" with "restart" in the command if you already have the Apache Web server running on your current Linux session. You have now successfully blocked all anonymous proxies into the computer.
-
1