#protos.nu@gmail.com require 'rubygems' require 'mechanize' web = ARGV[0] def parsear(web) if web =~ /www\./ return web.gsub('www.', 'http://') elsif web =~ /http:\/\// return web else return 'http://'+web end end $formularios = Array.new $links = Array.new head = WWW::Mechanize.new head.redirection_limit=9999 page = head.get(parsear(web)) def formextract(page) if page.class == WWW::Mechanize::Page page.forms.each do |f| f.fields.each do |fi| $formularios << "[+]PAGE[+]#{page.uri} [+]ACTION[+]#{f.action} [+]METHOD[+]#{f.method} [+]FORM_NAME[+]#{f.name} [+]FIELD_NAME[+] #{fi.name}\n" end end end end page.links.each do |l| $links << "#{l} => #{l.href}" begin newpage = l.click rescue next else formextract(newpage) end end file = File.open('reporte.txt', 'a') file.puts "LINKS&FORMS EXTRACTOR\npRotos protos.nu@gmail.com" file.puts "REPORTE DE #{page.uri}\n\n#{Time.now}\n" file.puts "\n\n--LINKS--\n\n" file.puts $links.uniq file.puts "\n\n--FORMULARIOS--\n\n" file.puts $formularios.uniq file.close