[Ruby] FTP Scan 0.1

Iniciado por BigBear, 11 Febrero 2012, 23:04 PM

0 Miembros y 1 Visitante están viendo este tema.

BigBear

Un buscador de servidores FTP que tengan habilitado el usuario anonymous.

Código (ruby) [Seleccionar]

#!usr/bin/ruby
#FTP Scan 0.1
#Coded By Doddy H

require "net/ftp"

def openwords(file)
  if File.file?(file)
    print "\n[+] Opening file\n\n"
    ar = File.open(file)
    lineas = ar.readlines
    ar.close
    print "[+] Number of words : ",lineas.length,"\n\n"
    return lineas
  else
    print "[-] Error opening file\n"
  end
end

def savefile(file,text)
  save = File.open(file, "a")
  save.puts text+"\n"
  save.close
end

def sintax()
  print "\n[+] ruby ftpscan.rb <file>\n"
end

def head()
  print "\n-- == FTP Scan 0.1 == --\n\n"
end

def copyright()
  print "\n\n(C) Doddy Hackman 2012\n"
  exit(1)
end

file = ARGV[0]

head()

if !file
  sintax()
else
  paginas = openwords(file)
  print "\n[+] Scanning ...\n\n"
  paginas.each do |pag|
    pag = pag.chomp
    target = URI.parse(pag)
    begin
    ftp =Net::FTP.new(target.host,"anonymous","test@hotmail.com")
    rescue Net::FTPPermError
    else
      print "[+] Anonymous Found : "+target.host+"\n";
      savefile("ftp-logs.txt",target.host)
    end
  end
  print "\n\n[+] Scan Finished\n\n"
end

copyright()

# The End ?