一、sqlmap命令介紹
sqlmap文檔地址:https://github.com/sqlmapproject/sqlmap/wiki/Usage
摘取了其中的命令參數格式如下
中英對照版:
- Usage: python sqlmap.py [options]
- Options(選項):
- -h, --help Show basic help message and exit 顯示此幫助消息並退出
- -hh Show advanced help message and exit 展示先進的幫助信息並退出
- --version Show program's version number and exit 顯示程序的版本號並退出
- -v VERBOSE Verbosity level: 0-6 (default 1) 詳細級別:0-6(默認為1)
- Target(目標):
- At least one of these options has to be provided to define the
- target(s)
- 以下至少需要設置其中一個選項,設置目標URL。
- -d DIRECT Connection string for direct database connection 直接連接到數據庫。
- -u URL, --url=URL Target URL (e.g. "http://www.site.com/vuln.php?id=1") 目標URL。
- -l LOGFILE Parse target(s) from Burp or WebScarab proxy log file 解析目標(s)從Burp或WebScarab代理日志文件
- -x SITEMAPURL Parse target(s) from remote sitemap(.xml) file 解析目標(s)從遠程站點地圖文件(.xml)
- -m BULKFILE Scan multiple targets given in a textual file 掃描文本文件中給出的多個目標
- -r REQUESTFILE Load HTTP request from a file 從文件加載HTTP請求
- -g GOOGLEDORK Process Google dork results as target URLs 處理Google dork的結果作為目標URL。
- -c CONFIGFILE Load options from a configuration INI file 從INI配置文件中加載選項。
- Request(請求):
- These options can be used to specify how to connect to the target URL 這些選項可以用來指定如何連接到目標URL。
- --method=METHOD Force usage of given HTTP method (e.g. PUT) 強制使用給定的HTTP方法(e.g. PUT)
- --data=DATA Data string to be sent through POST 通過POST發送的數據字符串
- --param-del=PARA.. Character used for splitting parameter values 用於拆分參數值的字符
- --cookie=COOKIE HTTP Cookie header value HTTP Cookie頭的值
- --cookie-del=COO.. Character used for splitting cookie values 用於分割Cookie值的字符
- --load-cookies=L.. File containing cookies in Netscape/wget format 包含Netscape / wget格式的cookie的文件
- --drop-set-cookie Ignore Set-Cookie header from response 從響應中忽略Set-Cookie頭
- --user-agent=AGENT HTTP User-Agent header value 指定 HTTP User - Agent頭
- --random-agent Use randomly selected HTTP User-Agent header value 使用隨機選定的HTTP User - Agent頭
- --host=HOST HTTP Host header value HTTP主機頭值
- --referer=REFERER HTTP Referer header value 指定 HTTP Referer頭
- -H HEADER, --hea.. Extra header (e.g. "X-Forwarded-For: 127.0.0.1") 額外header
- --headers=HEADERS Extra headers (e.g. "Accept-Language: fr\nETag: 123") 額外header
- --auth-type=AUTH.. HTTP authentication type (Basic, Digest, NTLM or PKI) HTTP認證類型(Basic, Digest, NTLM or PKI)
- --auth-cred=AUTH.. HTTP authentication credentials (name:password) HTTP認證憑證(name:password)
- --auth-file=AUTH.. HTTP authentication PEM cert/private key file HTTP認證 PEM認證/私鑰文件
- --ignore-401 Ignore HTTP Error 401 (Unauthorized) 忽略HTTP錯誤401(未經授權)
- --proxy=PROXY Use a proxy to connect to the target URL 使用代理連接到目標網址
- --proxy-cred=PRO.. Proxy authentication credentials (name:password) 代理認證證書(name:password)
- --proxy-file=PRO.. Load proxy list from a file 從文件中加載代理列表
- --ignore-proxy Ignore system default proxy settings 忽略系統默認代理設置
- --tor Use Tor anonymity network 使用Tor匿名網絡
- --tor-port=TORPORT Set Tor proxy port other than default 設置Tor代理端口而不是默認值
- --tor-type=TORTYPE Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5) 設置Tor代理類型
- --check-tor Check to see if Tor is used properly 檢查Tor是否正確使用
- --delay=DELAY Delay in seconds between each HTTP request 每個HTTP請求之間的延遲(秒)
- --timeout=TIMEOUT Seconds to wait before timeout connection (default 30) 秒超時連接前等待(默認30)
- --retries=RETRIES Retries when the connection timeouts (default 3) 連接超時時重試(默認值3)
- --randomize=RPARAM Randomly change value for given parameter(s) 隨機更改給定參數的值(s)
- --safe-url=SAFEURL URL address to visit frequently during testing 在測試期間頻繁訪問的URL地址
- --safe-post=SAFE.. POST data to send to a safe URL POST數據發送到安全URL
- --safe-req=SAFER.. Load safe HTTP request from a file 從文件加載安全HTTP請求
- --safe-freq=SAFE.. Test requests between two visits to a given safe URL 在兩次訪問給定安全網址之間測試請求
- --skip-urlencode Skip URL encoding of payload data 跳過有效載荷數據的URL編碼
- --csrf-token=CSR.. Parameter used to hold anti-CSRF token 參數用於保存anti-CSRF令牌
- --csrf-url=CSRFURL URL address to visit to extract anti-CSRF token 提取anti-CSRF URL地址訪問令牌
- --force-ssl Force usage of SSL/HTTPS 強制使用SSL / HTTPS
- --hpp Use HTTP parameter pollution method 使用HTTP參數pollution的方法
- --eval=EVALCODE Evaluate provided Python code before the request (e.g. 評估請求之前提供Python代碼
- "import hashlib;id2=hashlib.md5(id).hexdigest()")
- Optimization(優化):
- These options can be used to optimize the performance of sqlmap 這些選項可用於優化sqlmap的性能
- -o Turn on all optimization switches 開啟所有優化開關
- --predict-output Predict common queries output 預測常見的查詢輸出
- --keep-alive Use persistent HTTP(s) connections 使用持久的HTTP(S)連接
- --null-connection Retrieve page length without actual HTTP response body 從沒有實際的HTTP響應體中檢索頁面長度
- --threads=THREADS Max number of concurrent HTTP(s) requests (default 1) 最大的HTTP(S)請求並發量(默認為1)
- Injection(注入):
- These options can be used to specify which parameters to test for,
- provide custom injection payloads and optional tampering scripts
- 這些選項可以用來指定測試哪些參數, 提供自定義的注入payloads和可選篡改腳本。
- -p TESTPARAMETER Testable parameter(s) 可測試的參數(S)
- --skip=SKIP Skip testing for given parameter(s) 跳過對給定參數的測試
- --skip-static Skip testing parameters that not appear to be dynamic 跳過測試不顯示為動態的參數
- --param-exclude=.. Regexp to exclude parameters from testing (e.g. "ses") 使用正則表達式排除參數進行測試(e.g. "ses")
- --dbms=DBMS Force back-end DBMS to this value 強制后端的DBMS為此值
- --dbms-cred=DBMS.. DBMS authentication credentials (user:password) DBMS認證憑證(user:password)
- --os=OS Force back-end DBMS operating system to this value 強制后端的DBMS操作系統為這個值
- --invalid-bignum Use big numbers for invalidating values 使用大數字使值無效
- --invalid-logical Use logical operations for invalidating values 使用邏輯操作使值無效
- --invalid-string Use random strings for invalidating values 使用隨機字符串使值無效
- --no-cast Turn off payload casting mechanism 關閉有效載荷鑄造機制
- --no-escape Turn off string escaping mechanism 關閉字符串轉義機制
- --prefix=PREFIX Injection payload prefix string 注入payload字符串前綴
- --suffix=SUFFIX Injection payload suffix string 注入payload字符串后綴
- --tamper=TAMPER Use given script(s) for tampering injection data 使用給定的腳本(S)篡改注入數據
- Detection(檢測):
- These options can be used to customize the detection phase 這些選項可以用來指定在SQL盲注時如何解析和比較HTTP響應頁面的內容。
- --level=LEVEL Level of tests to perform (1-5, default 1) 執行測試的等級(1-5,默認為1)
- --risk=RISK Risk of tests to perform (1-3, default 1) 執行測試的風險(0-3,默認為1)
- --string=STRING String to match when query is evaluated to True 查詢時有效時在頁面匹配字符串
- --not-string=NOT.. String to match when query is evaluated to False 當查詢求值為無效時匹配的字符串
- --regexp=REGEXP Regexp to match when query is evaluated to True 查詢時有效時在頁面匹配正則表達式
- --code=CODE HTTP code to match when query is evaluated to True 當查詢求值為True時匹配的HTTP代碼
- --text-only Compare pages based only on the textual content 僅基於在文本內容比較網頁
- --titles Compare pages based only on their titles 僅根據他們的標題進行比較
- Techniques(技巧):
- These options can be used to tweak testing of specific SQL injection
- techniques
- 這些選項可用於調整具體的SQL注入測試。
- --technique=TECH SQL injection techniques to use (default "BEUSTQ") SQL注入技術測試(默認BEUST)
- --time-sec=TIMESEC Seconds to delay the DBMS response (default 5) DBMS響應的延遲時間(默認為5秒)
- --union-cols=UCOLS Range of columns to test for UNION query SQL injection 定列范圍用於測試UNION查詢注入
- --union-char=UCHAR Character to use for bruteforcing number of columns 用於暴力猜解列數的字符
- --union-from=UFROM Table to use in FROM part of UNION query SQL injection 要在UNION查詢SQL注入的FROM部分使用的表
- --dns-domain=DNS.. Domain name used for DNS exfiltration attack 域名用於DNS漏出攻擊
- --second-order=S.. Resulting page URL searched for second-order response 生成頁面的URL搜索為second-order響應
- Fingerprint(指紋):
- -f, --fingerprint Perform an extensive DBMS version fingerprint 執行檢查廣泛的DBMS版本指紋
- Enumeration(枚舉):
- 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
- 這些選項可以用來列舉后端數據庫管理系統的信息、表中的結構和數據。此外,您還可以運行您自己的SQL語句。
- -a, --all Retrieve everything 檢索一切
- -b, --banner Retrieve DBMS banner 檢索數據庫管理系統的標識
- --current-user Retrieve DBMS current user 檢索數據庫管理系統的標識
- --current-db Retrieve DBMS current database 檢索數據庫管理系統當前數據庫
- --hostname Retrieve DBMS server hostname 檢索數據庫服務器的主機名
- --is-dba Detect if the DBMS current user is DBA 檢測DBMS當前用戶是否DBA
- --users Enumerate DBMS users 枚舉數據庫管理系統用戶
- --passwords Enumerate DBMS users password hashes 枚舉數據庫管理系統用戶密碼哈希
- --privileges Enumerate DBMS users privileges 枚舉數據庫管理系統用戶的權限
- --roles Enumerate DBMS users roles 枚舉數據庫管理系統用戶的角色
- --dbs Enumerate DBMS databases 枚舉數據庫管理系統數據庫
- --tables Enumerate DBMS database tables 枚舉的DBMS數據庫中的表
- --columns Enumerate DBMS database table columns 枚舉DBMS數據庫表列
- --schema Enumerate DBMS schema 枚舉數據庫架構
- --count Retrieve number of entries for table(s) 檢索表的條目數
- --dump Dump DBMS database table entries 轉儲數據庫管理系統的數據庫中的表項
- --dump-all Dump all DBMS databases tables entries 轉儲數據庫管理系統的數據庫中的表項
- --search Search column(s), table(s) and/or database name(s) 搜索列(S),表(S)和/或數據庫名稱(S)
- --comments Retrieve DBMS comments 檢索數據庫的comments(注釋、評論)
- -D DB DBMS database to enumerate 要進行枚舉的數據庫名
- -T TBL DBMS database table(s) to enumerate 要進行枚舉的數據庫表
- -C COL DBMS database table column(s) to enumerate 要進行枚舉的數據庫列
- -X EXCLUDECOL DBMS database table column(s) to not enumerate 要不進行枚舉的數據庫列
- -U USER DBMS user to enumerate 用來進行枚舉的數據庫用戶
- --exclude-sysdbs Exclude DBMS system databases when enumerating tables 枚舉表時排除系統數據庫
- --pivot-column=P.. Pivot column name 主列名稱
- --where=DUMPWHERE Use WHERE condition while table dumping 使用WHERE條件進行表轉儲
- --start=LIMITSTART First query output entry to retrieve 第一個查詢輸出進入檢索
- --stop=LIMITSTOP Last query output entry to retrieve 最后查詢的輸出進入檢索
- --first=FIRSTCHAR First query output word character to retrieve 第一個查詢輸出字的字符檢索
- --last=LASTCHAR Last query output word character to retrieve 最后查詢的輸出字字符檢索
- --sql-query=QUERY SQL statement to be executed 要執行的SQL語句
- --sql-shell Prompt for an interactive SQL shell 提示交互式SQL的shell
- --sql-file=SQLFILE Execute SQL statements from given file(s) 從給定文件執行SQL語句
- Brute force(蠻力):
- These options can be used to run brute force checks 這些選項可以被用來運行蠻力檢查。
- --common-tables Check existence of common tables 檢查存在共同表
- --common-columns Check existence of common columns 檢查存在共同列
- User-defined function injection(用戶自定義函數注入):
- These options can be used to create custom user-defined functions 這些選項可以用來創建用戶自定義函數。
- --udf-inject Inject custom user-defined functions 注入用戶自定義函數
- --shared-lib=SHLIB Local path of the shared library 共享庫的本地路徑
- File system access(訪問文件系統):
- These options can be used to access the back-end database management
- system underlying file system
- 這些選項可以被用來訪問后端數據庫管理系統的底層文件系統。
- --file-read=RFILE Read a file from the back-end DBMS file system 從后端的數據庫管理系統文件系統讀取文件
- --file-write=WFILE Write a local file on the back-end DBMS file system 編輯后端的數據庫管理系統文件系統上的本地文件
- --file-dest=DFILE Back-end DBMS absolute filepath to write to 后端的數據庫管理系統寫入文件的絕對路徑
- Operating system access(操作系統訪問):
- These options can be used to access the back-end database management
- system underlying operating system
- 這些選項可以用於訪問后端數據庫管理系統的底層操作系統。
- --os-cmd=OSCMD Execute an operating system command 執行操作系統命令
- --os-shell Prompt for an interactive operating system shell 交互式的操作系統的shell
- --os-pwn Prompt for an OOB shell, Meterpreter or VNC 獲取一個OOB shell,meterpreter或VNC
- --os-smbrelay One click prompt for an OOB shell, Meterpreter or VNC 一鍵獲取一個OOB shell,meterpreter或VNC
- --os-bof Stored procedure buffer overflow exploitation 存儲過程緩沖區溢出利用
- --priv-esc Database process user privilege escalation 數據庫進程用戶權限提升
- --msf-path=MSFPATH Local path where Metasploit Framework is installed Metasploit Framework本地的安裝路徑
- --tmp-path=TMPPATH Remote absolute path of temporary files directory 遠程臨時文件目錄的絕對路徑
- Windows registry access(Windows注冊表訪問):
- These options can be used to access the back-end database management
- system Windows registry
- 這些選項可以被用來訪問后端數據庫管理系統Windows注冊表。
- --reg-read Read a Windows registry key value 讀一個Windows注冊表項值
- --reg-add Write a Windows registry key value data 寫一個Windows注冊表項值數據
- --reg-del Delete a Windows registry key value 刪除Windows注冊表鍵值
- --reg-key=REGKEY Windows registry key Windows注冊表鍵
- --reg-value=REGVAL Windows registry key value Windows注冊表項值
- --reg-data=REGDATA Windows registry key value data Windows注冊表鍵值數據
- --reg-type=REGTYPE Windows registry key value type Windows注冊表項值類型
- General(一般):
- These options can be used to set some general working parameters 這些選項可以用來設置一些一般的工作參數。
- -s SESSIONFILE Load session from a stored (.sqlite) file 保存和恢復檢索會話文件的所有數據
- -t TRAFFICFILE Log all HTTP traffic into a textual file 記錄所有HTTP流量到一個文本文件中
- --batch Never ask for user input, use the default behaviour 從不詢問用戶輸入,使用所有默認配置。
- --binary-fields=.. Result fields having binary values (e.g. "digest") 具有二進制值的結果字段
- --charset=CHARSET Force character encoding used for data retrieval 強制用於數據檢索的字符編碼
- --crawl=CRAWLDEPTH Crawl the website starting from the target URL 從目標網址開始抓取網站
- --crawl-exclude=.. Regexp to exclude pages from crawling (e.g. "logout") 正則表達式排除網頁抓取
- --csv-del=CSVDEL Delimiting character used in CSV output (default ",") 分隔CSV輸出中使用的字符
- --dump-format=DU.. Format of dumped data (CSV (default), HTML or SQLITE) 轉儲數據的格式
- --eta Display for each output the estimated time of arrival 顯示每個輸出的預計到達時間
- --flush-session Flush session files for current target 刷新當前目標的會話文件
- --forms Parse and test forms on target URL 在目標網址上解析和測試表單
- --fresh-queries Ignore query results stored in session file 忽略在會話文件中存儲的查詢結果
- --hex Use DBMS hex function(s) for data retrieval 使用DBMS hex函數進行數據檢索
- --output-dir=OUT.. Custom output directory path 自定義輸出目錄路徑
- --parse-errors Parse and display DBMS error messages from responses 解析和顯示響應中的DBMS錯誤消息
- --save=SAVECONFIG Save options to a configuration INI file 保存選項到INI配置文件
- --scope=SCOPE Regexp to filter targets from provided proxy log 使用正則表達式從提供的代理日志中過濾目標
- --test-filter=TE.. Select tests by payloads and/or titles (e.g. ROW) 根據有效負載和/或標題(e.g. ROW)選擇測試
- --test-skip=TEST.. Skip tests by payloads and/or titles (e.g. BENCHMARK) 根據有效負載和/或標題跳過測試(e.g. BENCHMARK)
- --update Update sqlmap 更新SqlMap
- Miscellaneous(雜項):
- -z MNEMONICS Use short mnemonics (e.g. "flu,bat,ban,tec=EU") 使用簡短的助記符
- --alert=ALERT Run host OS command(s) when SQL injection is found 在找到SQL注入時運行主機操作系統命令
- --answers=ANSWERS Set question answers (e.g. "quit=N,follow=N") 設置問題答案
- --beep Beep on question and/or when SQL injection is found 發現SQL注入時提醒
- --cleanup Clean up the DBMS from sqlmap specific UDF and tables SqlMap具體的UDF和表清理DBMS
- --dependencies Check for missing (non-core) sqlmap dependencies 檢查是否缺少(非內核)sqlmap依賴關系
- --disable-coloring Disable console output coloring 禁用控制台輸出顏色
- --gpage=GOOGLEPAGE Use Google dork results from specified page number 使用Google dork結果指定頁碼
- --identify-waf Make a thorough testing for a WAF/IPS/IDS protection 對WAF / IPS / IDS保護進行全面測試
- --skip-waf Skip heuristic detection of WAF/IPS/IDS protection 跳過啟發式檢測WAF / IPS / IDS保護
- --mobile Imitate smartphone through HTTP User-Agent header 通過HTTP User-Agent標頭模仿智能手機
- --offline Work in offline mode (only use session data) 在離線模式下工作(僅使用會話數據)
- --page-rank Display page rank (PR) for Google dork results Google dork結果顯示網頁排名(PR)
- --purge-output Safely remove all content from output directory 安全地從輸出目錄中刪除所有內容
- --smart Conduct thorough tests only if positive heuristic(s) 只有在正啟發式時才進行徹底測試
- --sqlmap-shell Prompt for an interactive sqlmap shell 提示交互式sqlmap shell
- --wizard Simple wizard interface for beginner users 給初級用戶的簡單向導界面
