-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add springboot-eureka-xstream-rce environment
- Loading branch information
Showing
6 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.example</groupId> | ||
<artifactId>springboot-eureka-xstream-rce</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<java.version>1.8</java.version> | ||
<springboot.version>1.4.7.RELEASE</springboot.version> | ||
<netflix.eureka.version>1.4.0.RELEASE</netflix.eureka.version> | ||
|
||
<spring-cloud-commons.version>1.1.3.RELEASE</spring-cloud-commons.version> | ||
<spring-cloud-netflix.version>1.2.0.RELEASE</spring-cloud-netflix.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
<version>${springboot.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
<version>${springboot.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> | ||
<version>${netflix.eureka.version}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<!-- import dependency way 1--> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-commons-dependencies</artifactId> | ||
<version>${spring-cloud-commons.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-netflix-dependencies</artifactId> | ||
<version>${spring-cloud-netflix.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
|
||
<!-- import dependency way 2 --> | ||
<!-- <dependency>--> | ||
<!-- <groupId>org.springframework.cloud</groupId>--> | ||
<!-- <artifactId>spring-cloud-dependencies</artifactId>--> | ||
<!-- <version>Camden.RELEASE</version>--> | ||
<!-- <type>pom</type>--> | ||
<!-- <scope>import</scope>--> | ||
<!-- </dependency>--> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<version>${springboot.version}</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
2 changes: 2 additions & 0 deletions
2
repository/springboot-eureka-xstream-rce/springboot-eureka-xstream-rce.iml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4" /> |
13 changes: 13 additions & 0 deletions
13
repository/springboot-eureka-xstream-rce/src/main/java/landgrey/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package landgrey; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | ||
|
||
@SpringBootApplication | ||
@EnableEurekaClient | ||
public class Application { | ||
public static void main(String[] args){ | ||
SpringApplication.run(Application.class,args); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
repository/springboot-eureka-xstream-rce/src/main/java/landgrey/controller/Article.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package landgrey.controller; | ||
|
||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@EnableAutoConfiguration | ||
public class Article { | ||
@RequestMapping("/article") | ||
public String hello(String id){ | ||
int total = 100; | ||
String message = String.format("You've read %s books, and there are %d left", id, total - Integer.valueOf(id)); | ||
return message; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
repository/springboot-eureka-xstream-rce/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
server.port=9093 | ||
server.address=127.0.0.1 | ||
|
||
# vulnerable configuration set 0: spring boot 1.0 - 1.4 | ||
# all spring boot versions 1.0 - 1.4 expose actuators by default without any parameters | ||
# no configuration required to expose them | ||
|
||
# safe configuration set 0: spring boot 1.0 - 1.4 | ||
#management.security.enabled=true | ||
|
||
# vulnerable configuration set 1: spring boot 1.5+ | ||
# spring boot 1.5+ requires management.security.enabled=false to expose sensitive actuators | ||
#management.security.enabled=false | ||
|
||
# safe configuration set 1: spring boot 1.5+ | ||
# when 'management.security.enabled=false' but all sensitive actuators explicitly disabled | ||
#management.security.enabled=false | ||
|
||
# vulnerable configuration set 2: spring boot 2+ | ||
#management.endpoints.web.exposure.include=* | ||
#management.endpoint.env.post.enabled=true |