File tree 3 files changed +26
-3
lines changed 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ Java class that will be deserialized and executed.
41
41
42
42
The HTTP server listens on port ` 8000 ` and responds to any request with a byte array that is the ` Evil.class ` .
43
43
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
45
45
the method simply returns ` null ` , it uses ` Runtime ` to execute arbitrary code on the host machine. In this case, it
46
46
writes to a file called: ` /tmp/pwned ` to prove that it _ could_ execute basically anything available on the machine.
47
47
@@ -51,7 +51,7 @@ Open a terminal window and run the following:
51
51
52
52
```
53
53
cd log4shell-server
54
- mvn exec:java -Dexec.mainClass="Server"
54
+ mvn exec:java
55
55
```
56
56
57
57
You should see output that looks like the following:
@@ -67,7 +67,7 @@ In another terminal window, run the following:
67
67
```
68
68
cd log4shell-client
69
69
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home \
70
- mvn exec:java -Dexec.mainClass="Main"
70
+ mvn exec:java
71
71
```
72
72
73
73
** NOTE:** Referencing ` JAVA_HOME ` is important as the exploit only fully works with older JDK versions.
Original file line number Diff line number Diff line change 31
31
<version >2.14.1</version >
32
32
</dependency >
33
33
</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 >
34
48
</project >
Original file line number Diff line number Diff line change 47
47
</descriptorRefs >
48
48
</configuration >
49
49
</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 >
50
59
</plugins >
51
60
</build >
52
61
</project >
You can’t perform that action at this time.
0 commit comments