File size: 1,131 Bytes
8ea5812
2467145
 
 
 
8ea5812
2467145
 
3b2acde
3fcee63
3b2acde
3fcee63
2467145
 
8ea5812
 
 
 
 
 
3fcee63
8ea5812
3fcee63
 
 
 
 
2467145
 
 
af015fe
 
 
2467145
3fcee63
 
8ea5812
2467145
8ea5812
3fcee63
 
2467145
3b2acde
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
31
32
33
34
35
36
37
38
39
40
41
42
43

FROM kalilinux/kali-rolling

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV API_TOKEN=shell

RUN apt-get update && apt-get install -y \
    python3 python3-pip \
    python3-fastapi python3-uvicorn python3-multipart python3-websockets \
    curl wget git sudo vim \
    openssh-server \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# Configure SSH
RUN mkdir -p /var/run/sshd && \
    echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
    echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \
    echo 'Port 2222' >> /etc/ssh/sshd_config && \
    echo 'ListenAddress 0.0.0.0' >> /etc/ssh/sshd_config

# Create kali user
RUN useradd -m -u 1000 -s /bin/bash kali && \
    echo "kali:kali" | chpasswd && \
    usermod -aG sudo kali && \
    echo "kali ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/kali

WORKDIR /app

COPY server.py .
COPY static/index.html ./static/index.html
COPY static/assets/app.js ./static/assets/app.js
COPY static/assets/index.css ./static/assets/index.css

RUN chown -R kali:kali /app

# Expose web UI and SSH
EXPOSE 7860
EXPOSE 2222

USER kali

CMD ["python3", "server.py"]