Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 71 lines (63 sloc) 1.78 KB
#!/usr/bin/env ruby
# Pass any line separated file of targets as arg1 and it will connect to each through the spcified proxy
# Example formats accepted:
# http://www.google.com
# https://www.google.com
# http://www.google.com:8080
require 'net/https'
require 'uri'
require 'optparse'
# Parse command line options
x=nil
options = {}
optparse = OptionParser.new do |opts|
opts.banner = "Loads each line of the supplied file into burp targets list (GET request through proxy)
\nUsage: burp_loader.rb [options]" # The banner to display at the top
opts.on( '-f', '--file FILENAME', 'A line separate file of targets' ) do |file|
options[:file] = file
end
opts.on( '-q', '--quiet', 'Disable verbose messages' ) do |quiet|
options[:quiet] = quiet
end
opts.on( '-h', '--help', 'Display this screen' ) do
puts opts
exit
end
x=opts
end.parse!(ARGV)
# If no options are specified, output help screen and exit
if options[:file].nil?
puts x
exit
end
# Burp proxy location:port
ENV['http_proxy'] = 'http://127.0.0.1:8080'
puts "[+] starting burp-loader ..."
if options[:quiet].nil?
puts "\n[+] Proxying through #{ENV['http_proxy']}\n\n"
end
f = File.open(options[:file], "r")
f.each_line do |line|
encoded_url = URI.encode(line)
url = URI.parse(encoded_url)
url.host.slice! "%0A"
url.path.slice! "%0A"
if options[:quiet].nil?
puts "Connecting to #{url}:#{url.port} ..."
end
begin
req = Net::HTTP::Get.new(url)
http = Net::HTTP.new(url.host, url.port)
http.open_timeout = 3
http.read_timeout = 3
http.use_ssl = true if url.scheme == "https" # Enable SSL/TLS if 'https' in supplied URL
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.start {
http.request(req)
}
rescue Timeout::Error
puts "Cannot connect to #{url}"
end
end
f.close
puts "\n[+] ... finished"