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:18  


Tema destacado: Últimos eventos sobre seguridad/inseguridad

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

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Perl] Mysql Manager
« en: 7 Octubre 2011, 01:14 »

Un simple mysql manager , un triste intento de imitacion al comando mysql pero bueno....

Código
#!usr/bin/perl 
#Mysql Manager (C) Doddy Hackman 2011
#ppm install http://www.bribes.org/perl/ppm/DBI.ppd
 
use DBI;
 
sub head {
print "\n\n -- == Mysql Manager == --\n\n";
}
 
sub copyright {
print "\n\n-- == (C) Doddy Hackman 2011 == --\n\n";
exit(1);
}
 
sub sintax {
print "\n[+] Sintax : $0 <host> <user> <pass>\n";
}
 
head();
unless (@ARGV > 2) {
sintax();
} else {
enter($ARGV[0],$ARGV[1],$ARGV[2]);
}
copyright();
 
sub enter {
 
print "\n[+] Connecting to the server\n";
 
$info = "dbi:mysql::".$_[0].":3306";
if (my $enter = DBI->connect($info,$_[1],$_[2],{PrintError=>0})) {
 
print "\n[+] Enter in the database";
 
while(1) {
print "\n\n\n[+] Query : ";
chomp(my $ac = <stdin>);
 
if ($ac eq "exit") {
$enter->disconnect;
print "\n\n[+] Closing connection\n\n";
copyright();
}
 
$re = $enter->prepare($ac);
$re->execute();
my $total = $re->rows();
 
my @columnas = @{$re->{NAME}};
 
if ($total eq "-1") {
print "\n\n[-] Query Error\n";
next;
} else {
print "\n\n[+] Result of the query\n";
if ($total eq 0) {
print "\n\n[+] Not rows returned\n\n";
} else {
print "\n\n[+] Rows returned : ".$total."\n\n\n";
for(@columnas) {
print $_."\t\t";
}
print "\n\n";
while (@row = $re->fetchrow_array) {
for(@row) {
print $_."\t\t";
}
print "\n";
}}}}
} else {
print "\n[-] Error connecting\n";
}}
 
# ¿ The End ?


Un ejemplo de uso

Código:

C:\Documents and Settings\Administrador\Escritorio\Todo\Warfactory II\proyectos\
mysqlman>manager.PL localhost root ""


 -- == Mysql Manager == --


[+] Connecting to the server

[+] Enter in the database


[+] Query : show databases


[+] Result of the query


[+] Rows returned : 6


Database

information_schema
cdcol
hackman
mysql
phpmyadmin
test



[+] Query : exit


[+] Closing connection



-- == (C) Doddy Hackman 2011 == --




« Última modificación: 8 Octubre 2011, 18:58 por Doddy » 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] FSD Exploit Manager
Scripting
Doddy 0 336 Último mensaje 7 Octubre 2011, 01:14
por Doddy
[Perl] Manager
Scripting
Doddy 0 115 Último mensaje 9 Octubre 2011, 17:50
por Doddy
[Perl] Mysql Manager 0.5
Scripting
Doddy 0 75 Último mensaje 14 Abril 2012, 19:49
por Doddy
[Perl Tk] Mysql Manager 0.6
Scripting
Doddy 0 137 Último mensaje 14 Abril 2012, 19:49
por Doddy
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines