Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/http'
- require 'ipaddr'
- BLOCKS = {
- # Ministerio de Cultura
- '193.145.12.0' => '193.145.12.255',#
- '193.145.16.0' => '193.145.16.255',
- '193.145.22.0' => '193.145.22.255',
- '193.145.24.0' => '193.145.24.255',
- '193.145.27.0' => '193.145.27.255',
- '213.4.125.48' => '213.4.125.55',
- '213.4.125.16' => '213.4.125.23',
- '193.145.7.0' => '193.145.7.255',
- # SGAE
- '195.76.238.0' => '195.76.238.255',
- '212.101.75.88' => '212.101.75.95',
- # Moncloa
- '194.179.32.0' => '194.179.32.255',
- '193.146.153.128' => '193.146.153.255',
- # Embajada EEUU
- '212.0.119.168' => '212.0.119.175',
- '213.27.135.224' => '213.27.135.231'
- }
- uri = URI.parse('http://www.youhavedownloaded.com/')
- http = Net::HTTP.new(uri.host, uri.port)
- BLOCKS.each do |begin_ip, end_ip|
- begin_ip = IPAddr.new(begin_ip)
- end_ip = IPAddr.new(end_ip)
- while begin_ip.to_i <= end_ip.to_i do
- uri.query = 'q=' << begin_ip.to_s
- puts begin_ip.to_s
- content = nil
- http.start { content = http.request_get(uri.route_from('http://www.youhavedownloaded.com').to_s).body }
- puts "BINGO!!" if content !~ /this IP in the clear/
- begin_ip = IPAddr.new(begin_ip.to_i + 1, Socket::AF_INET)
- end
- end
Add Comment
Please, Sign In to add comment