關於sql注入的請問

來源:互聯網
上載者:User
關於sql注入的請教
剛才看了這個文章
http://topic.csdn.net/u/20121011/08/ed0d9538-0ed1-49c4-95c3-0fc1ef686aa2.html

他的登入代碼是這樣的:
PHP code
$username = $_REQUEST['username'];$password = $_REQUEST['password'];$sql="select * from users where username='$username' and password='$password'";

後來根據他的方法,在知道使用者名稱的情況下確實可以繞過密碼提交登入成功。

不過他的方法首要先滿足get_magic_quotes_gpc過濾關閉的情況下,這是基礎條件。

然後他的登入代碼似乎太落後了,現在的密碼一般都是用md5加密一下,比如我的登入驗證一般是這樣寫的:
PHP code
$username = $_REQUEST['username'];$password = md5($_REQUEST['password']);//改了這行$sql="select * from users where username='$username' and password='$password'";

這樣提交表單得到的$sql就成了:
Select * from users where username='sean' and password='7e2705cbd698f255b7fe11eff40de898'


像這種情況應該怎麼注入呢?

------解決方案--------------------
不是還有 $username 嗎?幹嘛非要是 $password

只要 magic_quotes_gpc = on 這些小兒科的攻擊立即失效
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.