dedecms /member/edit_baseinfo.php SQL Injection Vul

來源:互聯網
上載者:User

標籤:

catalog

1. 漏洞描述2. 漏洞觸發條件3. 漏洞影響範圍4. 漏洞程式碼分析5. 防禦方法6. 攻防思考

 

1. 漏洞描述

會員模組中存在的SQL注入

Relevant Link:

http://www.grabsun.com/article/2015/1216455.html


2. 漏洞觸發條件

1. 註冊使用者並且登陸2. 開啟http://127.0.0.1/dedecms5.5/member/edit_baseinfo.php3. 填寫完畢後,輸入驗證碼,點擊提交,開啟BURP 抓包4. 然後再BURP裡修改newsafequestion 的值改成: 1‘,[email protected]`‘`,uname=(select user()),email=‘sss5. 然後提交 之後再開啟http://127.0.0.1/dedecms5.5/member/edit_baseinfo.php6. 就可以看到自己的、使用者名稱變成了注入之後的結果了

Relevant Link:

http://www.wooyun.org/bugs/wooyun-2014-048873


3. 漏洞影響範圍
4. 漏洞程式碼分析

/member/edit_baseinfo.php

.. //修改安全問題if($newsafequestion != 0 && $newsafeanswer != ‘‘){    if(strlen($newsafeanswer) > 30)    {        ShowMsg(‘你的新安全問題的答案太長了,請保持在30位元組以內!‘,‘-1‘);        exit();    }    else    {        //這裡的newsafequest沒過濾,駭客可以將SQL代碼注入到$addupquery中,用於之後的SQL查詢        $addupquery .= ",safequestion=‘$newsafequestion‘,safeanswer=‘$newsafeanswer‘";    }}..//帶入SQL查詢$query1 = "Update `#@__member` set pwd=‘$pwd‘,sex=‘$sex‘{$addupquery} where mid=‘".$cfg_ml->M_ID."‘ ";$dsql->ExecuteNoneQuery($query1);


5. 防禦方法

/member/edit_baseinfo.php

..//修改安全問題if($newsafequestion != 0 && $newsafeanswer != ‘‘){    if(strlen($newsafeanswer) > 30)    {    ShowMsg(‘你的新安全問題的答案太長了,請保持在30位元組以內!‘,‘-1‘);    exit();    }    else    {    /* 過濾 */            $newsafequestion = HtmlReplace($newsafequestion,1);            $newsafeanswer = HtmlReplace($newsafeanswer,1);    /* */    $addupquery .= ",safequestion=‘$newsafequestion‘,safeanswer=‘$newsafeanswer‘";    }}..$query1 = "UPDATE `#@__member` SET pwd=‘$pwd‘,sex=‘$sex‘{$addupquery} where mid=‘".$cfg_ml->M_ID."‘ ";$dsql->ExecuteNoneQuery($query1);


6. 攻防思考

Copyright (c) 2015 LittleHann All rights reserved

 

dedecms /member/edit_baseinfo.php SQL Injection Vul

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.