aboutsummaryrefslogtreecommitdiff
path: root/2026/apple-container-machine-machines/Dockerfile.recon-machine
blob: 79897ffc4316ac87f7e1f4589fee2d2b4858bf34 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM ubuntu:24.04

ENV container container

# Base system + networking
RUN apt-get update && \
    apt-get install -y \
    dbus systemd openssh-server \
    curl wget ca-certificates \
    sudo iproute2 iputils-ping net-tools \
    dnsutils whois traceroute mtr-tiny \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# Recon CLI tooling
RUN apt-get update && \
    apt-get install -y \
    nmap \
    netcat-openbsd \
    nikto \
    sqlmap \
    hydra \
    jq \
    python3 python3-pip python3-venv \
    dnsmap \
    dnsrecon \
    dnswalk \
    dirb \
    wfuzz \
    sslscan \
    testssl.sh \
    whatweb \
    smbclient \
    ldap-utils \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# Go for installing Go-based tools
RUN apt-get update && \
    apt-get install -y golang-go && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

# Install Go-based recon tools
RUN go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest && \
    go install github.com/projectdiscovery/httpx/cmd/httpx@latest && \
    go install github.com/projectdiscovery/naabu/v2/cmd/naabu@latest && \
    go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest && \
    go install github.com/tomnomnom/httprobe@latest && \
    go install github.com/tomnomnom/gf@latest && \
    go install github.com/tomnomnom/waybackurls@latest && \
    go install github.com/tomnomnom/assetfinder@latest && \
    go install github.com/ffuf/ffuf/v2@latest && \
    go install github.com/OJ/gobuster/v3@latest

# Copy go-installed binaries to system PATH and add GOPATH/bin to profile
RUN cp /root/go/bin/* /usr/local/bin/ 2>/dev/null; true
RUN echo 'export PATH=$PATH:/root/go/bin' > /etc/profile.d/gopath.sh && chmod +x /etc/profile.d/gopath.sh

# Init setup for container machine
RUN >/etc/machine-id && >/var/lib/dbus/machine-id

RUN systemctl set-default multi-user.target && \
    systemctl mask \
      dev-hugepages.mount \
      sys-fs-fuse-connections.mount \
      systemd-update-utmp.service \
      systemd-tmpfiles-setup.service \
      console-getty.service && \
    systemctl disable \
      networkd-dispatcher.service

# SSH config for remote access
RUN sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \
    sed -i 's/^#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config