Skip to content

Commit 46f6df1

Browse files
cbxssclaude
andcommitted
Revival: modernize SpiderFoot for Python 3.12+, switch to uv, fix broken modules
- Migrate from requirements.txt to pyproject.toml with relaxed dependency bounds - Switch to uv for package management across project and Docker - Update Docker: Alpine 3.20, Python 3.12-bookworm, fix Node/Wappalyzer setup - Fix secure library API for 1.x (was 0.3.x), PyPDF2 -> pypdf API - Fix 14 type()==Y patterns to isinstance() - Cherry-pick upstream bug fixes: WhatsMyName fields (smicallef#1894), nmap parsing (smicallef#1879), DNS for Family IP (smicallef#1872), nuclei/wafw00f/whatweb JSON parsing (smicallef#1952), db.py UnboundLocalError (smicallef#1787), dev port correlation (smicallef#1827), accounts strip_bad_char support (smicallef#1828) - Add 5 new modules: InternetDB (Shodan free), LeakCheck (paid+free), WhoisFreaks, ip2location.io 238/238 modules load successfully on Python 3.12. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 0f815a2 commit 46f6df1

33 files changed

+2955
-231
lines changed

Dockerfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,20 @@
3434
# sudo docker build -t spiderfoot-test --build-arg REQUIREMENTS=test/requirements.txt .
3535
# sudo docker run --rm spiderfoot-test -m pytest --flake8 .
3636

37-
FROM alpine:3.12.4 AS build
37+
FROM alpine:3.20 AS build
3838
ARG REQUIREMENTS=requirements.txt
3939
RUN apk add --no-cache gcc git curl python3 python3-dev py3-pip swig tinyxml-dev \
40-
python3-dev musl-dev openssl-dev libffi-dev libxslt-dev libxml2-dev jpeg-dev \
40+
musl-dev openssl-dev libffi-dev libxslt-dev libxml2-dev jpeg-dev \
4141
openjpeg-dev zlib-dev cargo rust
42-
RUN python3 -m venv /opt/venv
43-
ENV PATH="/opt/venv/bin":$PATH
42+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
43+
RUN uv venv /opt/venv
44+
ENV PATH="/opt/venv/bin:$PATH"
45+
ENV VIRTUAL_ENV="/opt/venv"
4446
COPY $REQUIREMENTS requirements.txt ./
45-
RUN ls
46-
RUN echo "$REQUIREMENTS"
47-
RUN pip3 install -U pip
48-
RUN pip3 install -r "$REQUIREMENTS"
49-
47+
RUN uv pip install -r "$REQUIREMENTS"
5048

5149

52-
FROM alpine:3.13.0
50+
FROM alpine:3.20
5351
WORKDIR /home/spiderfoot
5452

5553
# Place database and logs outside installation directory

Dockerfile.full

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Written by: TheTechromancer
77
#
88

9-
FROM python:3
9+
FROM python:3.12-bookworm
1010

1111
# Install tools/dependencies from apt
1212
RUN apt-get -y update && apt-get -y install nbtscan onesixtyone nmap
@@ -32,15 +32,8 @@ RUN groupadd spiderfoot \
3232
&& useradd -m -g spiderfoot -d /home/spiderfoot -s /sbin/nologin \
3333
-c "SpiderFoot User" spiderfoot
3434

35-
# Install RetireJS
36-
RUN apt remove -y cmdtest \
37-
&& apt remove -y yarn \
38-
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
39-
&& echo 'deb https://dl.yarnpkg.com/debian/ stable main' |tee /etc/apt/sources.list.d/yarn.list \
40-
&& apt-get update \
41-
&& apt-get install yarn -y \
42-
&& yarn install \
43-
&& curl -fsSL https://deb.nodesource.com/setup_17.x | bash - \
35+
# Install Node.js 20 via NodeSource and RetireJS
36+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
4437
&& apt-get install -y nodejs \
4538
&& npm install -g retire
4639

@@ -49,22 +42,23 @@ RUN wget -qO - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor
4942
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list \
5043
&& apt -y update && apt install --allow-unauthenticated -y google-chrome-stable
5144

52-
# Install Wappalyzer
53-
RUN git clone https://github.com/AliasIO/wappalyzer.git \
54-
&& cd wappalyzer \
55-
&& yarn install && yarn run link
45+
# Install Wappalyzer CLI
46+
RUN npm install -g wappalyzer-cli
5647

5748
# Install Nuclei
5849
RUN wget https://github.com/projectdiscovery/nuclei/releases/download/v2.6.5/nuclei_2.6.5_linux_amd64.zip \
5950
&& unzip nuclei_2.6.5_linux_amd64.zip \
60-
&& git clone https://github.com/projectdiscovery/nuclei-templates.git
51+
&& for i in 1 2 3; do git clone https://github.com/projectdiscovery/nuclei-templates.git && break || sleep 5; done
6152

6253
# Install testssl.sh
6354
RUN apt-get install -y bsdmainutils dnsutils coreutils
64-
RUN git clone https://github.com/drwetter/testssl.sh.git
55+
RUN for i in 1 2 3; do git clone https://github.com/drwetter/testssl.sh.git && break || sleep 5; done
56+
57+
# Install uv for Python package management
58+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
6559

6660
# Install Snallygaster and TruffleHog
67-
RUN pip3 install snallygaster trufflehog
61+
RUN uv pip install --system snallygaster trufflehog
6862

6963
# Place database and logs outside installation directory
7064
ENV SPIDERFOOT_DATA /var/lib/spiderfoot
@@ -84,7 +78,7 @@ COPY . .
8478
ENV VIRTUAL_ENV=/opt/venv
8579
RUN mkdir -p "$VIRTUAL_ENV" || true
8680
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
87-
RUN python -m venv "$VIRTUAL_ENV"
81+
RUN uv venv "$VIRTUAL_ENV"
8882

8983
ARG REQUIREMENTS=requirements.txt
9084
COPY "$REQUIREMENTS" requirements.txt
@@ -95,20 +89,17 @@ RUN chown -R spiderfoot:spiderfoot "/home/spiderfoot"
9589

9690
USER spiderfoot
9791

98-
RUN pip install -U pip
99-
RUN pip install -r "$REQUIREMENTS"
92+
RUN uv pip install -r "$REQUIREMENTS"
10093

10194
# Install Python tools
102-
RUN pip install dnstwist
95+
RUN uv pip install dnstwist
10396
# CMSeeK
10497
WORKDIR /tools
10598
RUN git clone https://github.com/Tuhinshubhra/CMSeeK && cd CMSeeK \
106-
&& pip install -r requirements.txt && mkdir Results
99+
&& uv pip install -r requirements.txt && mkdir Results
107100

108101
# Install wafw00f
109-
RUN git clone https://github.com/EnableSecurity/wafw00f \
110-
&& cd wafw00f \
111-
&& python3 setup.py install
102+
RUN uv pip install wafw00f
112103
WORKDIR /home/spiderfoot
113104

114105
EXPOSE 5001
@@ -128,7 +119,7 @@ db.configSet({ \
128119
"sfp_tool_trufflehog:trufflehog_path": "/usr/local/bin/trufflehog", \
129120
"sfp_tool_nuclei:nuclei_path": "/tools/nuclei", \
130121
"sfp_tool_nuclei:template_path": "/tools/nuclei-templates", \
131-
"sfp_tool_wappalyzer:wappalyzer_path": "/tools/wappalyzer/src/drivers/npm/cli.js", \
122+
"sfp_tool_wappalyzer:wappalyzer_path": "/usr/local/bin/wappalyzer", \
132123
"sfp_tool_nbtscan:nbtscan_path": "/usr/bin/nbtscan", \
133124
"sfp_tool_nmap:nmappath": "DISABLED_BECAUSE_NMAP_REQUIRES_ROOT_TO_WORK" \
134125
})' || true && ./sf.py -l 0.0.0.0:5001

correlations/dev_port.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
id: dev_port
2+
version: 1
3+
meta:
4+
name: A common port appearing to be a test or development service was found
5+
description: >
6+
A host with an open tcp
7+
port that is often used for development purposes
8+
was found. This may indicate a system that is exposed
9+
over the Internet unintentionally, and/or may be less secure
10+
than other systems.
11+
risk: MEDIUM
12+
collections:
13+
- collect:
14+
- method: exact
15+
field: type
16+
value: TCP_PORT_OPEN
17+
- method: regex
18+
field: data
19+
value:
20+
- .*:8000$
21+
- .*:8080$
22+
- .*:8888$
23+
aggregation:
24+
field: source.data
25+
headline: "Development or internal service found: {source.data}"

docker-compose-dev.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
services:
42
spiderfoot:
53
volumes:

docker-compose-full.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
services:
42
spiderfoot:
53
build:

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
# Basic usage:
42
# $ docker-compose up
53
#

0 commit comments

Comments
 (0)