elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 09:17  


Tema destacado: Grupo de Facebook de elhacker.net

+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting (Moderadores: Novlucker, Leo Gutiérrez., EleKtro H@cker)
| | |-+  [Perl] FinderText 0.1
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] FinderText 0.1  (Leído 105 veces)
Doddy

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Perl] FinderText 0.1
« en: 1 Diciembre 2011, 22:11 »

Un simple programa para buscar cierto texto en un archivo o directorio.

Código
#!usr/bin/perl
#FinderText 0.1
#Written by Doddy H
 
print "\n-- == FinderText 0.1 == --\n\n";
unless($ARGV[0]) {
print "\n[+] sintax : $0 <file/dir> <text>\n";
} else {
print "\n[+] Searching text\n\n";
if (-f $ARGV[0]) {
verificar($ARGV[0],$ARGV[1]);
}
if (-d $ARGV[0]) {
goodbye($ARGV[0],$ARGV[1]);
}
print "\n[+] Finished\n";
}
print "\n\n[+] Written By Doddy H\n\n";
 
sub verificar {
 
my ($file,$text) = @_;
my $numero_linea = 0;
 
open(FILE,$file);
my @words = <FILE>;
close FILE;
 
chomp @words;
 
for my $linea(@words) {
chomp $linea;
$numero_linea++;
if ($linea=~/$text/ig) {
print "[+] Text $text Found in file $file in line $numero_linea\n";
}}}
 
sub goodbye {
 
opendir DIR,$_[0];
my @archivos = readdir DIR;
close DIR;
 
for (@archivos) {
next if $_ eq "." or $_ eq "..";
my $fichero = $_[0]."/".$_;
 
if (-f $fichero) {
verificar($fichero,$_[1]);
}
 
if (-d $fichero) {
&goodbye($fichero);
}}}
 
# The End ?


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
perl
Desarrollo Web
chita_GB2 1 316 Último mensaje 4 Abril 2004, 05:34
por Morris
Ayuda con el Active Perl + Perl
Hacking Básico
Aironjack 3 926 Último mensaje 8 Marzo 2005, 07:52
por Aironjack
Que significa #!/usr/bin/perl ?? como ejecutamos un exploit en perl...
Bugs y Exploits
mousehack 7 2,198 Último mensaje 4 Noviembre 2005, 23:16
por BenRu
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 854 Último mensaje 18 Mayo 2011, 21:49
por madpitbull_99
[Ruby] FinderText
Scripting
Doddy 0 78 Último mensaje 11 Febrero 2012, 23:04
por Doddy
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines