0×00 python環(huán)境搭建
- a.下載
下載地址:https://www.python.org/downloads/ (這里推薦ptyhon2版本档礁,python3版本與sqlmap不兼容) - b.安裝
默認(rèn)路徑為C:\Python27,可更改至其他盤(pán) 如D:\Python27
根據(jù)提示“下一步”即可 -
c.配置環(huán)境變量
計(jì)算機(jī) --> 屬性 --> 高級(jí)系統(tǒng)設(shè)置 --> 環(huán)境變量 --> 系統(tǒng)變量 --> path中添加“D:\Python27”
- d.測(cè)試
cmd --> python 若返回python版本翠胰,則配置成功
0×01 sqlmap環(huán)境搭建
-
a.下載
下載地址:http://sqlmap.org/
-
b.配置
將上述下載的文件夾更名為"sqlmap",將sqlmap文件夾剪切至python文件夾中掸掸;
配置環(huán)境變量忽洛,同上python,path中添加“D:\Python27\sqlmap”
-
c.測(cè)試
cmd --sqlmap.py 若返回sqlmap版本袁稽,則配置成功
0×02 sqlmap手冊(cè)
Options:
-h, --help 顯示基本幫助信息
-hh 顯示高級(jí)幫助信息
--version 顯示版本號(hào)
-v VERBOSE 詳細(xì)級(jí)別:0-6(默認(rèn)為1).設(shè)置輸出信息的詳細(xì)程度
0:只顯示追蹤棧 ,錯(cuò)誤以及重要信息。1:還顯示信息和警告擒抛。2:顯示debug消息推汽。3:顯示注入payload。
4:顯示HTTP請(qǐng)求歧沪。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ù)庫(kù)的連接字符串。
-l LOGFILE 從Burp或WebScarab代理的日志中解析目標(biāo)
-x SITEMAPURL Parse target(s) from remote sitemap(.xml) file 從遠(yuǎn)程站點(diǎn)地圖文件(.xml)解析目標(biāo)(s)
-m BULKFILE Scan multiple targets given in a textual file 掃描文本文件中給出的多個(gè)目標(biāo)
-r REQUESTFILE Load HTTP request from a file 從文件加載HTTP請(qǐng)求
-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配置文件中加載選項(xiàng)诊胞。
Request:(用來(lái)指定如何連接到目標(biāo)url)
--method=METHOD Force usage of given HTTP method (e.g. PUT) 強(qiáng)制使用給定的HTTP方法(e.g. PUT)
--data=DATA Data string to be sent through POST 通過(guò)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 使用隨機(jī)選定的HTTP User - Agent頭
--host=HOST HTTP Host header value HTTP主機(jī)頭值
--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錯(cuò)誤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)證證書(shū)(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 檢查T(mén)or是否正確使用
--delay=DELAY Delay in seconds between each HTTP request 每個(gè)HTTP請(qǐng)求之間的延遲(秒)
--timeout=TIMEOUT Seconds to wait before timeout connection (default 30) 秒超時(shí)連接前等待(默認(rèn)30)
--retries=RETRIES Retries when the connection timeouts (default 3) 連接超時(shí)時(shí)重試(默認(rèn)值3)
--randomize=RPARAM Randomly change value for given parameter(s) 隨機(jī)更改給定參數(shù)的值(s)
--safe-url=SAFEURL URL address to visit frequently during testing 在測(cè)試期間頻繁訪問(wèn)的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請(qǐng)求
--safe-freq=SAFE.. Test requests between two visits to a given safe URL 在兩次訪問(wèn)給定安全網(wǎng)址之間測(cè)試請(qǐng)求
--skip-urlencode Skip URL encoding of payload data 跳過(guò)有效載荷數(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地址訪問(wèn)令牌
--force-ssl Force usage of SSL/HTTPS 強(qiáng)制使用SSL / HTTPS
--hpp Use HTTP parameter pollution method 使用HTTP參數(shù)pollution的方法
--eval=EVALCODE Evaluate provided Python code before the request (e.g. 評(píng)估請(qǐng)求之前提供Python代碼
"import hashlib;id2=hashlib.md5(id).hexdigest()")
Injection:(用來(lái)指定測(cè)試哪些參數(shù)暖夭, 提供自定義的注入payloads和可選篡改腳本)
-p TESTPARAMETER 可測(cè)試的參數(shù)(S)
--skip=SKIP Skip testing for given parameter(s) 跳過(guò)對(duì)給定參數(shù)的測(cè)試
--skip-static Skip testing parameters that not appear to be dynamic 跳過(guò)測(cè)試不顯示為動(dòng)態(tài)的參數(shù)
--param-exclude=.. Regexp to exclude parameters from testing (e.g. "ses") 使用正則表達(dá)式排除參數(shù)進(jìn)行測(cè)試(e.g. "ses")
--dbms=DBMS 強(qiáng)制后端的DBMS為此值
--dbms-cred=DBMS.. DBMS認(rèn)證憑證(user:password)
--os=OS 強(qiáng)制后端的DBMS操作系統(tǒng)為這個(gè)值
--invalid-bignum 使用大數(shù)字使值無(wú)效
--invalid-logical 使用邏輯操作使值無(wú)效
--invalid-string 使用隨機(jī)字符串使值無(wú)效
--no-cast Turn off payload casting mechanism 關(guān)閉有效載荷鑄造機(jī)制
--no-escape Turn off string escaping mechanism 關(guān)閉字符串轉(zhuǎn)義機(jī)制
--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:(自定義檢測(cè)階段--可以用來(lái)指定在sql盲注時(shí)如何解析和比較http響應(yīng)頁(yè)面的內(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注入測(cè)試)
--technique=TECH SQL注入技術(shù)測(cè)試(默認(rèn)BEUST)
--time-sec=TIMESEC DBMS響應(yīng)的延遲時(shí)間(默認(rèn)為5秒)
--union-cols=UCOLS Range of columns to test for UNION query SQL injection 定列范圍用于測(cè)試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 生成頁(yè)面的URL搜索為second-order響應(yīng)
Enumeration:(枚舉)
-a, --all Retrieve everything
-b, --banner Retrieve DBMS banner 檢索數(shù)據(jù)庫(kù)管理系統(tǒng)的標(biāo)識(shí)
--current-user Retrieve DBMS current user 檢索數(shù)據(jù)庫(kù)管理系統(tǒng)當(dāng)前用戶
--current-db Retrieve DBMS current database 檢索數(shù)據(jù)庫(kù)管理系統(tǒng)當(dāng)前數(shù)據(jù)庫(kù)
--hostname Retrieve DBMS server hostname
--is-dba Detect if the DBMS current user is DBA 檢測(cè)DBMS當(dāng)前用戶是否DBA
--users Enumerate DBMS users 枚舉數(shù)據(jù)庫(kù)管理系統(tǒng)所有的用戶
--passwords Enumerate DBMS users password hashes 枚舉數(shù)據(jù)庫(kù)管理系統(tǒng)用戶密碼哈希
--privileges Enumerate DBMS users privileges 枚舉數(shù)據(jù)庫(kù)管理系統(tǒng)用戶的權(quán)限
--roles Enumerate DBMS users roles 枚舉數(shù)據(jù)庫(kù)管理系統(tǒng)用戶的角色
--dbs Enumerate DBMS databases 枚舉數(shù)據(jù)庫(kù)管理系統(tǒng)所有數(shù)據(jù)庫(kù)
--tables Enumerate DBMS database tables 枚舉的DBMS數(shù)據(jù)庫(kù)中所有的表
--columns Enumerate DBMS database table columns 枚舉DBMS數(shù)據(jù)庫(kù)表所有的列
--schema Enumerate DBMS schema
--count Retrieve number of entries for table(s)
--dump Dump DBMS database table entries 轉(zhuǎn)儲(chǔ)數(shù)據(jù)庫(kù)管理系統(tǒng)的數(shù)據(jù)庫(kù)中的表項(xiàng)
--dump-all Dump all DBMS databases tables entries 轉(zhuǎn)儲(chǔ)所有的DBMS數(shù)據(jù)庫(kù)表中的條目
--search Search column(s), table(s) and/or database name(s) 搜索列(S)撵孤,表(S)和/或數(shù)據(jù)庫(kù)名稱(S)
--comments Retrieve DBMS comments
-D DB DBMS database to enumerate 要進(jìn)行枚舉的指定數(shù)據(jù)庫(kù)名
-T TBL DBMS database table(s) to enumerate 要進(jìn)行枚舉的指定數(shù)據(jù)庫(kù)表(如:-T tablename –columns)
-C COL DBMS database table column(s) to enumerate要進(jìn)行枚舉的數(shù)據(jù)庫(kù)列
-X EXCLUDECOL DBMS database table column(s) to not enumerate
-U USER DBMS user to enumerate 用來(lái)進(jìn)行枚舉的數(shù)據(jù)庫(kù)用戶
--exclude-sysdbs Exclude DBMS system databases when enumerating tables 枚舉表時(shí)排除系統(tǒng)數(shù)據(jù)庫(kù)
--pivot-column=P.. Pivot column name
--where=DUMPWHERE Use WHERE condition while table dumping
--start=LIMITSTART First query output entry to retrieve 第一個(gè)查詢輸出進(jìn)入檢索
--stop=LIMITSTOP Last query output entry to retrieve 最后查詢的輸出進(jìn)入檢索
--first=FIRSTCHAR First query output word character to retrieve 第一個(gè)查詢輸出字的字符檢索
--last=LASTCHAR Last query output word character to retrieve 最后查詢的輸出字字符檢索
--sql-query=QUERY SQL statement to be executed 要執(zhí)行的SQL語(yǔ)句
--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)訪問(wèn))
--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 獲取一個(gè)OOB shell迈着,meterpreter或VNC
--os-smbrelay One click prompt for an OOB shell, Meterpreter or VNC 一鍵獲取一個(gè)OOB shell,meterpreter或VNC
--os-bof Stored procedure buffer overflow exploitation 存儲(chǔ)過(guò)程緩沖區(qū)溢出利用
--priv-esc Database process user privilege escalation 數(shù)據(jù)庫(kù)進(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)程臨時(shí)文件目錄的絕對(duì)路徑
General:(設(shè)置一些一般的工作參數(shù))
-s SESSIONFILE Load session from a stored (.sqlite) file 保存和恢復(fù)檢索會(huì)話文件的所有數(shù)據(jù)
-t TRAFFICFILE Log all HTTP traffic into a textual file 記錄所有HTTP流量到一個(gè)文本文件中
--batch Never ask for user input, use the default behaviour 從不詢問(wèn)用戶輸入邪码,使用所有默認(rèn)配置裕菠。
--binary-fields=.. Result fields having binary values (e.g. "digest") 具有二進(jìn)制值的結(jié)果字段
--charset=CHARSET Force character encoding used for data retrieval 強(qiáng)制用于數(shù)據(jù)檢索的字符編碼
--crawl=CRAWLDEPTH Crawl the website starting from the target URL 從目標(biāo)網(wǎng)址開(kāi)始抓取網(wǎng)站
--crawl-exclude=.. Regexp to exclude pages from crawling (e.g. "logout") 正則表達(dá)式排除網(wǎng)頁(yè)抓取
--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)儲(chǔ)數(shù)據(jù)的格式
--eta Display for each output the estimated time of arrival 顯示每個(gè)輸出的預(yù)計(jì)到達(dá)時(shí)間
--flush-session Flush session files for current target 刷新當(dāng)前目標(biāo)的會(huì)話文件
--forms Parse and test forms on target URL 在目標(biāo)網(wǎng)址上解析和測(cè)試表單
--fresh-queries Ignore query results stored in session file 忽略在會(huì)話文件中存儲(chǔ)的查詢結(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錯(cuò)誤消息
--save=SAVECONFIG Save options to a configuration INI file 保存選項(xiàng)到INI配置文件
--scope=SCOPE Regexp to filter targets from provided proxy log 使用正則表達(dá)式從提供的代理日志中過(guò)濾目標(biāo)
--test-filter=TE.. Select tests by payloads and/or titles (e.g. ROW) 根據(jù)有效負(fù)載和/或標(biāo)題(e.g. ROW)選擇測(cè)試
--test-skip=TEST.. Skip tests by payloads and/or titles (e.g. BENCHMARK) 根據(jù)有效負(fù)載和/或標(biāo)題跳過(guò)測(cè)試(e.g. BENCHMARK)
--update Update sqlmap 更新SqlMap
Miscellaneous:(其他雜項(xiàng))
--z MNEMONICS Use short mnemonics (e.g. "flu,bat,ban,tec=EU") 使用簡(jiǎn)短的助記符
--alert=ALERT Run host OS command(s) when SQL injection is found 在找到SQL注入時(shí)運(yùn)行主機(jī)操作系統(tǒng)命令
--answers=ANSWERS Set question answers (e.g. "quit=N,follow=N") 設(shè)置問(wèn)題答案
--beep 發(fā)現(xiàn)SQL注入時(shí)提醒
--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 禁用控制臺(tái)輸出顏色
--gpage=GOOGLEPAGE Use Google dork results from specified page number 使用Google dork結(jié)果指定頁(yè)碼
--identify-waf Make a thorough testing for a WAF/IPS/IDS protection 對(duì)WAF / IPS / IDS保護(hù)進(jìn)行全面測(cè)試
--mobile Imitate smartphone through HTTP User-Agent header
--offline Work in offline mode (only use session data) 在離線模式下工作(僅使用會(huì)話數(shù)據(jù))
--purge-output Safely remove all content from output directory 安全地從輸出目錄中刪除所有內(nèi)容
--skip-waf Skip heuristic detection of WAF/IPS/IDS protection 跳過(guò)啟發(fā)式檢測(cè)WAF / IPS / IDS保護(hù)
--smart Conduct thorough tests only if positive heuristic(s) 只有在正啟發(fā)式時(shí)才進(jìn)行徹底測(cè)試
--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 給初級(jí)用戶的簡(jiǎn)單向?qū)Ы缑?
至此~~~
sqlmap的環(huán)境搭建以及手冊(cè)介紹完成啦~~
如有問(wèn)題,請(qǐng)您指教~~~