Bienvenido a Tecnohackers

Tecnohackers » General del foro » Area de Programacion » Scripting. VBS, Batch, Bash, JavaSript. (Moderador: Doddy)
 » 

[Perl] USB Manager 0.2



Autor Tema: [Perl] USB Manager 0.2  (Leído 18 veces)

Desconectado Doddy

  • Moderator
  • Veterano
  • *****
  • Mensajes: 267
  • Slow Mind
[Perl] USB Manager 0.2
« en: Diciembre 01, 2011, 06:58:46 pm »
Simple manager para usb

Código: No puedes ver links Registrate o Login
#!usr/bin/perl
#USB Manager 0.2
#Coded By Doddy H

use Cwd;

head();

print "\n\n[+] USB : ";
chomp(my $usb=<stdin>);
chdir($usb);
print "\n";
nave:
print "\n".getcwd().">";
chomp(my $rta = <stdin>);
print "\n\n";
if ($rta=~/list/) {
my @files = coleccionar(getcwd());
for(@files) {
if (-f $_) {
print "[File] : ".$_."\n";
} else {
print "[Directory] : ".$_."\n";
}}}
if ($rta=~/show (.*)/) {
my $fu = $1;
chomp $fu;
if (-f $fu or -d $fu) {
hideit($fu,"show");
print "\n\n[+] Attributes changed\n\n";
}
}
if ($rta=~/hide (.*)/) {
my $fua = $1;
chomp $fua;
if (-f $fua or -d $fua) {
hideit($fua,"hide");
print "\n\n[+] Attributes changed\n\n";
}
}
if ($rta=~/cd (.*)/) {
my $dir = $1;
if (chdir($dir)) {
print "\n[+] Directory changed\n";
} else {
print "\n[-] Error\n";
}}
if ($rta=~/del (.*)/) {
my $file = getcwd()."/".$1;
if (-f $file) {
if (unlink($file)) {
print "\n[+] File Deleted\n";
} else {
print "\n[-] Error\n";
}
} else {
if (rmdir($file)) {
print "\n[+] Directory Deleted\n";
} else {
print "\n[-] Error\n";
}}}
if ($rta=~/rename (.*) (.*)/) {
if (rename(getcwd()."/".$1,getcwd()."/".$2)) {
print "\n[+] File Changed\n";
} else {
print "\n[-] Error\n";
}}
if ($rta=~/open (.*)/) {
my $file = $1;
chomp $file;
system($file);
#system(getcwd()."/".$file);
}
if ($rta=~/help/) {
print "\nCommands : help cd list del rename open hide show exit\n\n";
}
if ($rta=~/exit/) {
copyright();
exit(1);
}
print "\n\n";
goto nave;

sub coleccionar {
opendir DIR,$_[0];
my @archivos = readdir DIR;
close DIR;
return @archivos;
}

sub hideit {
use Win32::File;
if ($_[1] eq "show") {
Win32::File::SetAttributes($_[0],NORMAL);
}
elsif ($_[1] eq "hide") {
Win32::File::SetAttributes($_[0],HIDDEN);
}
else {
print "\n[-] error\n";
}
}

sub head {
print "\n\n-- == USB Manager == --\n";
}

sub copyright {
print "\n\n(C) Doddy Hackman 2011\n\n";
}

# The End ?
No puedes ver links Registrate o Login

Tags:

 

Related Topics

  Asunto / Iniciado por Respuestas Último mensaje
0 Respuestas
29 Vistas
Último mensaje Mayo 27, 2011, 11:42:33 pm
por Doddy
0 Respuestas
36 Vistas
Último mensaje Mayo 27, 2011, 11:43:32 pm
por Doddy
0 Respuestas
12 Vistas
Último mensaje Enero 19, 2012, 05:28:20 pm
por Doddy
0 Respuestas
60 Vistas
Último mensaje Abril 14, 2012, 03:47:46 pm
por Doddy


SMF 2.0.2 | SMF © 2011, Simple Machines
Paginas Afiliadas
InfraBios - i-hacker - Twitter - FaceBook - Troyanosyvirus - LaWebDeGoku - daraxblog
Designed by Smf Personal