Submission ready state achieved (#8)
This commit is contained in:
23
compile_docker/Dockerfile
Normal file
23
compile_docker/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM debian:bullseye
|
||||
|
||||
#############################################
|
||||
############ FOR COMPILING ONLY! ############
|
||||
#############################################
|
||||
|
||||
|
||||
RUN apt update -y && apt upgrade -y && apt install -y build-essential cmake
|
||||
|
||||
COPY libc-2.31.so /lib/x86_64-linux-gnu/libc-2.31-bx.so
|
||||
RUN ln -sf /lib/x86_64-linux-gnu/libc-2.31-bx.so /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
RUN useradd -m pwn
|
||||
|
||||
# compile vuln
|
||||
COPY parent.tar.xz /home/pwn/parent.tar.xz
|
||||
RUN mkdir /home/pwn/source
|
||||
RUN tar xvf /home/pwn/parent.tar.xz -C /home/pwn/source
|
||||
RUN mkdir /home/pwn/build
|
||||
WORKDIR /home/pwn/build
|
||||
RUN cmake /home/pwn/source -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
|
||||
RUN make
|
||||
|
||||
7
compile_docker/compile.sh
Executable file
7
compile_docker/compile.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
find .. -maxdepth 1 -type f | xargs tar cvf parent.tar.xz
|
||||
docker build -t binex_project_compiler .
|
||||
docker create --name binex_project_compiler binex_project_compiler
|
||||
docker cp binex_project_compiler:/home/pwn/build/vuln .
|
||||
docker rm -f binex_project_compiler
|
||||
rm parent.tar.xz
|
||||
Reference in New Issue
Block a user