File size: 1,435 Bytes
b40458f
 
209c52f
1701439
 
 
cf9b801
209c52f
 
dc750f2
 
 
 
 
d4c9462
b40458f
209c52f
4a09323
 
 
 
 
 
 
 
cc81665
b7e7576
fc7439d
f13c0ca
 
b6b05c0
6773647
 
5ca0576
 
b3697bc
b40458f
 
 
b3697bc
7664332
d2e052d
 
 
 
 
 
b7e7576
 
 
064c8d6
b7e7576
 
d4c9462
b3697bc
b40458f
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Use Kali Linux as base image
FROM kalilinux/kali-rolling

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm-256color

# Set working directory
WORKDIR /app

# Copy the local directory's contents into the container at /app
COPY ./ /app/

# Update and install necessary packages
RUN apt-get update && \
    apt-get install -y \
        python3 \
        python3-pip \
        curl \
        wget \
        gnupg2 \
        lsb-release \
        nano \
        apktool \
        sudo \
        netcat-traditional \
        virtualbox \
        virtualbox-dkms \
        linux-headers-amd64 \
        git \
        cmake \
        fakeroot   # Include fakeroot here
   

# Install Python dependencies (assuming requirements.txt is in the same directory)
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

# Create a new user
RUN useradd -r -u 1000 -m -s /bin/bash appuser && \
    chown -R appuser:appuser /app

# Grant execute permissions to all files in the /app directory
RUN chmod +x /app/*

# Modify sudoers file to allow passwordless sudo
RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/appuser && \
    chmod 0440 /etc/sudoers.d/appuser

# Switch to the new user
USER appuser

# Run pyxtermjs when the container starts
CMD ["python3", "-m", "pyxtermjs", "--host", "0.0.0.0", "-p", "7860"]