Giter Club home page Giter Club logo

struts-scan's Introduction

struts-scan

快速检测struts命令执行漏洞,可批量。

运行环境

MAC/Linux下的Python2

支持对以下版本的检测

ST2-005

ST2-008

ST2-009

ST2-013

ST2-016

ST2-019

ST2-020

ST2-devmode

ST2-032

ST2-033

ST2-037

ST2-045

ST2-046

ST2-048

ST2-052

ST2-053

ST2-057

使用

image

image

增加

[+]针对各版本的shell命令交互

[+]struts2-052检测(利用后面会加上)

[+]struts2-053检测+利用(需要提供参数)

[+]检测过程中输出超时原因

[+]兼容HTTP/1.0,修复了struts-045检测不准确的问题

[+]struts2-046检测+利用

[+]修改struts2-048的payload

[+]针对某些超时的情况,注释掉 httplib.HTTPConnection._http_vsn = 10 和httplib.HTTPConnection._http_vsn_str = 'HTTP/1.0'这两行再测试一遍,因为有的可能不支持HTTP/1.0的协议。

[+]增加linux和win的可执行文件,windows需要.NET环境。

[+]增加写入文件功能,针对有漏洞的struts版本号会自动写入success.txt文件。

[+]增加struts2-057检测和利用,生产环境还没有找到可利用的例子,实属鸡肋的洞,参考https://github.com/Ivan1ee/struts2-057-exp

特别说明

此工具仅限于漏洞验证,如若使用者引起相关的法律责任请自负,开发者不承担连带责任。

struts-scan's People

Contributors

lucifer1993 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

struts-scan's Issues

扫描优化建议

建议使用click或者其他库优化命令行;整个程序的所有struts漏洞的验证和批量扫描全部是单线程操作,若超时严重会很浪费时间,建议使用多线程优化,有空我自己也优化一下^_^

参数怎么赋值

比如s2-053检测 命令是这样的吗?
example:
struts-scan.exe+url+username=admin

struts2-057 的 surl 和 rurl 拼接有点不对?

老铁,这里是不是有点问题:
struts-scan.py 的 534 和 535
surl = self.url[self.url.rfind('/')::]
rurl = self.url.replace(surl, "") + self.shell["struts2-057-1"].replace("FUZZINGCOMMAND", command) + surl
print 出来(目标是 192.168.1.1:80) :
surl 是 /192.168.1.1:80
rurl 是 http://%24%7B%28%23_memberAccess%3D@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS%29.%28%23w%3D%23context.get%28%22com.opensymphony.xwork2.dispatcher.HttpServletResponse%22%29.getWriter%28%29%29.%28%23w.print%28@org.apache.commons.io.IOUtils@toString%28@java.lang.Runtime@getRuntime%28%29.exec%28%27netstat -an%27%29.getInputStream%28%29%29%29%29.%28%23w.close%28%29%29%7D/172.16.16.13:80

017的检测遇到误报了

我看代码是:
req = requests.get(self.url+'/?redirect:https://www.baidu.com/%23', timeout=TMOUT, verify=False)
if req.status_code == 302:
cprint("目标存在struts2-017漏洞..(只提供检测)", "red")
filecontent.writelines("struts2-017 success!!!\n")

然后公网上很多服务器,无论对什么请求都返回 302 重定向到 baidu ....

HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Wed, 15 Apr 2020 07:44:12 GMT
Content-Type: text/html
Content-Length: 154
Connection: keep-alive
Location: http://www.baidu.com/

S009, S013, S032, S037

Does S009, S013, S032, S037 vulnerabilities work¿? Because the other ones are scanned and identified correctly but those I told you, have you found any struts vulnerable to those ones¿? Thanks

052和053

话说052和053出来有段日子,也有exp了,大佬抽空可以加上唉~

请问超时是什么原因

检测struts2漏洞--------
目标url:http://119.254.9.210/channel/doChannelList.action
检测struts2-005超时..
超时原因: HTTPConnectionPool(host='119.254.9.210', port=80): Max retries exceeded with url: /channel/doChannelList.action (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x191a790>, 'Connection to 119.254.9.210 timed out. (connect timeout=6)'))
检测struts2-009超时..
超时原因: HTTPConnectionPool(host='119.254.9.210', port=80): Max retries exceeded with url: /channel/doChannelList.action (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x191afd0>, 'Connection to 119.254.9.210 timed out. (connect timeout=6)'))
检测struts2-013超时..
超时原因: HTTPConnectionPool(host='119.254.9.210', port=80): Max retries exceeded with url: /channel/doChannelList.action (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x191af50>, 'Connection to 119.254.9.210 timed out. (connect timeout=6)'))
检测struts2-016超时..
超时原因: HTTPConnectionPool(host='119.254.9.210', port=80): Max retries exceeded with url: /channel/doChannelList.action (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x191a6d0>, 'Connection to 119.254.9.210 timed out. (connect timeout=6)'))
检测struts2-019超时..
超时原因: HTTPConnectionPool(host='119.254.9.210', port=80): Max retries exceeded with url: /channel/doChannelList.action (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x191af10>, 'Connection to 119.254.9.210 timed out. (connect timeout=6)'))
检测struts2-devmode超时..

thx

整理的不错,一些小细节可以优化下,url的拼接方面urlparse.urljoin更加严谨点,避免一些漏扫,命令执行测试可以用set /a 654321 * 789 && expr 654321 * 789 || echo,简化check函数;006的可以加上去

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.