first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
18
base/log4j/2.8.1/Dockerfile
Normal file
18
base/log4j/2.8.1/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM vulhub/java:8u162-jdk AS build-env
|
||||
|
||||
RUN mkdir /opt/maven \
|
||||
&& wget -qO- http://archive.apache.org/dist/maven/binaries/apache-maven-3.2.2-bin.tar.gz | tar -xz -C /opt/maven --strip-components=1
|
||||
|
||||
COPY . /usr/src/
|
||||
|
||||
RUN set -ex \
|
||||
&& cd /usr/src \
|
||||
&& /opt/maven/bin/mvn package assembly:single
|
||||
|
||||
FROM openjdk:8-jre-slim
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
COPY --from=build-env /usr/src/target/log4jrce-1.0-SNAPSHOT-all.jar /log4jrce-1.0-SNAPSHOT-all.jar
|
||||
|
||||
CMD ["java", "-jar", "/log4jrce-1.0-SNAPSHOT-all.jar"]
|
63
base/log4j/2.8.1/pom.xml
Normal file
63
base/log4j/2.8.1/pom.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.vulhub</groupId>
|
||||
<artifactId>log4jrce</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>log4jrce</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<finalName>${project.artifactId}-${project.version}-all</finalName>
|
||||
<!-- get all project dependencies -->
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<!-- MainClass in mainfest make a executable jar -->
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>org.vulhub.App</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
20
base/log4j/2.8.1/src/main/java/org/vulhub/App.java
Normal file
20
base/log4j/2.8.1/src/main/java/org/vulhub/App.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package org.vulhub;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
|
||||
import org.apache.logging.log4j.core.net.server.ObjectInputStreamLogEventBridge;
|
||||
import org.apache.logging.log4j.core.net.server.TcpSocketServer;
|
||||
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) {
|
||||
TcpSocketServer<ObjectInputStream> myServer = null;
|
||||
try {
|
||||
myServer = new TcpSocketServer<ObjectInputStream>(4712, new ObjectInputStreamLogEventBridge());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
myServer.run();
|
||||
}
|
||||
}
|
38
base/log4j/2.8.1/src/test/java/org/vulhub/AppTest.java
Normal file
38
base/log4j/2.8.1/src/test/java/org/vulhub/AppTest.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package org.vulhub;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user