Skip to content

Commit 02864c9

Browse files
committed
specified exec plugin in pomfile with startup class, no need to give it as argument.
1 parent cbdcf59 commit 02864c9

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

log4shell-goof/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Java class that will be deserialized and executed.
4141

4242
The HTTP server listens on port `8000` and responds to any request with a byte array that is the `Evil.class`.
4343

44-
`Evil` implements `ObjecFactory` which the JNDI mechanism hooks into to execute its `getObjectInstance` method. While
44+
`Evil` implements `ObjectFactory` which the JNDI mechanism hooks into to execute its `getObjectInstance` method. While
4545
the method simply returns `null`, it uses `Runtime` to execute arbitrary code on the host machine. In this case, it
4646
writes to a file called: `/tmp/pwned` to prove that it _could_ execute basically anything available on the machine.
4747

@@ -51,7 +51,7 @@ Open a terminal window and run the following:
5151

5252
```
5353
cd log4shell-server
54-
mvn exec:java -Dexec.mainClass="Server"
54+
mvn exec:java
5555
```
5656

5757
You should see output that looks like the following:
@@ -67,7 +67,7 @@ In another terminal window, run the following:
6767
```
6868
cd log4shell-client
6969
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home \
70-
mvn exec:java -Dexec.mainClass="Main"
70+
mvn exec:java
7171
```
7272

7373
**NOTE:** Referencing `JAVA_HOME` is important as the exploit only fully works with older JDK versions.

log4shell-goof/log4shell-client/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,18 @@
3131
<version>2.14.1</version>
3232
</dependency>
3333
</dependencies>
34+
35+
<build>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.codehaus.mojo</groupId>
39+
<artifactId>exec-maven-plugin</artifactId>
40+
<version>3.0.0</version>
41+
<configuration>
42+
<mainClass>Main</mainClass>
43+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</build>
3448
</project>

log4shell-goof/log4shell-server/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@
4747
</descriptorRefs>
4848
</configuration>
4949
</plugin>
50+
<plugin>
51+
<groupId>org.codehaus.mojo</groupId>
52+
<artifactId>exec-maven-plugin</artifactId>
53+
<version>3.0.0</version>
54+
<configuration>
55+
<mainClass>Server</mainClass>
56+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
57+
</configuration>
58+
</plugin>
5059
</plugins>
5160
</build>
5261
</project>

0 commit comments

Comments
 (0)