sqlmap常用參數(shù)及示例
共 2604字,需瀏覽 6分鐘
·
2024-06-30 08:30
關注開源優(yōu)測不迷路
目標設定
- -d: 針對一個數(shù)據庫管理系統(tǒng)的用戶提供的 SQL 語句。
sqlmap -d "mssql://sa:password@localhost/DataBase?driver=SQL+Server"
-r: 從一個文件中讀取 HTTP 請求。sqlmap -r request.txt
測試范圍和選項
-u: 目標 URL。sqlmap -u "http://example.com/index.php?id=1"--risk: 設置測試的風險等級(1-3)。sqlmap -u "http://example.com/index.php?id=1" --risk=3-level: 設置測試的技術水平(1-5)。sqlmap -u "http://example.com/index.php?id=1" --level=2
配置選項
--dbms: 指定后端數(shù)據庫的類型(如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"
性能選項
--delay: 兩次請求之間的延遲時間。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: 強制使用布爾盲注。sqlmap -u "http://example.com/index.php?id=1" --bool
數(shù)據獲取
-D: 指定數(shù)據庫名稱。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
操作選項
--dump: 轉儲數(shù)據庫表的內容。sqlmap -u "http://example.com/index.php?id=1" --dump--file-read: 從數(shù)據庫中讀取文件。sqlmap -u "http://example.com/index.php?id=1" --file-read="path/to/your/file"
其他
-v: 詳細模式,顯示更多信息。sqlmap -u "http://example.com/index.php?id=1" -v-h: 顯示幫助信息。sqlmap -h
