Skip to content

Instantly share code, notes, and snippets.

@kryali
Created June 19, 2011 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kryali/1034906 to your computer and use it in GitHub Desktop.
Save kryali/1034906 to your computer and use it in GitHub Desktop.
require 'net/http'
my_ip = (require 'open-uri' ; open("http://myip.dk") { |f| /([0-9]{1,3}\.){3}[0-9]{1,3}/.match(f.read)[0] })
puts my_ip
counter = 0
proxyFileList = File.new('6_19_2011.txt', 'r')
proxyList = []
while (proxy = proxyFileList.gets)
proxy = proxy.split(/:|\n|\r/)
proxyList << { 'ip' => proxy[0], 'port' => proxy[1]}
end
proxyFileList.close
proxyList.each do |proxy|
puts "Checking #{proxy}"
attempt = 1
begin
Net::HTTP::Proxy(proxy['ip'], proxy['port']).start('proxyjudge.biz') { |http|
response = http.request_get('/az.php')
if response.body.include?(my_ip)
puts "Non-Anonymous Proxy"
else
puts 'Anonymous Proxy'
end
}
rescue Errno::ECONNREFUSED
puts "connection refused (attempt ##{attempt})"
if attempt < 5 then·
attempt+=1
retry·
end
rescue
puts "proxy failed"
end
end
@aburnap
Copy link

aburnap commented Jun 20, 2011

finally fixed my corrupted ass database, gonna work on this bad unit now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment