Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1.4
#
# Model: multi-stage build
# • build stage: compiles the shellcode exercise
# • runtime stage: runs the exe on port 31346

########## Build ##########
FROM gcc:12 AS builder
WORKDIR /src

COPY src/ .

RUN make

########## Runtime ##########
FROM python:3.9-slim
WORKDIR /app

RUN apt-get update && \

Check failure on line 19 in chapters/exploitation-techniques/shellcodes/drills/08-challenge-shellcode-after/Dockerfile

View workflow job for this annotation

GitHub Actions / Checkpatch

ERROR:TRAILING_WHITESPACE: trailing whitespace
apt-get install -y --no-install-recommends binutils cpp && \
pip install pwntools==4.14.1

COPY --from=builder /src/vuln /app/vuln
COPY sol/ /app/

EXPOSE 31346

CMD ["/bin/sh", "-c", "/app/vuln"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PORT ?= 31346
IMG_NAME ?= 08-challenge-shellcode-after
CONT_NAME ?= $(IMG_NAME)-cnt

build:
docker build -t $(IMG_NAME) .

run: build
docker run -it -p $(PORT):$(PORT) --name $(CONT_NAME) $(IMG_NAME)

stop:
docker stop $(CONT_NAME)

clean: stop
docker rm $(CONT_NAME)

.PHONY: build run stop clean
Loading