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: [Overclocking] Récords de overclock del foro

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

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Perl] FTP Manager
« en: 14 Octubre 2011, 15:25 »

Hoy eh terminado este simple cliente FTP el codigo es el siguiente

Código
#!usr/bin/perl
#FTP Manager
#(C) Doddy Hackman 2010
 
use Net::FTP;
 
&head;
 
print "\n\n[FTP Server] : ";
chomp (my $ftp = <stdin>);
print "[User] : ";
chomp (my $user = <stdin>);
print "[Pass] : ";
chomp (my $pass = <stdin>);
 
 
if (my $socket = Net::FTP->new($ftp)) {
if ($socket->login($user,$pass)) {
 
print "\n[+] Enter of the server FTP\n\n";
 
menu:
 
print "\n\n>>";
chomp (my $cmd = <stdin>);
print "\n\n";
 
if ($cmd=~/help/) {
print q(
 
help : show information
cd : change directory <dir>
dir : list a directory
mdkdir : create a directory <dir>
rmdir : delete a directory <dir>
pwd : directory  
del : delete a file <file>
rename : change name of the a file <file1> <file2>
size : size of the a file <file>
put : upload a file <file>
get : download a file <file>
cdup : change dir <dir>
 
 
);
}
 
if ($cmd=~/dir/ig) {
if (my @files = $socket->dir()) {
for(@files) {
print "[+] ".$_."\n";
}
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/pwd/ig) {
print "[+] Path : ".$socket->pwd()."\n";
}
 
if ($cmd=~/cd (.*)/ig) {
if ($socket->cwd($1)) {
print "[+] Directory changed\n";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/cdup/ig) {
if (my $dir = $socket->cdup()) {
print "\n\n[+] Directory changed\n\n";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/del (.*)/ig) {
if ($socket->delete($1)) {
print "[+] File deleted\n";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/rename (.*) (.*)/ig) {
if ($socket->rename($1,$2)) {
print "[+] File Updated\n";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/mkdir (.*)/ig) {
if ($socket->mkdir($1)) {
print "\n\n[+] Directory created\n";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/rmdir (.*)/ig) {
if ($socket->rmdir($1)) {
print "\n\n[+] Directory deleted\n";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/exit/ig) {
copyright();
exit(1);
}
 
if ($cmd=~/get (.*) (.*)/ig) {
print "\n\n[+] Downloading file\n\n";
if ($socket->get($1,$2)) {
print "[+] Download completed";
} else {
print "\n\n[-] Error\n\n";
}
}
 
if ($cmd=~/put (.*) (.*)/ig) {
print "\n\n[+] Uploading file\n\n";
if ($socket->put($1,$2)) {
print "[+] Upload completed";
} else {
print "\n\n[-] Error\n\n";
}
}
 
goto menu;
 
} else {
print "\n\n[-] Failed the login\n\n";
}
 
} else {
print "\n\n[-] Error\n\n";
}
 
sub head {
print "\n\n -- == FTP Manager == --\n\n";
}
 
sub copyright {
print "\n\n(C) Doddy Hackman 2010\n\n";
}
 
 
# ¿ The End ?
 


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Facebook Manager [ Perl ]
Scripting
Leo Gutiérrez. 0 618 Último mensaje 31 Diciembre 2010, 00:45
por Leo Gutiérrez.
[Perl] Mysql Manager
Scripting
Doddy 0 136 Último mensaje 7 Octubre 2011, 01:14
por Doddy
[Perl] Manager
Scripting
Doddy 0 114 Último mensaje 9 Octubre 2011, 17:50
por Doddy
[Perl] USB Manager 0.2
Scripting
Doddy 0 208 Último mensaje 3 Diciembre 2011, 16:34
por Doddy
[Perl] Manager 0.3
Scripting
Doddy 0 111 Último mensaje 19 Enero 2012, 20:35
por Doddy
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines