File: sqlmap.1

package info (click to toggle)
sqlmap 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,620 kB
  • ctags: 4,964
  • sloc: python: 48,383; xml: 15,395; ansic: 989; sh: 268; makefile: 60; sql: 57; perl: 30; cpp: 27; asm: 7
file content (610 lines) | stat: -rw-r--r-- 14,843 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.2.
.TH SQLMAP "1" "December 2015" "sqlmap.py v0.9" "User Commands"
.SH NAME
sqlmap \- automatic SQL injection tool
.SH SYNOPSIS
.B python
\fI\,sqlmap \/\fR[\fI\,options\/\fR]
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Show basic help message and exit
.TP
\fB\-hh\fR
Show advanced help message and exit
.TP
\fB\-\-version\fR
Show program's version number and exit
.TP
\fB\-v\fR VERBOSE
Verbosity level: 0\-6 (default 1)
.IP
Target:
.IP
At least one of these options has to be provided to define the
target(s)
.TP
\fB\-d\fR DIRECT
Connection string for direct database connection
.TP
\fB\-u\fR URL, \fB\-\-url\fR=\fI\,URL\/\fR
Target URL (e.g. "http://www.site.com/vuln.php?id=1")
.TP
\fB\-l\fR LOGFILE
Parse target(s) from Burp or WebScarab proxy log file
.TP
\fB\-x\fR SITEMAPURL
Parse target(s) from remote sitemap(.xml) file
.TP
\fB\-m\fR BULKFILE
Scan multiple targets given in a textual file
.TP
\fB\-r\fR REQUESTFILE
Load HTTP request from a file
.TP
\fB\-g\fR GOOGLEDORK
Process Google dork results as target URLs
.TP
\fB\-c\fR CONFIGFILE
Load options from a configuration INI file
.IP
Request:
.IP
These options can be used to specify how to connect to the target URL
.TP
\fB\-\-method\fR=\fI\,METHOD\/\fR
Force usage of given HTTP method (e.g. PUT)
.TP
\fB\-\-data\fR=\fI\,DATA\/\fR
Data string to be sent through POST
.TP
\fB\-\-param\-del\fR=\fI\,PARA\/\fR..
Character used for splitting parameter values
.TP
\fB\-\-cookie\fR=\fI\,COOKIE\/\fR
HTTP Cookie header value
.TP
\fB\-\-cookie\-del\fR=\fI\,COO\/\fR..
Character used for splitting cookie values
.TP
\fB\-\-load\-cookies\fR=\fI\,L\/\fR..
File containing cookies in Netscape/wget format
.TP
\fB\-\-drop\-set\-cookie\fR
Ignore Set\-Cookie header from response
.TP
\fB\-\-user\-agent\fR=\fI\,AGENT\/\fR
HTTP User\-Agent header value
.TP
\fB\-\-random\-agent\fR
Use randomly selected HTTP User\-Agent header value
.TP
\fB\-\-host\fR=\fI\,HOST\/\fR
HTTP Host header value
.TP
\fB\-\-referer\fR=\fI\,REFERER\/\fR
HTTP Referer header value
.TP
\fB\-H\fR HEADER, \fB\-\-hea\fR..
Extra header (e.g. "X\-Forwarded\-For: 127.0.0.1")
.TP
\fB\-\-headers\fR=\fI\,HEADERS\/\fR
Extra headers (e.g. "Accept\-Language: fr\enETag: 123")
.TP
\fB\-\-auth\-type\fR=\fI\,AUTH\/\fR..
HTTP authentication type (Basic, Digest, NTLM or PKI)
.TP
\fB\-\-auth\-cred\fR=\fI\,AUTH\/\fR..
HTTP authentication credentials (name:password)
.TP
\fB\-\-auth\-file\fR=\fI\,AUTH\/\fR..
HTTP authentication PEM cert/private key file
.TP
\fB\-\-ignore\-401\fR
Ignore HTTP Error 401 (Unauthorized)
.TP
\fB\-\-proxy\fR=\fI\,PROXY\/\fR
Use a proxy to connect to the target URL
.TP
\fB\-\-proxy\-cred\fR=\fI\,PRO\/\fR..
Proxy authentication credentials (name:password)
.TP
\fB\-\-proxy\-file\fR=\fI\,PRO\/\fR..
Load proxy list from a file
.TP
\fB\-\-ignore\-proxy\fR
Ignore system default proxy settings
.TP
\fB\-\-tor\fR
Use Tor anonymity network
.TP
\fB\-\-tor\-port\fR=\fI\,TORPORT\/\fR
Set Tor proxy port other than default
.TP
\fB\-\-tor\-type\fR=\fI\,TORTYPE\/\fR
Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5)
.TP
\fB\-\-check\-tor\fR
Check to see if Tor is used properly
.TP
\fB\-\-delay\fR=\fI\,DELAY\/\fR
Delay in seconds between each HTTP request
.TP
\fB\-\-timeout\fR=\fI\,TIMEOUT\/\fR
Seconds to wait before timeout connection (default 30)
.TP
\fB\-\-retries\fR=\fI\,RETRIES\/\fR
Retries when the connection timeouts (default 3)
.TP
\fB\-\-randomize\fR=\fI\,RPARAM\/\fR
Randomly change value for given parameter(s)
.TP
\fB\-\-safe\-url\fR=\fI\,SAFEURL\/\fR
URL address to visit frequently during testing
.TP
\fB\-\-safe\-post\fR=\fI\,SAFE\/\fR..
POST data to send to a safe URL
.TP
\fB\-\-safe\-req\fR=\fI\,SAFER\/\fR..
Load safe HTTP request from a file
.TP
\fB\-\-safe\-freq\fR=\fI\,SAFE\/\fR..
Test requests between two visits to a given safe URL
.TP
\fB\-\-skip\-urlencode\fR
Skip URL encoding of payload data
.TP
\fB\-\-csrf\-token\fR=\fI\,CSR\/\fR..
Parameter used to hold anti\-CSRF token
.TP
\fB\-\-csrf\-url\fR=\fI\,CSRFURL\/\fR
URL address to visit to extract anti\-CSRF token
.TP
\fB\-\-force\-ssl\fR
Force usage of SSL/HTTPS
.TP
\fB\-\-hpp\fR
Use HTTP parameter pollution method
.TP
\fB\-\-eval\fR=\fI\,EVALCODE\/\fR
Evaluate provided Python code before the request (e.g.
"import hashlib;id2=hashlib.md5(id).hexdigest()")
.IP
Optimization:
.IP
These options can be used to optimize the performance of sqlmap
.TP
\fB\-o\fR
Turn on all optimization switches
.TP
\fB\-\-predict\-output\fR
Predict common queries output
.TP
\fB\-\-keep\-alive\fR
Use persistent HTTP(s) connections
.TP
\fB\-\-null\-connection\fR
Retrieve page length without actual HTTP response body
.TP
\fB\-\-threads\fR=\fI\,THREADS\/\fR
Max number of concurrent HTTP(s) requests (default 1)
.IP
Injection:
.IP
These options can be used to specify which parameters to test for,
provide custom injection payloads and optional tampering scripts
.TP
\fB\-p\fR TESTPARAMETER
Testable parameter(s)
.TP
\fB\-\-skip\fR=\fI\,SKIP\/\fR
Skip testing for given parameter(s)
.TP
\fB\-\-skip\-static\fR
Skip testing parameters that not appear dynamic
.TP
\fB\-\-dbms\fR=\fI\,DBMS\/\fR
Force back\-end DBMS to this value
.TP
\fB\-\-dbms\-cred\fR=\fI\,DBMS\/\fR..
DBMS authentication credentials (user:password)
.TP
\fB\-\-os\fR=\fI\,OS\/\fR
Force back\-end DBMS operating system to this value
.TP
\fB\-\-invalid\-bignum\fR
Use big numbers for invalidating values
.TP
\fB\-\-invalid\-logical\fR
Use logical operations for invalidating values
.TP
\fB\-\-invalid\-string\fR
Use random strings for invalidating values
.TP
\fB\-\-no\-cast\fR
Turn off payload casting mechanism
.TP
\fB\-\-no\-escape\fR
Turn off string escaping mechanism
.TP
\fB\-\-prefix\fR=\fI\,PREFIX\/\fR
Injection payload prefix string
.TP
\fB\-\-suffix\fR=\fI\,SUFFIX\/\fR
Injection payload suffix string
.TP
\fB\-\-tamper\fR=\fI\,TAMPER\/\fR
Use given script(s) for tampering injection data
.IP
Detection:
.IP
These options can be used to customize the detection phase
.TP
\fB\-\-level\fR=\fI\,LEVEL\/\fR
Level of tests to perform (1\-5, default 1)
.TP
\fB\-\-risk\fR=\fI\,RISK\/\fR
Risk of tests to perform (1\-3, default 1)
.TP
\fB\-\-string\fR=\fI\,STRING\/\fR
String to match when query is evaluated to True
.TP
\fB\-\-not\-string\fR=\fI\,NOT\/\fR..
String to match when query is evaluated to False
.TP
\fB\-\-regexp\fR=\fI\,REGEXP\/\fR
Regexp to match when query is evaluated to True
.TP
\fB\-\-code\fR=\fI\,CODE\/\fR
HTTP code to match when query is evaluated to True
.TP
\fB\-\-text\-only\fR
Compare pages based only on the textual content
.TP
\fB\-\-titles\fR
Compare pages based only on their titles
.IP
Techniques:
.IP
These options can be used to tweak testing of specific SQL injection
techniques
.TP
\fB\-\-technique\fR=\fI\,TECH\/\fR
SQL injection techniques to use (default "BEUSTQ")
.TP
\fB\-\-time\-sec\fR=\fI\,TIMESEC\/\fR
Seconds to delay the DBMS response (default 5)
.TP
\fB\-\-union\-cols\fR=\fI\,UCOLS\/\fR
Range of columns to test for UNION query SQL injection
.TP
\fB\-\-union\-char\fR=\fI\,UCHAR\/\fR
Character to use for bruteforcing number of columns
.TP
\fB\-\-union\-from\fR=\fI\,UFROM\/\fR
Table to use in FROM part of UNION query SQL injection
.TP
\fB\-\-dns\-domain\fR=\fI\,DNS\/\fR..
Domain name used for DNS exfiltration attack
.TP
\fB\-\-second\-order\fR=\fI\,S\/\fR..
Resulting page URL searched for second\-order response
.IP
Fingerprint:
.TP
\fB\-f\fR, \fB\-\-fingerprint\fR
Perform an extensive DBMS version fingerprint
.IP
Enumeration:
.IP
These options can be used to enumerate the back\-end database
management system information, structure and data contained in the
tables. Moreover you can run your own SQL statements
.TP
\fB\-a\fR, \fB\-\-all\fR
Retrieve everything
.TP
\fB\-b\fR, \fB\-\-banner\fR
Retrieve DBMS banner
.TP
\fB\-\-current\-user\fR
Retrieve DBMS current user
.TP
\fB\-\-current\-db\fR
Retrieve DBMS current database
.TP
\fB\-\-hostname\fR
Retrieve DBMS server hostname
.TP
\fB\-\-is\-dba\fR
Detect if the DBMS current user is DBA
.TP
\fB\-\-users\fR
Enumerate DBMS users
.TP
\fB\-\-passwords\fR
Enumerate DBMS users password hashes
.TP
\fB\-\-privileges\fR
Enumerate DBMS users privileges
.TP
\fB\-\-roles\fR
Enumerate DBMS users roles
.TP
\fB\-\-dbs\fR
Enumerate DBMS databases
.TP
\fB\-\-tables\fR
Enumerate DBMS database tables
.TP
\fB\-\-columns\fR
Enumerate DBMS database table columns
.TP
\fB\-\-schema\fR
Enumerate DBMS schema
.TP
\fB\-\-count\fR
Retrieve number of entries for table(s)
.TP
\fB\-\-dump\fR
Dump DBMS database table entries
.TP
\fB\-\-dump\-all\fR
Dump all DBMS databases tables entries
.TP
\fB\-\-search\fR
Search column(s), table(s) and/or database name(s)
.TP
\fB\-\-comments\fR
Retrieve DBMS comments
.TP
\fB\-D\fR DB
DBMS database to enumerate
.TP
\fB\-T\fR TBL
DBMS database table(s) to enumerate
.TP
\fB\-C\fR COL
DBMS database table column(s) to enumerate
.TP
\fB\-X\fR EXCLUDECOL
DBMS database table column(s) to not enumerate
.TP
\fB\-U\fR USER
DBMS user to enumerate
.TP
\fB\-\-exclude\-sysdbs\fR
Exclude DBMS system databases when enumerating tables
.TP
\fB\-\-where\fR=\fI\,DUMPWHERE\/\fR
Use WHERE condition while table dumping
.TP
\fB\-\-start\fR=\fI\,LIMITSTART\/\fR
First query output entry to retrieve
.TP
\fB\-\-stop\fR=\fI\,LIMITSTOP\/\fR
Last query output entry to retrieve
.TP
\fB\-\-first\fR=\fI\,FIRSTCHAR\/\fR
First query output word character to retrieve
.TP
\fB\-\-last\fR=\fI\,LASTCHAR\/\fR
Last query output word character to retrieve
.TP
\fB\-\-sql\-query\fR=\fI\,QUERY\/\fR
SQL statement to be executed
.TP
\fB\-\-sql\-shell\fR
Prompt for an interactive SQL shell
.TP
\fB\-\-sql\-file\fR=\fI\,SQLFILE\/\fR
Execute SQL statements from given file(s)
.IP
Brute force:
.IP
These options can be used to run brute force checks
.TP
\fB\-\-common\-tables\fR
Check existence of common tables
.TP
\fB\-\-common\-columns\fR
Check existence of common columns
.IP
User\-defined function injection:
.IP
These options can be used to create custom user\-defined functions
.TP
\fB\-\-udf\-inject\fR
Inject custom user\-defined functions
.TP
\fB\-\-shared\-lib\fR=\fI\,SHLIB\/\fR
Local path of the shared library
.IP
File system access:
.IP
These options can be used to access the back\-end database management
system underlying file system
.TP
\fB\-\-file\-read\fR=\fI\,RFILE\/\fR
Read a file from the back\-end DBMS file system
.TP
\fB\-\-file\-write\fR=\fI\,WFILE\/\fR
Write a local file on the back\-end DBMS file system
.TP
\fB\-\-file\-dest\fR=\fI\,DFILE\/\fR
Back\-end DBMS absolute filepath to write to
.IP
Operating system access:
.IP
These options can be used to access the back\-end database management
system underlying operating system
.TP
\fB\-\-os\-cmd\fR=\fI\,OSCMD\/\fR
Execute an operating system command
.TP
\fB\-\-os\-shell\fR
Prompt for an interactive operating system shell
.TP
\fB\-\-os\-pwn\fR
Prompt for an OOB shell, Meterpreter or VNC
.TP
\fB\-\-os\-smbrelay\fR
One click prompt for an OOB shell, Meterpreter or VNC
.TP
\fB\-\-os\-bof\fR
Stored procedure buffer overflow exploitation
.TP
\fB\-\-priv\-esc\fR
Database process user privilege escalation
.TP
\fB\-\-msf\-path\fR=\fI\,MSFPATH\/\fR
Local path where Metasploit Framework is installed
.TP
\fB\-\-tmp\-path\fR=\fI\,TMPPATH\/\fR
Remote absolute path of temporary files directory
.IP
Windows registry access:
.IP
These options can be used to access the back\-end database management
system Windows registry
.TP
\fB\-\-reg\-read\fR
Read a Windows registry key value
.TP
\fB\-\-reg\-add\fR
Write a Windows registry key value data
.TP
\fB\-\-reg\-del\fR
Delete a Windows registry key value
.TP
\fB\-\-reg\-key\fR=\fI\,REGKEY\/\fR
Windows registry key
.TP
\fB\-\-reg\-value\fR=\fI\,REGVAL\/\fR
Windows registry key value
.TP
\fB\-\-reg\-data\fR=\fI\,REGDATA\/\fR
Windows registry key value data
.TP
\fB\-\-reg\-type\fR=\fI\,REGTYPE\/\fR
Windows registry key value type
.IP
General:
.IP
These options can be used to set some general working parameters
.TP
\fB\-s\fR SESSIONFILE
Load session from a stored (.sqlite) file
.TP
\fB\-t\fR TRAFFICFILE
Log all HTTP traffic into a textual file
.TP
\fB\-\-batch\fR
Never ask for user input, use the default behaviour
.TP
\fB\-\-charset\fR=\fI\,CHARSET\/\fR
Force character encoding used for data retrieval
.TP
\fB\-\-crawl\fR=\fI\,CRAWLDEPTH\/\fR
Crawl the website starting from the target URL
.TP
\fB\-\-crawl\-exclude=\fR..
Regexp to exclude pages from crawling (e.g. "logout")
.TP
\fB\-\-csv\-del\fR=\fI\,CSVDEL\/\fR
Delimiting character used in CSV output (default ",")
.TP
\fB\-\-dump\-format\fR=\fI\,DU\/\fR..
Format of dumped data (CSV (default), HTML or SQLITE)
.TP
\fB\-\-eta\fR
Display for each output the estimated time of arrival
.TP
\fB\-\-flush\-session\fR
Flush session files for current target
.TP
\fB\-\-forms\fR
Parse and test forms on target URL
.TP
\fB\-\-fresh\-queries\fR
Ignore query results stored in session file
.TP
\fB\-\-hex\fR
Use DBMS hex function(s) for data retrieval
.TP
\fB\-\-output\-dir\fR=\fI\,OUT\/\fR..
Custom output directory path
.TP
\fB\-\-parse\-errors\fR
Parse and display DBMS error messages from responses
.TP
\fB\-\-pivot\-column\fR=\fI\,P\/\fR..
Pivot column name
.TP
\fB\-\-save\fR=\fI\,SAVECONFIG\/\fR
Save options to a configuration INI file
.TP
\fB\-\-scope\fR=\fI\,SCOPE\/\fR
Regexp to filter targets from provided proxy log
.TP
\fB\-\-test\-filter\fR=\fI\,TE\/\fR..
Select tests by payloads and/or titles (e.g. ROW)
.TP
\fB\-\-test\-skip\fR=\fI\,TEST\/\fR..
Skip tests by payloads and/or titles (e.g. BENCHMARK)
.TP
\fB\-\-update\fR
Update sqlmap
.IP
Miscellaneous:
.TP
\fB\-z\fR MNEMONICS
Use short mnemonics (e.g. "flu,bat,ban,tec=EU")
.TP
\fB\-\-alert\fR=\fI\,ALERT\/\fR
Run host OS command(s) when SQL injection is found
.TP
\fB\-\-answers\fR=\fI\,ANSWERS\/\fR
Set question answers (e.g. "quit=N,follow=N")
.TP
\fB\-\-beep\fR
Beep on question and/or when SQL injection is found
.TP
\fB\-\-cleanup\fR
Clean up the DBMS from sqlmap specific UDF and tables
.TP
\fB\-\-dependencies\fR
Check for missing (non\-core) sqlmap dependencies
.TP
\fB\-\-disable\-coloring\fR
Disable console output coloring
.TP
\fB\-\-gpage\fR=\fI\,GOOGLEPAGE\/\fR
Use Google dork results from specified page number
.TP
\fB\-\-identify\-waf\fR
Make a thorough testing for a WAF/IPS/IDS protection
.TP
\fB\-\-skip\-waf\fR
Skip heuristic detection of WAF/IPS/IDS protection
.TP
\fB\-\-mobile\fR
Imitate smartphone through HTTP User\-Agent header
.TP
\fB\-\-offline\fR
Work in offline mode (only use session data)
.TP
\fB\-\-page\-rank\fR
Display page rank (PR) for Google dork results
.TP
\fB\-\-purge\-output\fR
Safely remove all content from output directory
.TP
\fB\-\-smart\fR
Conduct thorough tests only if positive heuristic(s)
.TP
\fB\-\-sqlmap\-shell\fR
Prompt for an interactive sqlmap shell
.TP
\fB\-\-wizard\fR
Simple wizard interface for beginner users