Return to Snippet

Revision: 14923
at June 18, 2009 11:32 by kwilson


Updated Code
# Pick a random high-numbered port
Listen *:4400

# Add the above port number below as well
<VirtualHost *:4400> 
	ProxyRequests On
	AllowCONNECT 80 443
	<Proxy *>
		Order deny,allow
		Deny from all
		# Country: IRAN, ISLAMIC REPUBLIC OF
		# ISO Code: IR
		# Total Networks: 118
		# Total Subnets:  2,130,176
		# Source: http://www.countryipblocks.net/country-blocks/select-formats/
		Allow from 62.60.128.0/17
		Allow from 62.193.0.0/19
		Allow from 62.220.96.0/19
		Allow from 77.36.128.0/17
		Allow from 77.77.64.0/18
		Allow from 77.104.64.0/18
		Allow from 77.237.64.0/19
		Allow from 77.237.160.0/19
		Allow from 77.245.224.0/20
		Allow from 78.38.0.0/15
		Allow from 78.109.192.0/20
		Allow from 78.110.112.0/20
		Allow from 78.111.0.0/20
		Allow from 78.154.32.0/19
		Allow from 78.157.32.0/19
		Allow from 78.158.160.0/19
		Allow from 79.127.0.0/17
		Allow from 79.132.192.0/19
		Allow from 79.170.144.0/21
		Allow from 79.175.128.0/18
		Allow from 80.66.176.0/20
		Allow from 80.69.240.0/20
		Allow from 80.71.112.0/20
		Allow from 80.75.0.0/20
		Allow from 80.191.0.0/16
		Allow from 80.242.0.0/20
		Allow from 80.253.128.0/20
		Allow from 80.253.144.0/20
		Allow from 81.12.0.0/17
		Allow from 81.28.32.0/20
		Allow from 81.28.48.0/20
		Allow from 81.31.160.0/20
		Allow from 81.31.176.0/20
		Allow from 81.90.144.0/20
		Allow from 81.91.128.0/20
		Allow from 81.91.144.0/20
		Allow from 82.99.192.0/18
		Allow from 82.115.0.0/19
		Allow from 83.147.192.0/18
		Allow from 84.47.192.0/18
		Allow from 84.241.0.0/18
		Allow from 85.9.64.0/18
		Allow from 85.15.0.0/18
		Allow from 85.133.128.0/17
		Allow from 85.185.0.0/16
		Allow from 85.198.0.0/18
		Allow from 86.109.32.0/19
		Allow from 87.107.0.0/16
		Allow from 87.247.160.0/19
		Allow from 87.248.128.0/19
		Allow from 89.144.128.0/18
		Allow from 89.165.0.0/17
		Allow from 89.221.80.0/20
		Allow from 89.235.64.0/18
		Allow from 91.98.0.0/15
		Allow from 91.184.64.0/19
		Allow from 91.186.192.0/19
		Allow from 91.206.122.0/23
		Allow from 91.208.165.0/24
		Allow from 91.209.242.0/24
		Allow from 91.212.16.0/24
		Allow from 91.212.19.0/24
		Allow from 91.212.252.0/24
		Allow from 92.42.48.0/21
		Allow from 92.50.0.0/18
		Allow from 92.61.176.0/20
		Allow from 92.62.176.0/20
		Allow from 92.242.192.0/19
		Allow from 93.110.0.0/16
		Allow from 93.190.24.0/21
		Allow from 94.74.128.0/18
		Allow from 94.101.128.0/20
		Allow from 94.101.176.0/20
		Allow from 94.101.240.0/20
		Allow from 94.139.160.0/19
		Allow from 94.182.0.0/15
		Allow from 94.184.0.0/17
		Allow from 94.232.168.0/21
		Allow from 94.241.128.0/18
		Allow from 95.38.0.0/16
		Allow from 95.80.128.0/18
		Allow from 95.81.64.0/18
		Allow from 95.82.0.0/18
		Allow from 95.82.64.0/18
		Allow from 95.130.56.0/21
		Allow from 95.130.240.0/21
		Allow from 188.34.0.0/16
		Allow from 188.93.64.0/21
		Allow from 188.121.96.0/19
		Allow from 188.121.128.0/19
		Allow from 188.136.128.0/17
		Allow from 188.158.0.0/15
		Allow from 193.189.122.0/23
		Allow from 194.225.0.0/16
		Allow from 195.146.32.0/19
		Allow from 212.16.64.0/19
		Allow from 212.33.192.0/19
		Allow from 212.50.224.0/19
		Allow from 212.80.0.0/19
		Allow from 212.95.128.0/19
		Allow from 212.120.192.0/19
		Allow from 213.176.0.0/19
		Allow from 213.176.32.0/19
		Allow from 213.176.64.0/18
		Allow from 213.195.0.0/18
		Allow from 213.207.192.0/18
		Allow from 213.217.32.0/19
		Allow from 213.233.160.0/19
		Allow from 217.11.16.0/20
		Allow from 217.24.144.0/20
		Allow from 217.25.48.0/20
		Allow from 217.64.144.0/20
		Allow from 217.66.192.0/20
		Allow from 217.66.208.0/20
		Allow from 217.146.208.0/20
		Allow from 217.172.96.0/19
		Allow from 217.174.16.0/20
		Allow from 217.218.0.0/15
		# Deny IRI government address ranges
		# Source: http://r3blog.nl/iran_dropped.txt
		Deny from 78.38.77.160/28
		Deny from 80.191.21.0/24
		Deny from 84.47.248.0/21
		Deny from 84.47.212.0/22
		Deny from 84.47.216.0/22
		Deny from 84.47.220.0/22
		Deny from 194.225.164.0/23
		Deny from 213.176.19.0/26
		Deny from 213.176.74.0/23
		Deny from 217.172.96.0/22
		Deny from 217.172.104.0/22
		Deny from 217.172.108.0/22
		Deny from 217.172.112.0/22
		Deny from 217.172.120.0/22
		Deny from 217.172.124.0/22
		Deny from 217.24.144.0/22
		Deny from 217.24.148.0/22
		Deny from 217.24.152.0/22
		Deny from 217.24.156.0/22
	</Proxy>
	# No logging
	CustomLog /dev/null combined
	ErrorLog  /dev/null
</VirtualHost>

Revision: 14922
at June 17, 2009 13:16 by kwilson


Initial Code
# Pick a random high-numbered port
Listen *:4400

# Add the above port number below as well
<VirtualHost *:4400> 
	ProxyRequests On
	AllowCONNECT 80 443
	<Proxy *>
		Order deny,allow
		Deny from all
		Allow from 62.60.128.0/17
		Allow from 62.193.0.0/19
		Allow from 62.220.96.0/19
		Allow from 77.36.128.0/17
		Allow from 77.77.64.0/18 
		Allow from 77.104.64.0/18
		Allow from 77.237.64.0/19
		Allow from 77.237.160.0/19
		Allow from 77.245.224.0/20
		Allow from 78.38.0.0/15
		Allow from 78.109.192.0/20
		Allow from 78.110.112.0/20
		Allow from 78.111.0.0/20
		Allow from 78.154.32.0/19
		Allow from 78.157.32.0/19
		Allow from 78.158.160.0/19
		Allow from 79.127.0.0/17
		Allow from 79.132.192.0/19
		Allow from 79.170.144.0/21
		Allow from 79.175.128.0/18
		Allow from 80.66.176.0/20
		Allow from 80.69.240.0/20
		Allow from 80.71.112.0/20
		Allow from 80.75.0.0/20
		Allow from 80.191.0.0/16
		Allow from 80.242.0.0/20
		Allow from 80.253.128.0/20
		Allow from 80.253.144.0/20
		Allow from 81.12.0.0/17
		Allow from 81.28.32.0/20
		Allow from 81.28.48.0/20
		Allow from 81.31.160.0/20
		Allow from 81.31.176.0/20
		Allow from 81.90.144.0/20
		Allow from 81.91.128.0/20
		Allow from 81.91.144.0/20
		Allow from 82.99.192.0/18
		Allow from 82.115.0.0/19
		Allow from 83.147.192.0/18
		Allow from 84.47.192.0/18
		Allow from 84.241.0.0/18
		Allow from 85.9.64.0/18
		Allow from 85.15.0.0/18
		Allow from 85.133.128.0/17
		Allow from 85.185.0.0/16
		Allow from 85.198.0.0/18
		Allow from 86.109.32.0/19
		Allow from 87.107.0.0/16
		Allow from 87.247.160.0/19
		Allow from 87.248.128.0/19
		Allow from 89.144.128.0/18
		Allow from 89.165.0.0/17
		Allow from 89.221.80.0/20
		Allow from 89.235.64.0/18
		Allow from 91.98.0.0/15
		Allow from 91.184.64.0/19
		Allow from 91.186.192.0/19
		Allow from 91.206.122.0/23
		Allow from 91.208.165.0/24
		Allow from 91.209.242.0/24
		Allow from 91.212.16.0/24
		Allow from 91.212.19.0/24
		Allow from 91.212.252.0/24
		Allow from 92.42.48.0/21
		Allow from 92.50.0.0/18
		Allow from 92.61.176.0/20
		Allow from 92.62.176.0/20
		Allow from 92.242.192.0/19
		Allow from 93.110.0.0/16
		Allow from 93.190.24.0/21
		Allow from 94.74.128.0/18
		Allow from 94.101.128.0/20
		Allow from 94.101.176.0/20
		Allow from 94.101.240.0/20
		Allow from 94.139.160.0/19
		Allow from 94.182.0.0/15
		Allow from 94.184.0.0/17
		Allow from 94.232.168.0/21
		Allow from 94.241.128.0/18
		Allow from 95.38.0.0/16
		Allow from 95.80.128.0/18
		Allow from 95.81.64.0/18
		Allow from 95.82.0.0/18
		Allow from 95.82.64.0/18
		Allow from 95.130.56.0/21
		Allow from 95.130.240.0/21
		Allow from 188.34.0.0/16
		Allow from 188.93.64.0/21
		Allow from 188.121.96.0/19
		Allow from 188.121.128.0/19
		Allow from 188.136.128.0/17
		Allow from 188.158.0.0/15
		Allow from 193.189.122.0/23
		Allow from 194.225.0.0/16
		Allow from 195.146.32.0/19
		Allow from 212.16.64.0/19
		Allow from 212.33.192.0/19
		Allow from 212.50.224.0/19
		Allow from 212.80.0.0/19
		Allow from 212.95.128.0/19
		Allow from 212.120.192.0/19
		Allow from 213.176.0.0/19
		Allow from 213.176.32.0/19
		Allow from 213.176.64.0/18
		Allow from 213.195.0.0/18
		Allow from 213.207.192.0/18
		Allow from 213.217.32.0/19
		Allow from 213.233.160.0/19
		Allow from 217.11.16.0/20
		Allow from 217.24.144.0/20
		Allow from 217.25.48.0/20
		Allow from 217.64.144.0/20
		Allow from 217.66.192.0/20
		Allow from 217.66.208.0/20
		Allow from 217.146.208.0/20
		Allow from 217.172.96.0/19
		Allow from 217.174.16.0/20
		Allow from 217.218.0.0/15
	</Proxy>
</VirtualHost>

Initial URL


Initial Description
Due to widespread internet blocking in Iran following the June 2009 election, a network of proxy servers was set up to assist in the free flow of information. The IP range, to the best of my knowledge, should cover the addresses used in Iran, with blocks added for the IRI government addresses. Restricting access to Iran will help prevent abuse by others, which is always a danger with open proxies. This configuration also only allows HTTP and HTTPS traffic, which will prevent the relay of spam email.

For best results, run your proxy on multiple ports. Duplicate this configuration ten times using different port numbers for each. Avoid ports 80/81/8000/8080/9090/3128.

Initial Title
HTTP proxy server for Iran

Initial Tags
apache

Initial Language
Apache