sqlmap之(一)----命令詳解


一、sqlmap命令介紹

 

sqlmap文檔地址:https://github.com/sqlmapproject/sqlmap/wiki/Usage

 

摘取了其中的命令參數格式如下

 

中英對照版:

 

[html]  view plain  copy
 
  1. Usage: python sqlmap.py [options]  
  2.   
  3. Options(選項):  
  4.   
  5.   -h, --help            Show basic help message and exit        顯示此幫助消息並退出  
  6.   -hh                   Show advanced help message and exit     展示先進的幫助信息並退出  
  7.   --version             Show program's version number and exit  顯示程序的版本號並退出  
  8.   -v VERBOSE            Verbosity level: 0-6 (default 1)        詳細級別:0-6(默認為1)   
  9.   
  10.   Target(目標):  
  11.   
  12.     At least one of these options has to be provided to define the    
  13.     target(s)  
  14.     以下至少需要設置其中一個選項,設置目標URL。  
  15.   
  16.     -d DIRECT           Connection string for direct database connection        直接連接到數據庫。  
  17.     -u URL, --url=URL   Target URL (e.g. "http://www.site.com/vuln.php?id=1")   目標URL。  
  18.     -l LOGFILE          Parse target(s) from Burp or WebScarab proxy log file   解析目標(s)從Burp或WebScarab代理日志文件  
  19.     -x SITEMAPURL       Parse target(s) from remote sitemap(.xml) file          解析目標(s)從遠程站點地圖文件(.xml)  
  20.     -m BULKFILE         Scan multiple targets given in a textual file           掃描文本文件中給出的多個目標  
  21.     -r REQUESTFILE      Load HTTP request from a file                           從文件加載HTTP請求  
  22.     -g GOOGLEDORK       Process Google dork results as target URLs              處理Google dork的結果作為目標URL。  
  23.     -c CONFIGFILE       Load options from a configuration INI file              從INI配置文件中加載選項。  
  24.   
  25.   Request(請求):  
  26.   
  27.     These options can be used to specify how to connect to the target URL   這些選項可以用來指定如何連接到目標URL。  
  28.   
  29.     --method=METHOD     Force usage of given HTTP method (e.g. PUT)          強制使用給定的HTTP方法(e.g. PUT)  
  30.     --data=DATA         Data string to be sent through POST                  通過POST發送的數據字符串  
  31.     --param-del=PARA..  Character used for splitting parameter values        用於拆分參數值的字符  
  32.     --cookie=COOKIE     HTTP Cookie header value                             HTTP Cookie頭的值  
  33.     --cookie-del=COO..  Character used for splitting cookie values           用於分割Cookie值的字符  
  34.     --load-cookies=L..  File containing cookies in Netscape/wget format      包含Netscape / wget格式的cookie的文件  
  35.     --drop-set-cookie   Ignore Set-Cookie header from response               從響應中忽略Set-Cookie頭  
  36.     --user-agent=AGENT  HTTP User-Agent header value                         指定 HTTP User - Agent頭    
  37.     --random-agent      Use randomly selected HTTP User-Agent header value   使用隨機選定的HTTP User - Agent頭   
  38.     --host=HOST         HTTP Host header value                                HTTP主機頭值  
  39.     --referer=REFERER   HTTP Referer header value                             指定 HTTP Referer頭  
  40.     -H HEADER, --hea..  Extra header (e.g. "X-Forwarded-For: 127.0.0.1")      額外header  
  41.     --headers=HEADERS   Extra headers (e.g. "Accept-Language: fr\nETag: 123") 額外header  
  42.     --auth-type=AUTH..  HTTP authentication type (Basic, Digest, NTLM or PKI) HTTP認證類型(Basic, Digest, NTLM or PKI)  
  43.     --auth-cred=AUTH..  HTTP authentication credentials (name:password)       HTTP認證憑證(name:password)  
  44.     --auth-file=AUTH..  HTTP authentication PEM cert/private key file         HTTP認證 PEM認證/私鑰文件  
  45.     --ignore-401        Ignore HTTP Error 401 (Unauthorized)                  忽略HTTP錯誤401(未經授權)  
  46.     --proxy=PROXY       Use a proxy to connect to the target URL              使用代理連接到目標網址  
  47.     --proxy-cred=PRO..  Proxy authentication credentials (name:password)      代理認證證書(name:password)   
  48.     --proxy-file=PRO..  Load proxy list from a file                           從文件中加載代理列表  
  49.     --ignore-proxy      Ignore system default proxy settings                  忽略系統默認代理設置  
  50.     --tor               Use Tor anonymity network                             使用Tor匿名網絡  
  51.     --tor-port=TORPORT  Set Tor proxy port other than default                 設置Tor代理端口而不是默認值  
  52.     --tor-type=TORTYPE  Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5) 設置Tor代理類型  
  53.     --check-tor         Check to see if Tor is used properly                  檢查Tor是否正確使用  
  54.     --delay=DELAY       Delay in seconds between each HTTP request             每個HTTP請求之間的延遲(秒)  
  55.     --timeout=TIMEOUT   Seconds to wait before timeout connection (default 30) 秒超時連接前等待(默認30)  
  56.     --retries=RETRIES   Retries when the connection timeouts (default 3)       連接超時時重試(默認值3)  
  57.     --randomize=RPARAM  Randomly change value for given parameter(s)           隨機更改給定參數的值(s)  
  58.     --safe-url=SAFEURL  URL address to visit frequently during testing         在測試期間頻繁訪問的URL地址  
  59.     --safe-post=SAFE..  POST data to send to a safe URL                        POST數據發送到安全URL  
  60.     --safe-req=SAFER..  Load safe HTTP request from a file                     從文件加載安全HTTP請求  
  61.     --safe-freq=SAFE..  Test requests between two visits to a given safe URL   在兩次訪問給定安全網址之間測試請求  
  62.     --skip-urlencode    Skip URL encoding of payload data                      跳過有效載荷數據的URL編碼  
  63.     --csrf-token=CSR..  Parameter used to hold anti-CSRF token                 參數用於保存anti-CSRF令牌  
  64.     --csrf-url=CSRFURL  URL address to visit to extract anti-CSRF token        提取anti-CSRF URL地址訪問令牌  
  65.     --force-ssl         Force usage of SSL/HTTPS                               強制使用SSL / HTTPS  
  66.     --hpp               Use HTTP parameter pollution method                    使用HTTP參數pollution的方法  
  67.     --eval=EVALCODE     Evaluate provided Python code before the request (e.g. 評估請求之前提供Python代碼  
  68.                         "import hashlib;id2=hashlib.md5(id).hexdigest()")  
  69.   
  70.   Optimization(優化):  
  71.   
  72.     These options can be used to optimize the performance of sqlmap    這些選項可用於優化sqlmap的性能  
  73.   
  74.     -o                  Turn on all optimization switches                        開啟所有優化開關  
  75.     --predict-output    Predict common queries output                            預測常見的查詢輸出  
  76.     --keep-alive        Use persistent HTTP(s) connections                       使用持久的HTTP(S)連接  
  77.     --null-connection   Retrieve page length without actual HTTP response body   從沒有實際的HTTP響應體中檢索頁面長度  
  78.     --threads=THREADS   Max number of concurrent HTTP(s) requests (default 1)    最大的HTTP(S)請求並發量(默認為1)  
  79.   
  80.   Injection(注入):  
  81.   
  82.     These options can be used to specify which parameters to test for,  
  83.     provide custom injection payloads and optional tampering scripts   
  84.     這些選項可以用來指定測試哪些參數, 提供自定義的注入payloads和可選篡改腳本。  
  85.   
  86.     -p TESTPARAMETER    Testable parameter(s)                                      可測試的參數(S)  
  87.     --skip=SKIP         Skip testing for given parameter(s)                        跳過對給定參數的測試  
  88.     --skip-static       Skip testing parameters that not appear to be dynamic      跳過測試不顯示為動態的參數  
  89.     --param-exclude=..  Regexp to exclude parameters from testing (e.g. "ses")     使用正則表達式排除參數進行測試(e.g. "ses")  
  90.     --dbms=DBMS         Force back-end DBMS to this value                          強制后端的DBMS為此值    
  91.     --dbms-cred=DBMS..  DBMS authentication credentials (user:password)            DBMS認證憑證(user:password)   
  92.     --os=OS             Force back-end DBMS operating system to this value         強制后端的DBMS操作系統為這個值  
  93.     --invalid-bignum    Use big numbers for invalidating values                    使用大數字使值無效  
  94.     --invalid-logical   Use logical operations for invalidating values             使用邏輯操作使值無效  
  95.     --invalid-string    Use random strings for invalidating values                 使用隨機字符串使值無效  
  96.     --no-cast           Turn off payload casting mechanism                         關閉有效載荷鑄造機制  
  97.     --no-escape         Turn off string escaping mechanism                         關閉字符串轉義機制  
  98.     --prefix=PREFIX     Injection payload prefix string                            注入payload字符串前綴  
  99.     --suffix=SUFFIX     Injection payload suffix string                            注入payload字符串后綴    
  100.     --tamper=TAMPER     Use given script(s) for tampering injection data           使用給定的腳本(S)篡改注入數據  
  101.   
  102.   Detection(檢測):  
  103.   
  104.     These options can be used to customize the detection phase 這些選項可以用來指定在SQL盲注時如何解析和比較HTTP響應頁面的內容。  
  105.   
  106.     --level=LEVEL       Level of tests to perform (1-5, default 1)          執行測試的等級(1-5,默認為1)  
  107.     --risk=RISK         Risk of tests to perform (1-3, default 1)           執行測試的風險(0-3,默認為1)  
  108.     --string=STRING     String to match when query is evaluated to True     查詢時有效時在頁面匹配字符串   
  109.     --not-string=NOT..  String to match when query is evaluated to False    當查詢求值為無效時匹配的字符串  
  110.     --regexp=REGEXP     Regexp to match when query is evaluated to True     查詢時有效時在頁面匹配正則表達式  
  111.     --code=CODE         HTTP code to match when query is evaluated to True  當查詢求值為True時匹配的HTTP代碼  
  112.     --text-only         Compare pages based only on the textual content     僅基於在文本內容比較網頁  
  113.     --titles            Compare pages based only on their titles            僅根據他們的標題進行比較  
  114.   
  115.   Techniques(技巧):  
  116.   
  117.     These options can be used to tweak testing of specific SQL injection  
  118.     techniques   
  119.     這些選項可用於調整具體的SQL注入測試。   
  120.   
  121.     --technique=TECH    SQL injection techniques to use (default "BEUSTQ")      SQL注入技術測試(默認BEUST)  
  122.     --time-sec=TIMESEC  Seconds to delay the DBMS response (default 5)          DBMS響應的延遲時間(默認為5秒)  
  123.     --union-cols=UCOLS  Range of columns to test for UNION query SQL injection  定列范圍用於測試UNION查詢注入  
  124.     --union-char=UCHAR  Character to use for bruteforcing number of columns     用於暴力猜解列數的字符  
  125.     --union-from=UFROM  Table to use in FROM part of UNION query SQL injection  要在UNION查詢SQL注入的FROM部分使用的表  
  126.     --dns-domain=DNS..  Domain name used for DNS exfiltration attack            域名用於DNS漏出攻擊  
  127.     --second-order=S..  Resulting page URL searched for second-order response   生成頁面的URL搜索為second-order響應  
  128.   
  129.   Fingerprint(指紋):  
  130.   
  131.     -f, --fingerprint   Perform an extensive DBMS version fingerprint           執行檢查廣泛的DBMS版本指紋  
  132.   
  133.   Enumeration(枚舉):  
  134.   
  135.     These options can be used to enumerate the back-end database  
  136.     management system information, structure and data contained in the  
  137.     tables. Moreover you can run your own SQL statements                    
  138.     這些選項可以用來列舉后端數據庫管理系統的信息、表中的結構和數據。此外,您還可以運行您自己的SQL語句。    
  139.   
  140.     -a, --all           Retrieve everything                             檢索一切  
  141.     -b, --banner        Retrieve DBMS banner                            檢索數據庫管理系統的標識    
  142.     --current-user      Retrieve DBMS current user                      檢索數據庫管理系統的標識    
  143.     --current-db        Retrieve DBMS current database                  檢索數據庫管理系統當前數據庫    
  144.     --hostname          Retrieve DBMS server hostname                   檢索數據庫服務器的主機名  
  145.     --is-dba            Detect if the DBMS current user is DBA          檢測DBMS當前用戶是否DBA    
  146.     --users             Enumerate DBMS users                            枚舉數據庫管理系統用戶  
  147.     --passwords         Enumerate DBMS users password hashes            枚舉數據庫管理系統用戶密碼哈希  
  148.     --privileges        Enumerate DBMS users privileges                 枚舉數據庫管理系統用戶的權限    
  149.     --roles             Enumerate DBMS users roles                      枚舉數據庫管理系統用戶的角色    
  150.     --dbs               Enumerate DBMS databases                        枚舉數據庫管理系統數據庫  
  151.     --tables            Enumerate DBMS database tables                  枚舉的DBMS數據庫中的表    
  152.     --columns           Enumerate DBMS database table columns           枚舉DBMS數據庫表列  
  153.     --schema            Enumerate DBMS schema                           枚舉數據庫架構  
  154.     --count             Retrieve number of entries for table(s)         檢索表的條目數  
  155.     --dump              Dump DBMS database table entries                轉儲數據庫管理系統的數據庫中的表項  
  156.     --dump-all          Dump all DBMS databases tables entries               轉儲數據庫管理系統的數據庫中的表項  
  157.     --search            Search column(s), table(s) and/or database name(s)   搜索列(S),表(S)和/或數據庫名稱(S)  
  158.     --comments          Retrieve DBMS comments                               檢索數據庫的comments(注釋、評論)  
  159.     -D DB               DBMS database to enumerate                           要進行枚舉的數據庫名   
  160.     -T TBL              DBMS database table(s) to enumerate                  要進行枚舉的數據庫表  
  161.     -C COL              DBMS database table column(s) to enumerate           要進行枚舉的數據庫列   
  162.     -X EXCLUDECOL       DBMS database table column(s) to not enumerate       要不進行枚舉的數據庫列   
  163.     -U USER             DBMS user to enumerate                               用來進行枚舉的數據庫用戶   
  164.     --exclude-sysdbs    Exclude DBMS system databases when enumerating tables   枚舉表時排除系統數據庫   
  165.     --pivot-column=P..  Pivot column name                                       主列名稱  
  166.     --where=DUMPWHERE   Use WHERE condition while table dumping                 使用WHERE條件進行表轉儲  
  167.     --start=LIMITSTART  First query output entry to retrieve                    第一個查詢輸出進入檢索  
  168.     --stop=LIMITSTOP    Last query output entry to retrieve                     最后查詢的輸出進入檢索  
  169.     --first=FIRSTCHAR   First query output word character to retrieve           第一個查詢輸出字的字符檢索   
  170.     --last=LASTCHAR     Last query output word character to retrieve            最后查詢的輸出字字符檢索   
  171.     --sql-query=QUERY   SQL statement to be executed                            要執行的SQL語句  
  172.     --sql-shell         Prompt for an interactive SQL shell                     提示交互式SQL的shell  
  173.     --sql-file=SQLFILE  Execute SQL statements from given file(s)               從給定文件執行SQL語句  
  174.   
  175.   Brute force(蠻力):  
  176.   
  177.     These options can be used to run brute force checks         這些選項可以被用來運行蠻力檢查。  
  178.   
  179.     --common-tables     Check existence of common tables        檢查存在共同表   
  180.     --common-columns    Check existence of common columns       檢查存在共同列  
  181.   
  182.   User-defined function injection(用戶自定義函數注入):  
  183.     These options can be used to create custom user-defined functions   這些選項可以用來創建用戶自定義函數。  
  184.   
  185.     --udf-inject        Inject custom user-defined functions        注入用戶自定義函數    
  186.     --shared-lib=SHLIB  Local path of the shared library            共享庫的本地路徑   
  187.   
  188.   File system access(訪問文件系統):  
  189.   
  190.     These options can be used to access the back-end database management        
  191.     system underlying file system  
  192.     這些選項可以被用來訪問后端數據庫管理系統的底層文件系統。  
  193.   
  194.     --file-read=RFILE   Read a file from the back-end DBMS file system        從后端的數據庫管理系統文件系統讀取文件    
  195.     --file-write=WFILE  Write a local file on the back-end DBMS file system   編輯后端的數據庫管理系統文件系統上的本地文件  
  196.     --file-dest=DFILE   Back-end DBMS absolute filepath to write to           后端的數據庫管理系統寫入文件的絕對路徑  
  197.   
  198.   Operating system access(操作系統訪問):  
  199.   
  200.     These options can be used to access the back-end database management  
  201.     system underlying operating system    
  202.     這些選項可以用於訪問后端數據庫管理系統的底層操作系統。  
  203.   
  204.     --os-cmd=OSCMD      Execute an operating system command                     執行操作系統命令   
  205.     --os-shell          Prompt for an interactive operating system shell        交互式的操作系統的shell  
  206.     --os-pwn            Prompt for an OOB shell, Meterpreter or VNC             獲取一個OOB shell,meterpreter或VNC   
  207.     --os-smbrelay       One click prompt for an OOB shell, Meterpreter or VNC   一鍵獲取一個OOB shell,meterpreter或VNC   
  208.     --os-bof            Stored procedure buffer overflow exploitation           存儲過程緩沖區溢出利用  
  209.     --priv-esc          Database process user privilege escalation              數據庫進程用戶權限提升  
  210.     --msf-path=MSFPATH  Local path where Metasploit Framework is installed      Metasploit Framework本地的安裝路徑  
  211.     --tmp-path=TMPPATH  Remote absolute path of temporary files directory       遠程臨時文件目錄的絕對路徑  
  212.   
  213.   Windows registry access(Windows注冊表訪問):  
  214.   
  215.     These options can be used to access the back-end database management  
  216.     system Windows registry       
  217.     這些選項可以被用來訪問后端數據庫管理系統Windows注冊表。  
  218.   
  219.     --reg-read          Read a Windows registry key value           讀一個Windows注冊表項值  
  220.     --reg-add           Write a Windows registry key value data     寫一個Windows注冊表項值數據  
  221.     --reg-del           Delete a Windows registry key value         刪除Windows注冊表鍵值  
  222.     --reg-key=REGKEY    Windows registry key                        Windows注冊表鍵   
  223.     --reg-value=REGVAL  Windows registry key value                  Windows注冊表項值   
  224.     --reg-data=REGDATA  Windows registry key value data             Windows注冊表鍵值數據    
  225.     --reg-type=REGTYPE  Windows registry key value type             Windows注冊表項值類型  
  226.   
  227.   General(一般):  
  228.   
  229.     These options can be used to set some general working parameters    這些選項可以用來設置一些一般的工作參數。   
  230.    
  231.     -s SESSIONFILE      Load session from a stored (.sqlite) file                   保存和恢復檢索會話文件的所有數據  
  232.     -t TRAFFICFILE      Log all HTTP traffic into a textual file                    記錄所有HTTP流量到一個文本文件中  
  233.     --batch             Never ask for user input, use the default behaviour         從不詢問用戶輸入,使用所有默認配置。   
  234.     --binary-fields=..  Result fields having binary values (e.g. "digest")          具有二進制值的結果字段  
  235.     --charset=CHARSET   Force character encoding used for data retrieval            強制用於數據檢索的字符編碼  
  236.     --crawl=CRAWLDEPTH  Crawl the website starting from the target URL              從目標網址開始抓取網站  
  237.     --crawl-exclude=..  Regexp to exclude pages from crawling (e.g. "logout")       正則表達式排除網頁抓取  
  238.     --csv-del=CSVDEL    Delimiting character used in CSV output (default ",")       分隔CSV輸出中使用的字符  
  239.     --dump-format=DU..  Format of dumped data (CSV (default), HTML or SQLITE)       轉儲數據的格式  
  240.     --eta               Display for each output the estimated time of arrival       顯示每個輸出的預計到達時間  
  241.     --flush-session     Flush session files for current target                      刷新當前目標的會話文件  
  242.     --forms             Parse and test forms on target URL                          在目標網址上解析和測試表單  
  243.     --fresh-queries     Ignore query results stored in session file                 忽略在會話文件中存儲的查詢結果  
  244.     --hex               Use DBMS hex function(s) for data retrieval                 使用DBMS hex函數進行數據檢索  
  245.     --output-dir=OUT..  Custom output directory path                                自定義輸出目錄路徑  
  246.     --parse-errors      Parse and display DBMS error messages from responses        解析和顯示響應中的DBMS錯誤消息  
  247.     --save=SAVECONFIG   Save options to a configuration INI file                    保存選項到INI配置文件  
  248.     --scope=SCOPE       Regexp to filter targets from provided proxy log            使用正則表達式從提供的代理日志中過濾目標  
  249.     --test-filter=TE..  Select tests by payloads and/or titles (e.g. ROW)           根據有效負載和/或標題(e.g. ROW)選擇測試  
  250.     --test-skip=TEST..  Skip tests by payloads and/or titles (e.g. BENCHMARK)       根據有效負載和/或標題跳過測試(e.g. BENCHMARK)  
  251.     --update            Update sqlmap                                                更新SqlMap  
  252.   
  253.   Miscellaneous(雜項):  
  254.   
  255.     -z MNEMONICS        Use short mnemonics (e.g. "flu,bat,ban,tec=EU")         使用簡短的助記符  
  256.     --alert=ALERT       Run host OS command(s) when SQL injection is found      在找到SQL注入時運行主機操作系統命令  
  257.     --answers=ANSWERS   Set question answers (e.g. "quit=N,follow=N")           設置問題答案  
  258.     --beep              Beep on question and/or when SQL injection is found     發現SQL注入時提醒  
  259.     --cleanup           Clean up the DBMS from sqlmap specific UDF and tables   SqlMap具體的UDF和表清理DBMS   
  260.     --dependencies      Check for missing (non-core) sqlmap dependencies        檢查是否缺少(非內核)sqlmap依賴關系  
  261.     --disable-coloring  Disable console output coloring                         禁用控制台輸出顏色  
  262.     --gpage=GOOGLEPAGE  Use Google dork results from specified page number      使用Google dork結果指定頁碼  
  263.     --identify-waf      Make a thorough testing for a WAF/IPS/IDS protection    對WAF / IPS / IDS保護進行全面測試  
  264.     --skip-waf          Skip heuristic detection of WAF/IPS/IDS protection      跳過啟發式檢測WAF / IPS / IDS保護  
  265.     --mobile            Imitate smartphone through HTTP User-Agent header       通過HTTP User-Agent標頭模仿智能手機  
  266.     --offline           Work in offline mode (only use session data)            在離線模式下工作(僅使用會話數據)  
  267.     --page-rank         Display page rank (PR) for Google dork results          Google dork結果顯示網頁排名(PR)  
  268.     --purge-output      Safely remove all content from output directory         安全地從輸出目錄中刪除所有內容  
  269.     --smart             Conduct thorough tests only if positive heuristic(s)    只有在正啟發式時才進行徹底測試  
  270.     --sqlmap-shell      Prompt for an interactive sqlmap shell                  提示交互式sqlmap shell  
  271.     --wizard            Simple wizard interface for beginner users              給初級用戶的簡單向導界面  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM