├── .gitignore ├── shiro-721 ├── target │ ├── .plxarc │ ├── jacoco-it.exec │ ├── samples-web-1.4.1.war │ ├── maven-status │ │ └── maven-compiler-plugin │ │ │ └── testCompile │ │ │ └── default-testCompile │ │ │ ├── createdFiles.lst │ │ │ └── inputFiles.lst │ ├── maven-archiver │ │ └── pom.properties │ ├── samples-web-1.4.1 │ │ ├── WEB-INF │ │ │ ├── lib │ │ │ │ ├── jstl-1.2.jar │ │ │ │ ├── log4j-1.2.17.jar │ │ │ │ ├── shiro-core-1.4.1.jar │ │ │ │ ├── shiro-lang-1.4.1.jar │ │ │ │ ├── shiro-web-1.4.1.jar │ │ │ │ ├── slf4j-api-1.7.21.jar │ │ │ │ ├── commons-codec-1.10.jar │ │ │ │ ├── shiro-cache-1.4.1.jar │ │ │ │ ├── shiro-event-1.4.1.jar │ │ │ │ ├── jcl-over-slf4j-1.7.21.jar │ │ │ │ ├── slf4j-log4j12-1.7.21.jar │ │ │ │ ├── commons-beanutils-1.9.3.jar │ │ │ │ ├── shiro-config-core-1.4.1.jar │ │ │ │ ├── shiro-config-ogdl-1.4.1.jar │ │ │ │ ├── shiro-crypto-core-1.4.1.jar │ │ │ │ ├── shiro-crypto-hash-1.4.1.jar │ │ │ │ ├── commons-collections-3.2.2.jar │ │ │ │ └── shiro-crypto-cipher-1.4.1.jar │ │ │ ├── classes │ │ │ │ ├── META-INF │ │ │ │ │ ├── NOTICE │ │ │ │ │ ├── DEPENDENCIES │ │ │ │ │ └── LICENSE │ │ │ │ └── log4j.properties │ │ │ ├── web.xml │ │ │ └── shiro.ini │ │ ├── index.jsp │ │ ├── include.jsp │ │ ├── logout.jsp │ │ ├── account │ │ │ └── index.jsp │ │ ├── style.css │ │ ├── home.jsp │ │ └── login.jsp │ ├── test-classes │ │ ├── org │ │ │ └── apache │ │ │ │ └── shiro │ │ │ │ └── test │ │ │ │ └── ContainerIntegrationIT.class │ │ └── META-INF │ │ │ ├── NOTICE │ │ │ ├── DEPENDENCIES │ │ │ └── LICENSE │ ├── classes │ │ ├── META-INF │ │ │ ├── NOTICE │ │ │ ├── DEPENDENCIES │ │ │ └── LICENSE │ │ └── log4j.properties │ ├── maven-shared-archive-resources │ │ └── META-INF │ │ │ ├── NOTICE │ │ │ ├── DEPENDENCIES │ │ │ └── LICENSE │ └── failsafe-reports │ │ ├── org.apache.shiro.test.ContainerIntegrationIT.txt │ │ ├── failsafe-summary.xml │ │ └── TEST-org.apache.shiro.test.ContainerIntegrationIT.xml ├── 20210630171858.jpg ├── src │ ├── main │ │ ├── webapp │ │ │ ├── index.jsp │ │ │ ├── include.jsp │ │ │ ├── logout.jsp │ │ │ ├── account │ │ │ │ └── index.jsp │ │ │ ├── style.css │ │ │ ├── WEB-INF │ │ │ │ ├── web.xml │ │ │ │ └── shiro.ini │ │ │ ├── home.jsp │ │ │ └── login.jsp │ │ └── resources │ │ │ └── log4j.properties │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── shiro │ │ └── test │ │ └── ContainerIntegrationIT.java ├── README.md └── pom.xml ├── shiro_cve-2020-17510 ├── src │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── l4g │ │ └── springshiro │ │ ├── SpringShiroApplication.java │ │ ├── MyRealm.java │ │ ├── controllers │ │ └── LoginController.java │ │ └── config │ │ └── ShiroConfig.java ├── README.md └── pom.xml ├── shiro_cve-2020-11989 ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── org │ │ │ └── syclover │ │ │ └── srpingbootshiro │ │ │ ├── SrpingbootShiroApplication.java │ │ │ ├── MyRealm.java │ │ │ ├── LoginController.java │ │ │ └── ShiroConfig.java │ └── test │ │ └── java │ │ └── org │ │ └── syclover │ │ └── srpingbootshiro │ │ └── SrpingbootShiroApplicationTests.java ├── image-20210128172206395.png ├── image-20210128172253231.png ├── README.md └── pom.xml ├── shiro_cve-2020-13933 ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── org │ │ │ └── test │ │ │ └── springbootshiro │ │ │ ├── SrpingbootShiroApplication.java │ │ │ ├── MyRealm.java │ │ │ ├── LoginController.java │ │ │ └── ShiroConfig.java │ └── test │ │ └── java │ │ └── org │ │ └── test │ │ └── springbootshiro │ │ └── SrpingbootShiroApplicationTests.java ├── image-20210128175855632.png ├── image-20210128175913047.png ├── README.md └── pom.xml ├── shiro_cve-2020-1957 ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── org │ │ │ └── javaboy │ │ │ └── shirobasic │ │ │ ├── ShiroBasicApplication.java │ │ │ ├── MyRealm.java │ │ │ ├── LoginController.java │ │ │ └── ShiroConfig.java │ └── test │ │ └── java │ │ └── org │ │ └── javaboy │ │ └── shirobasic │ │ └── ShiroBasicApplicationTests.java ├── image-20210128161242932.png ├── image-20210128161322861.png ├── README.md └── pom.xml ├── shiro_cve-2020-17523 ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── org │ │ │ └── test │ │ │ └── springbootshiro │ │ │ ├── MyRealm.java │ │ │ ├── LoginController.java │ │ │ ├── ShiroConfig.java │ │ │ └── SpringbootShiroApplication.java │ └── test │ │ └── java │ │ └── org │ │ └── test │ │ └── springbootshiro │ │ └── SrpingbootShiroApplicationTests.java ├── image-20210208145249325.png ├── image-20210208145354757.png ├── image-20210208145429278.png ├── README.md └── pom.xml ├── shiro-550 ├── image1.PNG ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ ├── error.html │ │ │ │ ├── test.html │ │ │ │ ├── hello.html │ │ │ │ └── login.html │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── shiro550 │ │ │ ├── Shiro550Application.java │ │ │ ├── shiro │ │ │ ├── MainRealm.java │ │ │ └── ShiroConfig.java │ │ │ ├── DemoController.java │ │ │ └── exp │ │ │ └── GenPayload.java │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── shiro550 │ │ └── Shiro550ApplicationTests.java ├── .gitignore ├── README.md └── pom.xml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml -------------------------------------------------------------------------------- /shiro-721/target/.plxarc: -------------------------------------------------------------------------------- 1 | maven-shared-archive-resources -------------------------------------------------------------------------------- /shiro_cve-2020-17510/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /shiro_cve-2020-11989/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /shiro_cve-2020-13933/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /shiro_cve-2020-1957/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /shiro_cve-2020-17523/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9090 -------------------------------------------------------------------------------- /shiro-550/image1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-550/image1.PNG -------------------------------------------------------------------------------- /shiro-721/20210630171858.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/20210630171858.jpg -------------------------------------------------------------------------------- /shiro-721/target/jacoco-it.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/jacoco-it.exec -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1.war -------------------------------------------------------------------------------- /shiro-550/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 应用名称 2 | spring.application.name=shiro-550 3 | # 应用服务 WEB 访问端口 4 | server.port=8080 5 | 6 | 7 | -------------------------------------------------------------------------------- /shiro_cve-2020-1957/image-20210128161242932.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-1957/image-20210128161242932.png -------------------------------------------------------------------------------- /shiro_cve-2020-1957/image-20210128161322861.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-1957/image-20210128161322861.png -------------------------------------------------------------------------------- /shiro-721/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | org\apache\shiro\test\ContainerIntegrationIT.class 2 | -------------------------------------------------------------------------------- /shiro_cve-2020-11989/image-20210128172206395.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-11989/image-20210128172206395.png -------------------------------------------------------------------------------- /shiro_cve-2020-11989/image-20210128172253231.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-11989/image-20210128172253231.png -------------------------------------------------------------------------------- /shiro_cve-2020-13933/image-20210128175855632.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-13933/image-20210128175855632.png -------------------------------------------------------------------------------- /shiro_cve-2020-13933/image-20210128175913047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-13933/image-20210128175913047.png -------------------------------------------------------------------------------- /shiro_cve-2020-17523/image-20210208145249325.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-17523/image-20210208145249325.png -------------------------------------------------------------------------------- /shiro_cve-2020-17523/image-20210208145354757.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-17523/image-20210208145354757.png -------------------------------------------------------------------------------- /shiro_cve-2020-17523/image-20210208145429278.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro_cve-2020-17523/image-20210208145429278.png -------------------------------------------------------------------------------- /shiro-721/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Created by Apache Maven 3.6.3 2 | version=1.4.1 3 | groupId=org.apache.shiro.samples 4 | artifactId=samples-web 5 | -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-core-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-core-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-lang-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-lang-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-web-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-web-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/slf4j-api-1.7.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/slf4j-api-1.7.21.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/commons-codec-1.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/commons-codec-1.10.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-cache-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-cache-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-event-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-event-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/jcl-over-slf4j-1.7.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/jcl-over-slf4j-1.7.21.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/slf4j-log4j12-1.7.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/slf4j-log4j12-1.7.21.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/commons-beanutils-1.9.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/commons-beanutils-1.9.3.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-config-core-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-config-core-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-config-ogdl-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-config-ogdl-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-crypto-core-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-crypto-core-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-crypto-hash-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-crypto-hash-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | C:\Users\admin\Downloads\shiro\samples\web\src\test\java\org\apache\shiro\test\ContainerIntegrationIT.java 2 | -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/commons-collections-3.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/commons-collections-3.2.2.jar -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-crypto-cipher-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/samples-web-1.4.1/WEB-INF/lib/shiro-crypto-cipher-1.4.1.jar -------------------------------------------------------------------------------- /shiro-721/target/test-classes/org/apache/shiro/test/ContainerIntegrationIT.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xhycccc/Shiro-Vuln-Demo/HEAD/shiro-721/target/test-classes/org/apache/shiro/test/ContainerIntegrationIT.class -------------------------------------------------------------------------------- /shiro-550/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |error
9 | 10 | -------------------------------------------------------------------------------- /shiro-550/src/main/resources/templates/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |test thymeleaf
9 | 10 | -------------------------------------------------------------------------------- /shiro-550/src/main/resources/templates/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Login success.
9 | 10 | -------------------------------------------------------------------------------- /shiro-721/target/classes/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Apache Shiro :: Samples :: Web 3 | Copyright 2004-2021 The Apache Software Foundation 4 | 5 | This product includes software developed at 6 | The Apache Software Foundation (http://www.apache.org/). 7 | 8 | 9 | -------------------------------------------------------------------------------- /shiro-721/target/test-classes/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Apache Shiro :: Samples :: Web 3 | Copyright 2004-2021 The Apache Software Foundation 4 | 5 | This product includes software developed at 6 | The Apache Software Foundation (http://www.apache.org/). 7 | 8 | 9 | -------------------------------------------------------------------------------- /shiro-721/target/maven-shared-archive-resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Apache Shiro :: Samples :: Web 3 | Copyright 2004-2021 The Apache Software Foundation 4 | 5 | This product includes software developed at 6 | The Apache Software Foundation (http://www.apache.org/). 7 | 8 | 9 | -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/WEB-INF/classes/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Apache Shiro :: Samples :: Web 3 | Copyright 2004-2021 The Apache Software Foundation 4 | 5 | This product includes software developed at 6 | The Apache Software Foundation (http://www.apache.org/). 7 | 8 | 9 | -------------------------------------------------------------------------------- /shiro_cve-2020-17510/README.md: -------------------------------------------------------------------------------- 1 | # Shiro 权限绕过漏洞(CVE-2020-17510) 2 | 3 | ### 漏洞描述 4 | 5 | 由于Shiro在处理url时与Spring存在差异,在使用Apache Shiro与Spring时,远程攻击者可以发送特制的HTTP请求,绕过身份验证过程并获得对应用程序的未授权访问。 6 | 7 | ### 漏洞复现 8 | 9 | 暂无POC 10 | 11 | ### 参考链接 12 | 13 | * https://github.com/plr47/VulRecurrence-JAVA/tree/main/CVE-2020-17510 -------------------------------------------------------------------------------- /shiro-550/src/test/java/com/example/shiro550/Shiro550ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.shiro550; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Shiro550ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro_cve-2020-13933/src/test/java/org/test/springbootshiro/SrpingbootShiroApplicationTests.java: -------------------------------------------------------------------------------- 1 | package org.test.springbootshiro; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SrpingbootShiroApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro_cve-2020-17523/src/test/java/org/test/springbootshiro/SrpingbootShiroApplicationTests.java: -------------------------------------------------------------------------------- 1 | package org.test.springbootshiro; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SrpingbootShiroApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro_cve-2020-11989/src/test/java/org/syclover/srpingbootshiro/SrpingbootShiroApplicationTests.java: -------------------------------------------------------------------------------- 1 | package org.syclover.srpingbootshiro; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SrpingbootShiroApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro-721/target/failsafe-reports/org.apache.shiro.test.ContainerIntegrationIT.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: org.apache.shiro.test.ContainerIntegrationIT 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.956 s - in org.apache.shiro.test.ContainerIntegrationIT 5 | -------------------------------------------------------------------------------- /shiro-550/src/main/java/com/example/shiro550/Shiro550Application.java: -------------------------------------------------------------------------------- 1 | package com.example.shiro550; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Shiro550Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Shiro550Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro_cve-2020-17510/src/main/java/com/l4g/springshiro/SpringShiroApplication.java: -------------------------------------------------------------------------------- 1 | package com.l4g.springshiro; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringShiroApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringShiroApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro_cve-2020-1957/src/main/java/org/javaboy/shirobasic/ShiroBasicApplication.java: -------------------------------------------------------------------------------- 1 | package org.javaboy.shirobasic; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ShiroBasicApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ShiroBasicApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shiro-550/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /shiro_cve-2020-1957/src/test/java/org/javaboy/shirobasic/ShiroBasicApplicationTests.java: -------------------------------------------------------------------------------- 1 | package org.javaboy.shirobasic; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ShiroBasicApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /shiro-721/target/failsafe-reports/failsafe-summary.xml: -------------------------------------------------------------------------------- 1 | 2 |
16 |
17 | 访问`/admin/%3bpage`,成功绕过`authc`拦截器,获取到了资源。
18 |
19 |
20 |
21 | ### 参考链接
22 |
23 | * [Apache shiro安全漏洞(CVE-2020-13933)分析](https://xz.aliyun.com/t/8230)
--------------------------------------------------------------------------------
/shiro-550/README.md:
--------------------------------------------------------------------------------
1 | # Shiro-550 RememberMe反序列化漏洞(CVE-2016-4437)
2 |
3 | ### 漏洞描述
4 |
5 | Apache Shiro默认使用了`CookieRememberMeManager`,其处理cookie的流程是:得到rememberMe的cookie值 》 Base64解码 》 AES解密 》 反序列化。因AES密钥为硬编码,导致攻击者可以构造恶意数据造成反序列化的RCE漏洞。
6 |
7 | ### 漏洞复现
8 |
9 | 使用ysoserial生成CommonsBeanutils1的Gadget:
10 |
11 | ```bash
12 | java -jar ysoserial-master-30099844c6-1.jar CommonsBeanutils1 "calc.exe" > poc.ser
13 | ```
14 |
15 | 运行`GenPayload.java`生成加密后的Payload,放入Cookie中的rememberMe字段发送即可:
16 |
17 | 
18 |
19 | ### 参考链接
20 |
21 | * [shiro550反序列化分析](https://www.cnblogs.com/twosmi1e/p/14279403.html)
22 |
23 | * [Apache Shiro 1.2.4反序列化漏洞(CVE-2016-4437)](https://vulhub.org/#/environments/shiro/CVE-2016-4437/)
--------------------------------------------------------------------------------
/shiro_cve-2020-13933/src/main/java/org/test/springbootshiro/SrpingbootShiroApplication.java:
--------------------------------------------------------------------------------
1 | package org.test.springbootshiro;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.boot.builder.SpringApplicationBuilder;
6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
7 |
8 | @SpringBootApplication
9 | public class SrpingbootShiroApplication extends SpringBootServletInitializer {
10 |
11 | @Override
12 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
13 | return builder.sources(SrpingbootShiroApplication.class);
14 | }
15 |
16 | public static void main(String[] args) {
17 |
18 | SpringApplication.run(SrpingbootShiroApplication.class, args);
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/shiro_cve-2020-1957/README.md:
--------------------------------------------------------------------------------
1 | # Shiro 权限绕过漏洞(CVE-2020-1957)
2 |
3 | ### 漏洞描述
4 |
5 | 当Shiro和 Spring 结合使用时,在一定权限匹配规则下,攻击者可通过构造特殊的 HTTP 请求包完成身份认证绕过。
6 |
7 | 影响版本:Shiro < 1.5.2
8 |
9 | ### 漏洞复现
10 |
11 | 访问`/hello/123`接口,可以看到被`authc`拦截器拦截了,将会跳转到登录接口进行登录。
12 |
13 |
14 |
15 | 访问`/hello/123/`,成功绕过`authc`拦截器,获取到了资源。
16 |
17 |
18 |
19 | ### 参考链接
20 |
21 | * [Shiro 权限绕过漏洞(CVE-2020-1957)复现](https://blog.csdn.net/xuandao_ahfengren/article/details/108218864)
22 | * [CVE-2020-1957 shiro权限绕过漏洞分析](https://blog.csdn.net/qq_22807425/article/details/108283839)
23 | * [Shiro 权限绕过漏洞分析(CVE-2020-1957)](https://blog.riskivy.com/shiro-%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90%EF%BC%88cve-2020-1957%EF%BC%89/)
--------------------------------------------------------------------------------
/shiro_cve-2020-17510/src/main/java/com/l4g/springshiro/MyRealm.java:
--------------------------------------------------------------------------------
1 | package com.l4g.springshiro;
2 |
3 | import org.apache.shiro.authc.*;
4 | import org.apache.shiro.authz.AuthorizationInfo;
5 | import org.apache.shiro.realm.AuthorizingRealm;
6 | import org.apache.shiro.subject.PrincipalCollection;
7 |
8 | public class MyRealm extends AuthorizingRealm {
9 | @Override
10 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
11 | return null;
12 | }
13 | @Override
14 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
15 | String username = (String) token.getPrincipal();
16 | if (!"admin".equals(username)) {
17 | throw new UnknownAccountException("账户不存在!");
18 | }
19 | return new SimpleAuthenticationInfo(username, "123456", getName());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/shiro_cve-2020-11989/README.md:
--------------------------------------------------------------------------------
1 | # Shiro 权限绕过漏洞(CVE-2020-11989)
2 |
3 | ### 漏洞描述
4 |
5 | 当Shiro和 Spring 结合使用时,在一定权限匹配规则下,攻击者可通过构造特殊的 HTTP 请求包完成身份认证绕过。
6 |
7 | 影响范围:
8 |
9 | * Shiro < 1.5.3
10 |
11 | ### 漏洞复现
12 |
13 | 环境
14 |
15 | | Shiro Version | Shiro 1.5.1 |
16 | | :------------ | :--------------------- |
17 | | Web Server | Tomcat 8.5.53 |
18 | | IDE | IDEA 2020.1.1 ULTIMATE |
19 |
20 | 漏洞成功利用存在下面两个条件:
21 |
22 | 1. 若Shiro版本大于1.5.1,需要应用不能部署在根目录,如`/test`目录下(原因见参考链接1)。
23 | 2. Spring控制器中没有另外的权限校验代码
24 |
25 | 访问`/admin/page`接口,可以看到被`authc`拦截器拦截了,将会跳转到登录接口进行登录。
26 |
27 |
28 |
29 | 访问`/;/admin/page`,成功绕过`authc`拦截器,获取到了资源。
30 |
31 |
32 |
33 | ### 参考链接
34 |
35 | * [Apache Shiro权限绕过漏洞分析(CVE-2020-11989)](https://xz.aliyun.com/t/7964)
--------------------------------------------------------------------------------
/shiro_cve-2020-11989/src/main/java/org/syclover/srpingbootshiro/SrpingbootShiroApplication.java:
--------------------------------------------------------------------------------
1 | package org.syclover.srpingbootshiro;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.boot.builder.SpringApplicationBuilder;
6 | import org.springframework.boot.web.servlet.ServletComponentScan;
7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
8 |
9 | @SpringBootApplication
10 | public class SrpingbootShiroApplication extends SpringBootServletInitializer {
11 |
12 | @Override
13 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
14 | return builder.sources(SrpingbootShiroApplication.class);
15 | }
16 |
17 | public static void main(String[] args) {
18 |
19 | SpringApplication.run(SrpingbootShiroApplication.class, args);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/shiro_cve-2020-13933/src/main/java/org/test/springbootshiro/MyRealm.java:
--------------------------------------------------------------------------------
1 | package org.test.springbootshiro;
2 |
3 | import org.apache.shiro.authc.*;
4 | import org.apache.shiro.authz.AuthorizationInfo;
5 | import org.apache.shiro.realm.AuthorizingRealm;
6 | import org.apache.shiro.subject.PrincipalCollection;
7 |
8 | public class MyRealm extends AuthorizingRealm {
9 | @Override
10 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
11 | return null;
12 | }
13 |
14 | @Override
15 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
16 | String username = (String) authenticationToken.getPrincipal();
17 | if (!"java".equals(username)){
18 | throw new UnknownAccountException("unkown user");
19 | }
20 | return new SimpleAuthenticationInfo(username, "123", getName());
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/shiro_cve-2020-17523/src/main/java/org/test/springbootshiro/MyRealm.java:
--------------------------------------------------------------------------------
1 | package org.test.springbootshiro;
2 |
3 | import org.apache.shiro.authc.*;
4 | import org.apache.shiro.authz.AuthorizationInfo;
5 | import org.apache.shiro.realm.AuthorizingRealm;
6 | import org.apache.shiro.subject.PrincipalCollection;
7 |
8 | public class MyRealm extends AuthorizingRealm {
9 | @Override
10 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
11 | return null;
12 | }
13 |
14 | @Override
15 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
16 | String username = (String) authenticationToken.getPrincipal();
17 | if (!"java".equals(username)){
18 | throw new UnknownAccountException("unkown user");
19 | }
20 | return new SimpleAuthenticationInfo(username, "123", getName());
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/shiro_cve-2020-11989/src/main/java/org/syclover/srpingbootshiro/MyRealm.java:
--------------------------------------------------------------------------------
1 | package org.syclover.srpingbootshiro;
2 |
3 | import org.apache.shiro.authc.*;
4 | import org.apache.shiro.authz.AuthorizationInfo;
5 | import org.apache.shiro.realm.AuthorizingRealm;
6 | import org.apache.shiro.subject.PrincipalCollection;
7 |
8 | public class MyRealm extends AuthorizingRealm {
9 | @Override
10 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
11 | return null;
12 | }
13 |
14 | @Override
15 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
16 | String username = (String) authenticationToken.getPrincipal();
17 | if (!"java".equals(username)){
18 | throw new UnknownAccountException("unkown user");
19 | }
20 | return new SimpleAuthenticationInfo(username, "123", getName());
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/shiro-721/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | ~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~ or more contributor license agreements. See the NOTICE file
4 | ~ distributed with this work for additional information
5 | ~ regarding copyright ownership. The ASF licenses this file
6 | ~ to you under the Apache License, Version 2.0 (the
7 | ~ "License"); you may not use this file except in compliance
8 | ~ with the License. You may obtain a copy of the License at
9 | ~
10 | ~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~
12 | ~ Unless required by applicable law or agreed to in writing,
13 | ~ software distributed under the License is distributed on an
14 | ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~ KIND, either express or implied. See the License for the
16 | ~ specific language governing permissions and limitations
17 | ~ under the License.
18 | --%>
19 |
20 | <%-- Forward the user to the home page --%>
21 |
28 |
29 | 绕过姿势一:`/admin/%20`
30 |
31 |
32 |
33 | 绕过姿势二:`/admin/%2e`
34 |
35 |
36 |
37 | ### 参考链接
38 |
39 | * [Shiro 权限绕过漏洞(CVE-2020-11989)](https://github.com/xhycccc/Shiro-Vuln-Demo/tree/main/shiro_cve-2020-11989)
--------------------------------------------------------------------------------
/shiro-721/README.md:
--------------------------------------------------------------------------------
1 | # Shiro-721 RememberMe Padding Oracle 漏洞(CVE-2019-12422)
2 |
3 | ### 漏洞描述
4 |
5 | Shiro使用了AES-128-CBC模式对cookie进行加密,该模式易受到[`Padding Oracle`攻击](https://paper.seebug.org/1123/)。
6 |
7 | Shiro处理cookie的流程:得到rememberMe的cookie值 》 Base64解码 》 AES解密 》 反序列化。
8 |
9 | 所以`padding oracle`攻击方式是,在不需要知道AES密钥且初始化向量IV可控(在rememberMe字段中)的前提下,尝试通过不同IV构造特定的序列化数据,以通过服务器端的==字符填充检查==,从而继续后面的反序列化操作。
10 |
11 | ### 漏洞复现
12 |
13 | #### 环境启动
14 |
15 | 将target目录下编译完成的 samples-web-1.4.1.war 包拷贝到 Tomcat 的 webapps 目录下,启动tomcat即可。
16 |
17 | 
18 |
19 | #### 复现参考:[Shiro-721 RCE Via Padding Oracle Attack](https://github.com/inspiringz/Shiro-721)
20 |
21 | ### 参考链接
22 |
23 | * [Shiro-721 RCE Via Padding Oracle Attack](https://github.com/inspiringz/Shiro-721)
24 | * [Shiro RCE again(Padding Oracle Attack)](https://www.anquanke.com/post/id/192819)
25 | * [CVE-2019-12422 Shiro721 ( Apache Shiro RememberMe Padding Oracle 1.4.1 反序列化漏洞) 分析 下 ](https://www.guildhab.top/2020/12/cve-2019-12422-shiro721-apache-shiro-rememberme-padding-oracle-1-4-1-反序列化漏洞-分析-下/)
--------------------------------------------------------------------------------
/shiro_cve-2020-1957/src/main/java/org/javaboy/shirobasic/MyRealm.java:
--------------------------------------------------------------------------------
1 | package org.javaboy.shirobasic;
2 |
3 | import org.apache.shiro.authc.*;
4 | import org.apache.shiro.authz.AuthorizationInfo;
5 | import org.apache.shiro.realm.AuthorizingRealm;
6 | import org.apache.shiro.subject.PrincipalCollection;
7 |
8 | import javax.security.auth.login.AccountNotFoundException;
9 |
10 | /**
11 | * @Author 江南一点雨
12 | * @Site www.javaboy.org 2019-06-05 11:10
13 | */
14 | public class MyRealm extends AuthorizingRealm {
15 | @Override
16 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
17 | return null;
18 | }
19 |
20 | @Override
21 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
22 | String username = (String) token.getPrincipal();
23 | if (!"javaboy".equals(username)) {
24 | throw new UnknownAccountException("账户不存在!");
25 | }
26 | return new SimpleAuthenticationInfo(username, "123", getName());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/shiro-721/src/main/webapp/include.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | ~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~ or more contributor license agreements. See the NOTICE file
4 | ~ distributed with this work for additional information
5 | ~ regarding copyright ownership. The ASF licenses this file
6 | ~ to you under the Apache License, Version 2.0 (the
7 | ~ "License"); you may not use this file except in compliance
8 | ~ with the License. You may obtain a copy of the License at
9 | ~
10 | ~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~
12 | ~ Unless required by applicable law or agreed to in writing,
13 | ~ software distributed under the License is distributed on an
14 | ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~ KIND, either express or implied. See the License for the
16 | ~ specific language governing permissions and limitations
17 | ~ under the License.
18 | --%>
19 | <%@ page import="org.apache.shiro.SecurityUtils" %>
20 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
21 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
22 | <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
--------------------------------------------------------------------------------
/shiro-721/target/samples-web-1.4.1/include.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | ~ Licensed to the Apache Software Foundation (ASF) under one
3 | ~ or more contributor license agreements. See the NOTICE file
4 | ~ distributed with this work for additional information
5 | ~ regarding copyright ownership. The ASF licenses this file
6 | ~ to you under the Apache License, Version 2.0 (the
7 | ~ "License"); you may not use this file except in compliance
8 | ~ with the License. You may obtain a copy of the License at
9 | ~
10 | ~ http://www.apache.org/licenses/LICENSE-2.0
11 | ~
12 | ~ Unless required by applicable law or agreed to in writing,
13 | ~ software distributed under the License is distributed on an
14 | ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | ~ KIND, either express or implied. See the License for the
16 | ~ specific language governing permissions and limitations
17 | ~ under the License.
18 | --%>
19 | <%@ page import="org.apache.shiro.SecurityUtils" %>
20 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
21 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
22 | <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Shiro-Vuln-Demo
2 | Shiro漏洞实例源码
3 |
4 | ## Shiro反序列化系列
5 | | 漏洞编号 | CVE | 描述 | 影响范围 |
6 | | --------- | -------------- | -------------------------------------- | ------------- |
7 | | Shiro-550 | CVE-2016-4437 | RememberMe反序列化漏洞 | Shiro < 1.2.4 |
8 | | Shiro-721 | CVE-2019-12422 | RememberMe Padding Oracle 反序列化漏洞 | Shiro < 1.4.2 |
9 |
10 |
11 |
12 | ## Shiro权限绕过系列
13 | | CVE | 描述 | 影响范围 | payload |
14 | | -------------- | ---------------------- | ------------- | ------------------------ |
15 | | CVE-2020-1957 | 权限绕过 | Shiro < 1.5.2 | /hello/123/ |
16 | | CVE-2020-11989 | CVE-2020-1957补丁绕过 | Shiro < 1.5.3 | /;/admin/page |
17 | | CVE-2020-13933 | CVE-2020-11989补丁绕过 | Shiro < 1.6.0 | /admin/%3bpage |
18 | | CVE-2020-17523 | 权限绕过 | Shiro < 1.7.1 | /admin/%20You are currently logged in.
30 | 31 | 32 | 33 |" onclick="document.getElementById('logout_form').submit();return false;">Log out.
34 | " method="post"> 35 | 36 | -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/account/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | ~ Licensed to the Apache Software Foundation (ASF) under one 3 | ~ or more contributor license agreements. See the NOTICE file 4 | ~ distributed with this work for additional information 5 | ~ regarding copyright ownership. The ASF licenses this file 6 | ~ to you under the Apache License, Version 2.0 (the 7 | ~ "License"); you may not use this file except in compliance 8 | ~ with the License. You may obtain a copy of the License at 9 | ~ 10 | ~ http://www.apache.org/licenses/LICENSE-2.0 11 | ~ 12 | ~ Unless required by applicable law or agreed to in writing, 13 | ~ software distributed under the License is distributed on an 14 | ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | ~ KIND, either express or implied. See the License for the 16 | ~ specific language governing permissions and limitations 17 | ~ under the License. 18 | --%> 19 | <%@ include file="../include.jsp" %> 20 | 21 | 22 | 23 | "/> 24 | 25 | 26 | 27 |You are currently logged in.
30 | 31 | 32 | 33 |" onclick="document.getElementById('logout_form').submit();return false;">Log out.
34 | " method="post"> 35 | 36 | -------------------------------------------------------------------------------- /shiro-721/src/main/webapp/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | body { 20 | margin: 15px 0 0 15px; 21 | padding: 1px; /*background: #2370cf;*/ 22 | font: 12px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; 23 | color: #000; 24 | } 25 | 26 | table, td { 27 | font: 12px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; 28 | color: #000; 29 | } 30 | 31 | h1 { 32 | font: 24px; 33 | } 34 | 35 | img { 36 | border: thin black solid; 37 | } 38 | 39 | #contentBox { 40 | text-align: center; 41 | width: 50%; 42 | margin: auto; 43 | margin-top: 50px; 44 | color: black; 45 | background: #eee; 46 | border: thick black solid; 47 | } -------------------------------------------------------------------------------- /shiro-721/target/samples-web-1.4.1/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | body { 20 | margin: 15px 0 0 15px; 21 | padding: 1px; /*background: #2370cf;*/ 22 | font: 12px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; 23 | color: #000; 24 | } 25 | 26 | table, td { 27 | font: 12px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; 28 | color: #000; 29 | } 30 | 31 | h1 { 32 | font: 24px; 33 | } 34 | 35 | img { 36 | border: thin black solid; 37 | } 38 | 39 | #contentBox { 40 | text-align: center; 41 | width: 50%; 42 | margin: auto; 43 | margin-top: 50px; 44 | color: black; 45 | background: #eee; 46 | border: thick black solid; 47 | } -------------------------------------------------------------------------------- /shiro-550/src/main/java/com/example/shiro550/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.example.shiro550; 2 | 3 | import org.apache.shiro.SecurityUtils; 4 | import org.apache.shiro.authc.AuthenticationException; 5 | import org.apache.shiro.authc.AuthenticationToken; 6 | import org.apache.shiro.authc.UsernamePasswordToken; 7 | import org.apache.shiro.subject.Subject; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | @Controller 12 | public class DemoController { 13 | 14 | @PostMapping({"/doLogin"}) 15 | public String doLoginPage(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam(name = "rememberme", defaultValue = "") String rememberMe) { 16 | Subject subject = SecurityUtils.getSubject(); 17 | try{ 18 | subject.login((AuthenticationToken)new UsernamePasswordToken(username, password, rememberMe.equals("remember-me"))); 19 | }catch (AuthenticationException e) { 20 | return "forward:/login"; 21 | } 22 | return "forward:/"; 23 | } 24 | 25 | @RequestMapping("/") 26 | public String hello(){ 27 | return "hello"; 28 | } 29 | 30 | @RequestMapping("/test") 31 | public String test(){ 32 | return "test"; 33 | } 34 | 35 | @RequestMapping({"/unauth"}) 36 | public String errorPage(){ 37 | return "error"; 38 | } 39 | 40 | @RequestMapping({"/login"}) 41 | public String loginPage() { 42 | return "login"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /shiro_cve-2020-17523/src/main/java/org/test/springbootshiro/SpringbootShiroApplication.java: -------------------------------------------------------------------------------- 1 | package org.test.springbootshiro; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.beans.factory.config.BeanPostProcessor; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.boot.builder.SpringApplicationBuilder; 8 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 9 | import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; 10 | 11 | /** 12 | * @author jweny 13 | */ 14 | 15 | 16 | 17 | @SpringBootApplication 18 | public class SpringbootShiroApplication extends SpringBootServletInitializer implements BeanPostProcessor { 19 | 20 | @Override 21 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 22 | return builder.sources(SpringbootShiroApplication.class); 23 | } 24 | 25 | public static void main(String[] args) { 26 | 27 | SpringApplication.run(SpringbootShiroApplication.class, args); 28 | } 29 | 30 | @Override 31 | public Object postProcessBeforeInitialization(Object bean, String beanName) 32 | throws BeansException { 33 | if (bean instanceof RequestMappingHandlerMapping) { 34 | ((RequestMappingHandlerMapping) bean).setAlwaysUseFullPath(true); 35 | } 36 | return bean; 37 | } 38 | 39 | @Override 40 | public Object postProcessAfterInitialization(Object bean, String beanName) 41 | throws BeansException { 42 | return bean; 43 | } 44 | } -------------------------------------------------------------------------------- /shiro-721/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 |Hi
Welcome to the Apache Shiro Quickstart sample application. 36 | This page represents the home page of any web application.
37 | 38 |If you want to access the user-only ">account page, 40 | you will need to log-in first.
To show some taglibs, here are the roles you have and don't have. Log out and log back in under different user 45 | accounts to see different roles.
46 | 47 |
50 |
60 |
Hi
Welcome to the Apache Shiro Quickstart sample application. 36 | This page represents the home page of any web application.
37 | 38 |If you want to access the user-only ">account page, 40 | you will need to log-in first.
To show some taglibs, here are the roles you have and don't have. Log out and log back in under different user 45 | accounts to see different roles.
46 | 47 |
50 |
60 |
Here are a few sample accounts to play with in the default text-based Realm (used for this 31 | demo and test installs only). Do you remember the movie these names came from? ;)
32 | 33 | 34 | 59 | 60 | 61 || Username | 65 |Password | 66 |
|---|---|
| root | 71 |secret | 72 |
| presidentskroob | 75 |12345 | 76 |
| darkhelmet | 79 |ludicrousspeed | 80 |
| lonestarr | 83 |vespa | 84 |
Here are a few sample accounts to play with in the default text-based Realm (used for this 31 | demo and test installs only). Do you remember the movie these names came from? ;)
32 | 33 | 34 | 59 | 60 | 61 || Username | 65 |Password | 66 |
|---|---|
| root | 71 |secret | 72 |
| presidentskroob | 75 |12345 | 76 |
| darkhelmet | 79 |ludicrousspeed | 80 |
| lonestarr | 83 |vespa | 84 |