sqlmap搭建&手冊

0×00 python環(huán)境搭建

  • a.下載
    下載地址:https://www.python.org/downloads/ (這里推薦ptyhon2版本,python3版本與sqlmap不兼容)
  • b.安裝
    默認(rèn)路徑為C:\Python27,可更改至其他盤 如D:\Python27
    根據(jù)提示“下一步”即可
  • c.配置環(huán)境變量
    計算機 --> 屬性 --> 高級系統(tǒng)設(shè)置 --> 環(huán)境變量 --> 系統(tǒng)變量 --> path中添加“D:\Python27”


  • d.測試
    cmd --> python 若返回python版本,則配置成功

0×01 sqlmap環(huán)境搭建

  • a.下載
    下載地址:http://sqlmap.org/

  • b.配置
    將上述下載的文件夾更名為"sqlmap",將sqlmap文件夾剪切至python文件夾中;


配置環(huán)境變量,同上python,path中添加“D:\Python27\sqlmap”

  • c.測試
    cmd --sqlmap.py 若返回sqlmap版本,則配置成功


0×02 sqlmap手冊

Options:
 -h, --help            顯示基本幫助信息
 -hh                   顯示高級幫助信息
 --version             顯示版本號
 -v VERBOSE            詳細(xì)級別:0-6(默認(rèn)為1).設(shè)置輸出信息的詳細(xì)程度
                    0:只顯示追蹤棧 ,錯誤以及重要信息。1:還顯示信息和警告。2:顯示debug消息。3:顯示注入payload。
                    4:顯示HTTP請求。5:顯示HTTP響應(yīng)頭。6:顯示HTTP響應(yīng)內(nèi)容
Target:(至少需要一種提供給url)
-u URL, --url=URL   Target URL (e.g. "http://www.site.com/vuln.php?id=1")
-g GOOGLEDORK       Process Google dork results as target URLs
-d DIRECT           直接連接到數(shù)據(jù)庫的連接字符串。
-l LOGFILE          從Burp或WebScarab代理的日志中解析目標(biāo)
-x SITEMAPURL       Parse target(s) from remote sitemap(.xml) file           從遠(yuǎn)程站點地圖文件(.xml)解析目標(biāo)(s)
-m BULKFILE         Scan multiple targets given in a textual file            掃描文本文件中給出的多個目標(biāo)  
-r REQUESTFILE      Load HTTP request from a file                            從文件加載HTTP請求  
-g GOOGLEDORK       Process Google dork results as target URLs               處理Google dork的結(jié)果作為目標(biāo)URL
-c CONFIGFILE       Load options from a configuration INI file               從INI配置文件中加載選項。  
Request:(用來指定如何連接到目標(biāo)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發(fā)送的數(shù)據(jù)字符串  
--param-del=PARA..  Character used for splitting parameter values             用于拆分參數(shù)值的字符  
--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                    從響應(yīng)中忽略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認(rèn)證類型(Basic, Digest, NTLM or PKI) 
--auth-cred=AUTH..  HTTP authentication credentials (name:password)           HTTP認(rèn)證憑證(name:password)  
--auth-file=AUTH..  HTTP authentication PEM cert/private key file             HTTP認(rèn)證 PEM認(rèn)證/私鑰文件  
--ignore-401        Ignore HTTP Error 401 (Unauthorized)                      忽略HTTP錯誤401(未經(jīng)授權(quán))  
--ignore-proxy      Ignore system default proxy settings                      忽略系統(tǒng)默認(rèn)代理設(shè)置 
--ignore-redirects  Ignore redirection attempts
--ignore-timeouts   Ignore connection timeouts
--proxy=PROXY       Use a proxy to connect to the target URL                  使用代理連接到目標(biāo)網(wǎng)址  
--proxy-cred=PRO..  Proxy authentication credentials (name:password)          代理認(rèn)證證書(name:password)   
--proxy-file=PRO..  Load proxy list from a file                               從文件中加載代理列表  
--tor               Use Tor anonymity network                                 使用Tor匿名網(wǎng)絡(luò)  
--tor-port=TORPORT  Set Tor proxy port other than default                     設(shè)置Tor代理端口而不是默認(rèn)值  
--tor-type=TORTYPE  Set Tor proxy type (HTTP, SOCKS4 or SOCKS5 (default))     設(shè)置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)    秒超時連接前等待(默認(rèn)30) 
--retries=RETRIES   Retries when the connection timeouts (default 3)          連接超時時重試(默認(rèn)值3)
--randomize=RPARAM  Randomly change value for given parameter(s)              隨機更改給定參數(shù)的值(s) 
--safe-url=SAFEURL  URL address to visit frequently during testing            在測試期間頻繁訪問的URL地址 
--safe-post=SAFE..  POST data to send to a safe URL                           POST數(shù)據(jù)發(fā)送到安全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      在兩次訪問給定安全網(wǎng)址之間測試請求
--skip-urlencode    Skip URL encoding of payload data                         跳過有效載荷數(shù)據(jù)的URL編碼  
--csrf-token=CSR..  Parameter used to hold anti-CSRF token                    參數(shù)用于保存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參數(shù)pollution的方法 
--eval=EVALCODE     Evaluate provided Python code before the request (e.g.    評估請求之前提供Python代碼  
                    "import hashlib;id2=hashlib.md5(id).hexdigest()")
Injection:(用來指定測試哪些參數(shù), 提供自定義的注入payloads和可選篡改腳本)
-p TESTPARAMETER    可測試的參數(shù)(S)
--skip=SKIP         Skip testing for given parameter(s)    跳過對給定參數(shù)的測試  
--skip-static       Skip testing parameters that not appear to be dynamic    跳過測試不顯示為動態(tài)的參數(shù)  
--param-exclude=..  Regexp to exclude parameters from testing (e.g. "ses")    使用正則表達(dá)式排除參數(shù)進(jìn)行測試(e.g. "ses")
--dbms=DBMS         強制后端的DBMS為此值
--dbms-cred=DBMS..  DBMS認(rèn)證憑證(user:password)   
--os=OS             強制后端的DBMS操作系統(tǒng)為這個值
--invalid-bignum    使用大數(shù)字使值無效  
--invalid-logical   使用邏輯操作使值無效  
--invalid-string    使用隨機字符串使值無效  
--no-cast           Turn off payload casting mechanism    關(guān)閉有效載荷鑄造機制  
--no-escape         Turn off string escaping mechanism    關(guān)閉字符串轉(zhuǎn)義機制  
--prefix=PREFIX     注入payload字符串前綴
--suffix=SUFFIX     注入payload字符串后綴
--tamper=TAMPER     使用給定的腳本(S)篡改注入數(shù)據(jù)
Brute force(野蠻、蠻力):
--common-tables     Check existence of common tables     檢查存在共同表
--common-columns    Check existence of common columns    檢查存在共同列
Detection:(自定義檢測階段--可以用來指定在sql盲注時如何解析和比較http響應(yīng)頁面的內(nèi)容)
--level=LEVEL       Level of tests to perform (1-5, default 1)
--risk=RISK         Risk of tests to perform (1-3, default 1)
Techniques:(調(diào)整具體sql注入測試)
   --technique=TECH    SQL注入技術(shù)測試(默認(rèn)BEUST)
--time-sec=TIMESEC  DBMS響應(yīng)的延遲時間(默認(rèn)為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       用于暴力猜解列數(shù)的字符  
--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響應(yīng)  
Enumeration:(枚舉)
  -a, --all           Retrieve everything
-b, --banner        Retrieve DBMS banner                      檢索數(shù)據(jù)庫管理系統(tǒng)的標(biāo)識
--current-user      Retrieve DBMS current user                檢索數(shù)據(jù)庫管理系統(tǒng)當(dāng)前用戶
--current-db        Retrieve DBMS current database            檢索數(shù)據(jù)庫管理系統(tǒng)當(dāng)前數(shù)據(jù)庫
--hostname          Retrieve DBMS server hostname
--is-dba            Detect if the DBMS current user is DBA    檢測DBMS當(dāng)前用戶是否DBA
--users             Enumerate DBMS users                      枚舉數(shù)據(jù)庫管理系統(tǒng)所有的用戶
--passwords         Enumerate DBMS users password hashes      枚舉數(shù)據(jù)庫管理系統(tǒng)用戶密碼哈希
--privileges        Enumerate DBMS users privileges           枚舉數(shù)據(jù)庫管理系統(tǒng)用戶的權(quán)限
--roles             Enumerate DBMS users roles                枚舉數(shù)據(jù)庫管理系統(tǒng)用戶的角色
--dbs               Enumerate DBMS databases                  枚舉數(shù)據(jù)庫管理系統(tǒng)所有數(shù)據(jù)庫
--tables            Enumerate DBMS database tables            枚舉的DBMS數(shù)據(jù)庫中所有的表
--columns           Enumerate DBMS database table columns     枚舉DBMS數(shù)據(jù)庫表所有的列
--schema            Enumerate DBMS schema
--count             Retrieve number of entries for table(s)
--dump              Dump DBMS database table entries          轉(zhuǎn)儲數(shù)據(jù)庫管理系統(tǒng)的數(shù)據(jù)庫中的表項
--dump-all          Dump all DBMS databases tables entries    轉(zhuǎn)儲所有的DBMS數(shù)據(jù)庫表中的條目
--search            Search column(s), table(s) and/or database name(s)    搜索列(S),表(S)和/或數(shù)據(jù)庫名稱(S)
--comments          Retrieve DBMS comments
-D DB               DBMS database to enumerate                要進(jìn)行枚舉的指定數(shù)據(jù)庫名
-T TBL              DBMS database table(s) to enumerate       要進(jìn)行枚舉的指定數(shù)據(jù)庫表(如:-T tablename –columns)
-C COL              DBMS database table column(s) to enumerate要進(jìn)行枚舉的數(shù)據(jù)庫列
-X EXCLUDECOL       DBMS database table column(s) to not enumerate
-U USER             DBMS user to enumerate                    用來進(jìn)行枚舉的數(shù)據(jù)庫用戶
--exclude-sysdbs    Exclude DBMS system databases when enumerating tables 枚舉表時排除系統(tǒng)數(shù)據(jù)庫
--pivot-column=P..  Pivot column name
--where=DUMPWHERE   Use WHERE condition while table dumping
--start=LIMITSTART  First query output entry to retrieve      第一個查詢輸出進(jìn)入檢索
--stop=LIMITSTOP    Last query output entry to retrieve       最后查詢的輸出進(jìn)入檢索
--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                   要執(zhí)行的SQL語句
--sql-shell         Prompt for an interactive SQL shell            提示交互式SQL的shell
--sql-file=SQLFILE  Execute SQL statements from given file(s)
Operating system access:(操作系統(tǒng)訪問)
   --os-cmd=OSCMD      執(zhí)行操作系統(tǒng)命令
--os-shell          Prompt for an interactive operating system shell       交互式的操作系統(tǒng)的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          存儲過程緩沖區(qū)溢出利用
--priv-esc          Database process user privilege escalation             數(shù)據(jù)庫進(jìn)程用戶權(quán)限提升
--msf-path=MSFPATH  Local path where Metasploit Framework is installed     Metasploit Framework本地的安裝路徑
--tmp-path=TMPPATH  Remote absolute path of temporary files directory      遠(yuǎn)程臨時文件目錄的絕對路徑
General:(設(shè)置一些一般的工作參數(shù))
-s SESSIONFILE      Load session from a stored (.sqlite) file               保存和恢復(fù)檢索會話文件的所有數(shù)據(jù)  
-t TRAFFICFILE      Log all HTTP traffic into a textual file                記錄所有HTTP流量到一個文本文件中  
--batch             Never ask for user input, use the default behaviour     從不詢問用戶輸入,使用所有默認(rèn)配置。
--binary-fields=..  Result fields having binary values (e.g. "digest")      具有二進(jìn)制值的結(jié)果字段  
--charset=CHARSET   Force character encoding used for data retrieval        強制用于數(shù)據(jù)檢索的字符編碼
--crawl=CRAWLDEPTH  Crawl the website starting from the target URL          從目標(biāo)網(wǎng)址開始抓取網(wǎng)站
--crawl-exclude=..  Regexp to exclude pages from crawling (e.g. "logout")   正則表達(dá)式排除網(wǎng)頁抓取 
--csv-del=CSVDEL    Delimiting character used in CSV output (default ",")   分隔CSV輸出中使用的字符
--dump-format=DU..  Format of dumped data (CSV (default), HTML or SQLITE)   轉(zhuǎn)儲數(shù)據(jù)的格式
--eta               Display for each output the estimated time of arrival   顯示每個輸出的預(yù)計到達(dá)時間
--flush-session     Flush session files for current target                  刷新當(dāng)前目標(biāo)的會話文件  
--forms             Parse and test forms on target URL                      在目標(biāo)網(wǎng)址上解析和測試表單
--fresh-queries     Ignore query results stored in session file             忽略在會話文件中存儲的查詢結(jié)果
--hex               Use DBMS hex function(s) for data retrieval             使用DBMS hex函數(shù)進(jìn)行數(shù)據(jù)檢索  
--output-dir=OUT..  Custom output directory path                            自定義輸出目錄路徑  
--parse-errors      Parse and display DBMS error messages from responses    解析和顯示響應(yīng)中的DBMS錯誤消息
--save=SAVECONFIG   Save options to a configuration INI file                保存選項到INI配置文件  
--scope=SCOPE       Regexp to filter targets from provided proxy log        使用正則表達(dá)式從提供的代理日志中過濾目標(biāo)
--test-filter=TE..  Select tests by payloads and/or titles (e.g. ROW)       根據(jù)有效負(fù)載和/或標(biāo)題(e.g. ROW)選擇測試
--test-skip=TEST..  Skip tests by payloads and/or titles (e.g. BENCHMARK)   根據(jù)有效負(fù)載和/或標(biāo)題跳過測試(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注入時運行主機操作系統(tǒng)命令 
--answers=ANSWERS   Set question answers (e.g. "quit=N,follow=N")            設(shè)置問題答案  
--beep              發(fā)現(xiàn)SQL注入時提醒
--cleanup           Clean up the DBMS from sqlmap specific UDF and tables    SqlMap具體的UDF和表清理DBMS 
--dependencies      Check for missing (non-core) sqlmap dependencies         檢查是否缺少(非內(nèi)核)sqlmap依賴關(guān)系
--disable-coloring  Disable console output coloring                          禁用控制臺輸出顏色 
--gpage=GOOGLEPAGE  Use Google dork results from specified page number       使用Google dork結(jié)果指定頁碼  
--identify-waf      Make a thorough testing for a WAF/IPS/IDS protection     對WAF / IPS / IDS保護(hù)進(jìn)行全面測試  
--mobile            Imitate smartphone through HTTP User-Agent header 
--offline           Work in offline mode (only use session data)             在離線模式下工作(僅使用會話數(shù)據(jù))  
--purge-output      Safely remove all content from output directory          安全地從輸出目錄中刪除所有內(nèi)容  
--skip-waf          Skip heuristic detection of WAF/IPS/IDS protection       跳過啟發(fā)式檢測WAF / IPS / IDS保護(hù) 
--smart             Conduct thorough tests only if positive heuristic(s)     只有在正啟發(fā)式時才進(jìn)行徹底測試  
--sqlmap-shell      Prompt for an interactive sqlmap shell
--tmp-dir=TMPDIR    Local directory for storing temporary files
--web-root=WEBROOT  Web server document root directory (e.g. "/var/www")
--wizard            Simple wizard interface for beginner users               給初級用戶的簡單向?qū)Ы缑?

至此~~~
sqlmap的環(huán)境搭建以及手冊介紹完成啦~~
如有問題,請您指教~~~

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • http://192.168.136.131/sqlmap/mysql/get_int.php?id=1 當(dāng)給sq...
    xuningbo閱讀 10,559評論 2 22
  • sqlmap用戶手冊 說明:本文為轉(zhuǎn)載,對原文中一些明顯的拼寫錯誤進(jìn)行修正,并標(biāo)注對自己有用的信息。 ======...
    wind_飄閱讀 2,205評論 0 5
  • sqlmap也是滲透中常用的一個注入工具,其實在注入工具方面,一個sqlmap就足夠用了,只要你用的熟,秒殺各種工...
    linkally閱讀 7,196評論 1 40
  • SQLMAP作用 判斷可注入的參數(shù) 判斷可以用哪種SQL注入技術(shù)來注入 識別出哪種數(shù)據(jù)庫 根據(jù)用戶選擇,讀取哪些數(shù)...
    陸灑脫閱讀 3,805評論 1 4
  • 001/幸福的定義 幾年前有一個視頻:記者追問著路人:“你幸福嗎”?幸福和快樂是一對雙胞胎,當(dāng)你快樂,你會覺得幸福...
    琳娜911閱讀 243評論 0 1

友情鏈接更多精彩內(nèi)容