elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [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 1,543 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



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

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

Código
  1. #!usr/bin/perl
  2. #FTP Manager
  3. #(C) Doddy Hackman 2010
  4.  
  5. use Net::FTP;
  6.  
  7. &head;
  8.  
  9. print "\n\n[FTP Server] : ";
  10. chomp (my $ftp = <stdin>);
  11. print "[User] : ";
  12. chomp (my $user = <stdin>);
  13. print "[Pass] : ";
  14. chomp (my $pass = <stdin>);
  15.  
  16.  
  17. if (my $socket = Net::FTP->new($ftp)) {
  18. if ($socket->login($user,$pass)) {
  19.  
  20. print "\n[+] Enter of the server FTP\n\n";
  21.  
  22. menu:
  23.  
  24. print "\n\n>>";
  25. chomp (my $cmd = <stdin>);
  26. print "\n\n";
  27.  
  28. if ($cmd=~/help/) {
  29.  
  30. help : show information
  31. cd : change directory <dir>
  32. dir : list a directory
  33. mdkdir : create a directory <dir>
  34. rmdir : delete a directory <dir>
  35. pwd : directory  
  36. del : delete a file <file>
  37. rename : change name of the a file <file1> <file2>
  38. size : size of the a file <file>
  39. put : upload a file <file>
  40. get : download a file <file>
  41. cdup : change dir <dir>
  42.  
  43.  
  44. );
  45. }
  46.  
  47. if ($cmd=~/dir/ig) {
  48. if (my @files = $socket->dir()) {
  49. for(@files) {
  50. print "[+] ".$_."\n";
  51. }
  52. } else {
  53. print "\n\n[-] Error\n\n";
  54. }
  55. }
  56.  
  57. if ($cmd=~/pwd/ig) {
  58. print "[+] Path : ".$socket->pwd()."\n";
  59. }
  60.  
  61. if ($cmd=~/cd (.*)/ig) {
  62. if ($socket->cwd($1)) {
  63. print "[+] Directory changed\n";
  64. } else {
  65. print "\n\n[-] Error\n\n";
  66. }
  67. }
  68.  
  69. if ($cmd=~/cdup/ig) {
  70. if (my $dir = $socket->cdup()) {
  71. print "\n\n[+] Directory changed\n\n";
  72. } else {
  73. print "\n\n[-] Error\n\n";
  74. }
  75. }
  76.  
  77. if ($cmd=~/del (.*)/ig) {
  78. if ($socket->delete($1)) {
  79. print "[+] File deleted\n";
  80. } else {
  81. print "\n\n[-] Error\n\n";
  82. }
  83. }
  84.  
  85. if ($cmd=~/rename (.*) (.*)/ig) {
  86. if ($socket->rename($1,$2)) {
  87. print "[+] File Updated\n";
  88. } else {
  89. print "\n\n[-] Error\n\n";
  90. }
  91. }
  92.  
  93. if ($cmd=~/mkdir (.*)/ig) {
  94. if ($socket->mkdir($1)) {
  95. print "\n\n[+] Directory created\n";
  96. } else {
  97. print "\n\n[-] Error\n\n";
  98. }
  99. }
  100.  
  101. if ($cmd=~/rmdir (.*)/ig) {
  102. if ($socket->rmdir($1)) {
  103. print "\n\n[+] Directory deleted\n";
  104. } else {
  105. print "\n\n[-] Error\n\n";
  106. }
  107. }
  108.  
  109. if ($cmd=~/exit/ig) {
  110. copyright();
  111. exit(1);
  112. }
  113.  
  114. if ($cmd=~/get (.*) (.*)/ig) {
  115. print "\n\n[+] Downloading file\n\n";
  116. if ($socket->get($1,$2)) {
  117. print "[+] Download completed";
  118. } else {
  119. print "\n\n[-] Error\n\n";
  120. }
  121. }
  122.  
  123. if ($cmd=~/put (.*) (.*)/ig) {
  124. print "\n\n[+] Uploading file\n\n";
  125. if ($socket->put($1,$2)) {
  126. print "[+] Upload completed";
  127. } else {
  128. print "\n\n[-] Error\n\n";
  129. }
  130. }
  131.  
  132. goto menu;
  133.  
  134. } else {
  135. print "\n\n[-] Failed the login\n\n";
  136. }
  137.  
  138. } else {
  139. print "\n\n[-] Error\n\n";
  140. }
  141.  
  142. sub head {
  143. print "\n\n -- == FTP Manager == --\n\n";
  144. }
  145.  
  146. sub copyright {
  147. print "\n\n(C) Doddy Hackman 2010\n\n";
  148. }
  149.  
  150.  
  151. # ¿ The End ?
  152.  


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
leogtz 0 2,435 Último mensaje 31 Diciembre 2010, 00:45 am
por leogtz
[Perl] FSD Exploit Manager
Scripting
BigBear 0 1,854 Último mensaje 7 Octubre 2011, 01:14 am
por BigBear
[Perl] Manager
Scripting
BigBear 0 1,520 Último mensaje 9 Octubre 2011, 17:50 pm
por BigBear
[Perl] USB Manager 0.2
Scripting
BigBear 0 1,540 Último mensaje 3 Diciembre 2011, 16:34 pm
por BigBear
[Perl] Manager 0.3
Scripting
BigBear 0 1,464 Último mensaje 19 Enero 2012, 20:35 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines