Skip to content

Java web common vulnerabilities and security code which is base on springboot and spring security

Notifications You must be signed in to change notification settings

execveat/java-sec-code

Repository files navigation

Java Security Code

介绍

该项目也可以叫做Java Vulnerability Code(Java漏洞代码)。

每个漏洞类型代码默认存在安全漏洞(除非本身不存在漏洞),相关修复代码在注释里。具体可查看每个漏洞代码和注释。

漏洞代码

漏洞说明

如何运行

Tomcat

  1. 生成war包 mvn clean package
  2. 将target目录的war包,cp到Tomcat的webapps目录
  3. 重启Tomcat应用
http://localhost:8080/java-sec-code-1.0.0/rce/exec?cmd=whoami

返回

Viarus

IDEA

如果想在IDEA中直接运行,需要在IDEA中添加Tomcat配置,步骤如下:

Run -> Edit Configurations -> 添加TomcatServer(Local) -> Server中配置Tomcat路径 -> Deployment中添加Artifact选择java-sec-code:war exploded

tomcat

配置完成后,右上角直接点击run,即可运行。

http://localhost:8080/rce/exec?cmd=whoami

返回

Viarus

有人反馈不想额外下载Tomcat,想使用SpringBoot自带的Tomcat,所以额外说明。

具体操作:执行cp pom-idea.xml pom.xml后,最后在IDEA中右键Run Application

Jar包

有人反馈想直接打Jar包运行。具体操作:

先修改pom.xml里的配置,将war改成jar

    <groupId>sec</groupId>
    <artifactId>java-sec-code</artifactId>
    <version>1.0.0</version>
    <packaging>war</packaging>

再打包运行即可。

mvn clean package -DskipTests 
java -jar 打包后的jar包路径

About

Java web common vulnerabilities and security code which is base on springboot and spring security

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 96.4%
  • HTML 2.6%
  • CSS 1.0%