File size: 842 Bytes
46a6ee3
fa02ba4
92f446b
46a6ee3
 
92f446b
fa02ba4
 
 
 
da08fae
fa02ba4
 
c35c19e
fa02ba4
 
67bf8ba
46a6ee3
fa02ba4
e66f7bf
fa02ba4
 
92f446b
46a6ee3
 
 
fa02ba4
 
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
# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /usr/src/app

# Install masscan, libpcap, and setcap
RUN apt-get update && \
    apt-get install -y masscan libpcap-dev libcap2-bin && \
    apt-get clean

# Set the necessary capabilities on the masscan binary
RUN setcap cap_net_raw,cap_net_admin=eip /usr/bin/masscan

# Create the output directory and set appropriate permissions
RUN mkdir -p /usr/src/app && chmod -R 777 /usr/src/app

# Copy the script into the container at /usr/src/app
COPY script.sh .

# Make the script executable
RUN chmod +x script.sh

# Expose the port the server will run on
EXPOSE 7860

# Ensure no existing process is using the port, and run the script
CMD ["bash", "-c", "fuser -k 7860/tcp; ./script.sh & python3 -m http.server 7860"]