[Ruby] FinderShells 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 shells de forma local.

Código (ruby) [Seleccionar]

#!usr/bin/ruby
#FinderShells 0.1
#Coded By Doddy H

$textos = ["C99Shell","r57shell","DxShell","HiddenShell","~ Andr3a92 ~ Sh3ll ~","CShell","Dark Shell","GsC SheLL","N3fa5t1cA Sh3ll","ONBOOMSHELL",
"StAkeR ~ Shell","MoDDeD By KinG-InFeT","31337 Shel"]

def openwords(file)
  if File.file?(file)
    ar = File.open(file)
    lineas = ar.readlines
    ar.close
    return lineas
  end
end

def escalar(dir)
  files = Dir.new(dir).entries
  files.each do |file|
    if File.file?(dir+"/"+file)
      contador = 0
      words = openwords(dir+"/"+file)
      words.each do |word|
      word = word.chomp
      contador+=1
      $textos.each do |text|
        if word=~/#{text}/
          parteuno = dir+"/"+file
          patron = File.basename(__FILE__)
          if not parteuno=~/#{patron}/
            print "[+] Shell Found : "+dir+"/"+file+" in line #{contador}\n"
          end
        end
      end     
    end
    else
      if file != "." and file != ".."
        escalar(dir+"/"+file)
      end
    end
  end
end

def sintax()
  print "\n[+] sintax : ruby findershells.rb <directory>\n"
end

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

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

head()

dir = ARGV[0]

if !dir
  sintax()
else
  print "\n[+] Starting the search\n\n\n"
  escalar(dir)
  print "\n\n[+] Finished\n\n"
end

copyright()
   
# The End ?