Underc0de

[In]Seguridad Informática => Hacking => Mensaje iniciado por: ANTRAX en Abril 08, 2012, 06:38:29 PM

Título: Dir / Files Scanner v0.1
Publicado por: ANTRAX en Abril 08, 2012, 06:38:29 PM
Código (perl) [Seleccionar]
#!/usr/bin/perl

# Dir / Files Scanner v0.1
# Login-Root Pwnz 2010
# [email protected] || [email protected]
# Original Code: ka0x - D.O.M
# Added some options

# Uso:
# <website>      : Website a escanear directorios / archivos (SIN http:// o https://).
# <dirs list>    : Lista de directorios / archivos a probar.
# <result>       : Archivo donde guardar resultados.
# <http | https> : Protocolo a utilizar (HTTP o HTTPS) (Opcional, default: http).

# RemoteExecution / Diosdelared.

use HTTP::Request;
use LWP::UserAgent;

($host, $lista, $result, $type) = @ARGV;

print "\n\n[!] [Dir / Files Scanner v0.1] starting...\n";
if (!$ARGV[2]) { print "\n[!] Usage: perl $0 <website> <dirs list> <result> <http | https>\n\n<website>      : Website a escanear directorios (SIN http:// o https://).\n<dirs list>    : Lista de directorios a probar.\n<result>       : Archivo donde guardar resultados.\n<http | https> : Protocolo a utilizar (HTTP o HTTPS) (Opcional, default: http).\n"; exit(0); }
if (!$ARGV[3]) {$type = "http"} ;

$agent = LWP::UserAgent->new() or die;
$agent->agent('Google Bot');

open(SAVE,">>".$result) || die "\n[-] Imposible crear el archivo de texto\n";
open(DIRS, $lista) || die "\n[-] No existe $lista\n";
print SAVE "[DIRS / FILES FOUND]:\n";
while($paths = <DIRS>){ chomp($paths);

$request = HTTP::Request->new(GET => "$type"."://"."$host"."/"."$paths") or die "[-] Imposible conectar a $host\n";
$r = $agent->request($request);
$result = $r->code;

if ($result != 404 and $result != 500){
  print "\n".$r->status_line.": $type"."://"."$host"."/"."$paths";
print SAVE "\n".$r->status_line.": $type"."://"."$host"."/"."$paths";
  }
}

close(SAVE and DIRS);

__END__