FROM ubuntu:22.04

#
RUN apt-get update

# Install ip utils
RUN apt-get install -y iputils-ping && apt-get install -y iproute2 iptables socat

# These libraries are usefull to install slowhttptest and hulk
RUN apt-get install -y git make g++ automake autoconf libtool pip
RUN apt-get install -y git libssl-dev libev-dev libevent-dev build-essential

# Install slowhttptest
RUN git clone https://github.com/shekyan/slowhttptest.git
WORKDIR /slowhttptest
RUN ./configure && \
    make && \
    make install
RUN rm -rf /slowhttptest

# Set the working directory back to the root directory
WORKDIR /

# Install HULK
RUN git clone https://github.com/Hyperclaw79/HULK-v3.git
WORKDIR /HULK-v3
RUN pip install -r requirements_linux.txt
WORKDIR /

RUN apt-get update 
RUN git clone https://github.com/R3DHULK/HULK.git
WORKDIR /HULK
RUN python3 -m pip install -r requirements.txt
WORKDIR /

ENV DEBIAN_FRONTEND=noninteractive

# Preconfigure tzdata with the desired timezone
RUN ln -fs /usr/share/zoneinfo/Europe/Madrid /etc/localtime && \
    echo "Europe/Madrid" > /etc/timezone && \
    apt-get update && \
    apt-get install -y tzdata && \
    dpkg-reconfigure --frontend noninteractive tzdata

RUN apt-get install -y hping3 

RUN apt-get update
# Copy andmake the scripts executable 
COPY entrypoints/ep_attacker.sh entrypoints/ep_attacker.sh
RUN chmod +x /entrypoints/ep_attacker.sh 

CMD ["/bin/bash"]
