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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] USB Manager 0.2
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] USB Manager 0.2  (Leído 1,541 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] USB Manager 0.2
« en: 3 Diciembre 2011, 16:34 pm »

Simple manager para usb

Código
  1. #!usr/bin/perl
  2. #USB Manager 0.2
  3. #Coded By Doddy H
  4.  
  5. use Cwd;
  6.  
  7. head();
  8.  
  9. print "\n\n[+] USB : ";
  10. chomp(my $usb=<stdin>);
  11. chdir($usb);
  12. print "\n";
  13. nave:
  14. print "\n".getcwd().">";
  15. chomp(my $rta = <stdin>);
  16. print "\n\n";
  17. if ($rta=~/list/) {
  18. my @files = coleccionar(getcwd());
  19. for(@files) {
  20. if (-f $_) {
  21. print "[File] : ".$_."\n";
  22. } else {
  23. print "[Directory] : ".$_."\n";
  24. }}}
  25. if ($rta=~/show (.*)/) {
  26. my $fu = $1;
  27. chomp $fu;
  28. if (-f $fu or -d $fu) {
  29. hideit($fu,"show");
  30. print "\n\n[+] Attributes changed\n\n";
  31. }
  32. }
  33. if ($rta=~/hide (.*)/) {
  34. my $fua = $1;
  35. chomp $fua;
  36. if (-f $fua or -d $fua) {
  37. hideit($fua,"hide");
  38. print "\n\n[+] Attributes changed\n\n";
  39. }
  40. }
  41. if ($rta=~/cd (.*)/) {
  42. my $dir = $1;
  43. if (chdir($dir)) {
  44. print "\n[+] Directory changed\n";
  45. } else {
  46. print "\n[-] Error\n";
  47. }}
  48. if ($rta=~/del (.*)/) {
  49. my $file = getcwd()."/".$1;
  50. if (-f $file) {
  51. if (unlink($file)) {
  52. print "\n[+] File Deleted\n";
  53. } else {
  54. print "\n[-] Error\n";
  55. }
  56. } else {
  57. if (rmdir($file)) {
  58. print "\n[+] Directory Deleted\n";
  59. } else {
  60. print "\n[-] Error\n";
  61. }}}
  62. if ($rta=~/rename (.*) (.*)/) {
  63. if (rename(getcwd()."/".$1,getcwd()."/".$2)) {
  64. print "\n[+] File Changed\n";
  65. } else {
  66. print "\n[-] Error\n";
  67. }}
  68. if ($rta=~/open (.*)/) {
  69. my $file = $1;
  70. chomp $file;
  71. system($file);
  72. #system(getcwd()."/".$file);
  73. }
  74. if ($rta=~/help/) {
  75. print "\nCommands : help cd list del rename open hide show exit\n\n";
  76. }
  77. if ($rta=~/exit/) {
  78. copyright();
  79. exit(1);
  80. }
  81. print "\n\n";
  82. goto nave;
  83.  
  84. sub coleccionar {
  85. opendir DIR,$_[0];
  86. my @archivos = readdir DIR;
  87. close DIR;
  88. return @archivos;
  89. }
  90.  
  91. sub hideit {
  92. use Win32::File;
  93. if ($_[1] eq "show") {
  94. Win32::File::SetAttributes($_[0],NORMAL);
  95. }
  96. elsif ($_[1] eq "hide") {
  97. Win32::File::SetAttributes($_[0],HIDDEN);
  98. }
  99. else {
  100. print "\n[-] error\n";
  101. }
  102. }
  103.  
  104. sub head {
  105. print "\n\n-- == USB Manager == --\n";
  106. }
  107.  
  108. sub copyright {
  109. print "\n\n(C) Doddy Hackman 2011\n\n";
  110. }
  111.  
  112. # The End ?
  113.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Perl] Manager
Scripting
BigBear 0 1,520 Último mensaje 9 Octubre 2011, 17:50 pm
por BigBear
[Perl] FTP Manager
Scripting
BigBear 0 1,543 Último mensaje 14 Octubre 2011, 15:25 pm
por BigBear
[Perl] Manager 0.3
Scripting
BigBear 0 1,465 Último mensaje 19 Enero 2012, 20:35 pm
por BigBear
[Perl] Mysql Manager 0.5
Scripting
BigBear 0 1,420 Último mensaje 14 Abril 2012, 19:49 pm
por BigBear
[Perl Tk] Mysql Manager 0.6
Scripting
BigBear 0 1,513 Último mensaje 14 Abril 2012, 19:49 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines