Skip to content

About

Passive OSINT & attack surface intelligence for domains — not just what is exposed, but what it means.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ShadowSpace

English | Türkçe

Passive OSINT & attack surface intelligence for domains — not just what is exposed, but what it means.

ShadowSpace collects publicly available information about a domain (WHOIS/RDAP, DNS, certificates, subdomains, email security, technologies), explains every finding in plain language, prioritizes risks, and visualizes the domain's digital footprint as an interactive graph.

Status: TLS, web, exposure and takeover candidates; the footprint graph; change tracking and reports; and optional Tier 2 active discovery. See docs/ROADMAP.md.

Screenshots

Dashboard — list of past scans with status, progress and finding counts.

ShadowSpace dashboard with the list of scans

Scan overview — category grades (A–F), severity breakdown and the most important findings.

Scan overview page with category grades and findings

Footprint graph — domains, subdomains, IPs, certificates and their relations as an interactive graph.

Interactive footprint graph of a domain's assets

Subdomains — discovered subdomains with search, filters, sorting and CSV export.

Subdomains table with filters

Report — a shareable summary of the scan's findings and remediation advice.

Scan report page

New scan — start a scan by entering a domain and choosing the collection tier.

New scan form with domain input and tier selection

Quick start (recommended)

Requirements: Docker with Docker Compose v2.24 or newer.

git clone https://github.com/KayraDev0/shadowspace.git && cd shadowspace
cp .env.example .env
# Change POSTGRES_PASSWORD in .env (letters and digits only), e.g. to: openssl rand -hex 24
docker compose up -d --build

Open http://127.0.0.1:8080, enter a domain you are allowed to scan (for example example.com) and start. The first build takes a few minutes.

⚠️ .env.example ships with the weak placeholder password change_me. Change POSTGRES_PASSWORD before the first start. The password is fixed when the database volume is created: to change it later, run docker compose down -v (this deletes all scans) and start again.

What runs: PostgreSQL, Redis, a one-shot migrate service (applies the database migrations), the API, one worker and nginx serving the production build of the UI. nginx forwards /api to the API and streams live progress (Server-Sent Events) without buffering.

  • Only the UI port is published, and only on 127.0.0.1 (SHADOWSPACE_PORT, default 8080). PostgreSQL, Redis and the API publish no ports, so they do not clash with local services and cannot be reached from the network.
  • In Compose, DATABASE_URL, REDIS_URL and REDIS_ALLOWED_HOSTS are set in docker-compose.yml; the rest of .env (timeouts, limits, API keys, ALLOWED_HOSTS) is used as is. If you open the UI under another host name, add that name to ALLOWED_HOSTS.
  • Do not scale the worker service: there must be exactly one.
Command What it does
docker compose logs -f backend worker Follow the API and worker logs
docker compose down Stop (scans are kept in the pgdata volume)
docker compose down -v Stop and delete all data
docker compose up -d --build Update after git pull (migrations run automatically)

Windows (PowerShell)

Requirements: Docker Desktop with the WSL 2 backend and Git for Windows.

# core.autocrlf=false keeps LF line endings (the repo's .gitattributes enforces this as well)
git clone --config core.autocrlf=false https://github.com/KayraDev0/shadowspace.git
cd shadowspace
Copy-Item .env.example .env

# Generate a password (letters and digits only) and copy it:
-join ((48..57) + (97..122) | Get-Random -Count 32 | ForEach-Object {[char]$_})

# Replace change_me in the POSTGRES_PASSWORD line with that password, then save:
notepad .env

docker compose up -d --build

Open http://127.0.0.1:8080.

Common problems:

  • error during connect / cannot find the file specified / pipe/docker_engine: Docker Desktop is not running. Start it and wait until it shows "Engine running".
  • "WSL 2 installation is incomplete" / WSL error: in an administrator PowerShell run wsl --install (or wsl --update), restart, then start Docker Desktop again.
  • "Virtualization support not detected" / "Hardware assisted virtualization": enable virtualization (Intel VT-x / AMD-V, sometimes called SVM) in the BIOS/UEFI settings and restart.
  • Port 8080 is already in use (bind: address already in use / ports are not available): in .env change SHADOWSPACE_PORT=8080 to a free port such as 8081, run docker compose up -d again and open http://127.0.0.1:8081. To see what uses the port: netstat -ano | findstr :8080.

Features

Available now:

  • Registration data (RDAP with WHOIS fallback), including ccTLDs without RDAP such as .com.tr

  • DNS records, CAA and DNSSEC presence

  • E-mail security: SPF (with lookup count), DMARC, DKIM (common selectors), MTA-STS, TLS-RPT

  • Passive subdomain discovery (crt.sh, Cert Spotter, Wayback, AlienVault OTX, HackerTarget and, if installed, Subfinder) with DNS verification, CNAME chains and wildcard detection

  • Persistent job queue with live progress over Server-Sent Events

  • Explainable risk engine (YAML rules, Turkish and English) with A–F grades per category

  • A confidence level per subdomain. Web archive noise (embedded domains, cut-off names, typos, bad encoding) is dropped or flagged with its reason; unconfirmed names are hidden by default and never trigger findings

  • Subdomains page: search, status, confidence and source filters, sorting and CSV export; a summary and per-source counts on the overview

  • Dark web UI (Turkish and English) with live progress, filterable findings and a command palette

  • TLS certificates from one handshake per host; front-page security headers, cookie flags and security.txt; technology detection from those responses

  • Shodan InternetDB and ASN / CDN / cloud lookups per IP address

  • Subdomain takeover candidates (dangling CNAMEs and provider "nothing here" pages); nothing is claimed or verified

  • SSL, Web security (host × header matrix), Technologies and Open ports pages; takeover warnings; CVE lists collapsed and marked as unverified guesses from version information

  • Scan coverage summary (host selection, name patterns, cut-off names, partial results) and a column picker for the subdomain table

  • Relationship graph: domains, subdomains, addresses, networks, certificates, mail and name servers, technologies and CNAME targets on one map, coloured by their most severe finding. Large scans are grouped on the server (numbered names, shared addresses, networks) and groups open on demand; a side panel links each finding to its card. Also as a searchable list; PNG export with legend

  • Change tracking: what changed since another scan of the same domain (new, gone and changed assets; new, resolved and re-rated findings; grade changes), with scope and method caveats instead of false "gone" or "new" entries; a grade history per domain and change rings on the graph

  • Printable report (light theme, A4) with executive summary, changes, graph, findings, appendix and methodology in Turkish or English; save it as PDF from the browser's print dialog

Collection tiers

Tier Description Default
0 — Passive Third-party data only, no contact with the target ✅ On
1 — Light touch DNS resolution; per host one TLS handshake (retried once if cut off) and at most 6 HTTP requests ✅ On
2 — Active DNS brute-force, permutations, one AXFR attempt per nameserver ❌ Off; chosen and confirmed per scan (only for verified domains with TIER2_REQUIRE_VERIFICATION=true)

ShadowSpace does not perform port scanning, directory brute-forcing, crawling or exploitation — not in Tier 2 either.

Tier 2 (active discovery)

Ownership verification is optional by default. With TIER2_REQUIRE_VERIFICATION=false (the default) Tier 2 can be started on any domain: the scan must still ask for Tier 2 and tick the consent box, the scope is the scanned name and the names below it, all limits apply, only one Tier 2 scan per registrable domain runs at a time, and the audit record and report say "not verified". You alone are legally responsible for the target (see Legal / Authorized use).

With TIER2_REQUIRE_VERIFICATION=true, Tier 2 runs only when all of these hold, checked by the API and again by the worker:

  1. The domain (or a parent of it) is verified under Settings → Verified domains: publish _shadowspace-challenge.<domain> TXT "shadowspace-verify=<token>" and press Verify. The record is read straight from the zone's authoritative nameservers (public addresses only; truncated UDP answers are retried over TCP). Only the SHA-256 digest of the token is stored. A pending token lasts 7 days, a verification 30 days.
  2. The scan was started with Tier 2 and the box "I own this domain or have written permission to test it" was ticked. A verification of sub.example.com allows Tier 2 only for sub.example.com and the names below it.
  3. Right before the Tier 2 steps run, the TXT record is read again. If it is gone, the verification is revoked and the scan continues with Tier 1 only (the scan page says so).
  4. No other Tier 2 scan of the same registrable domain is pending or running.

Using Tier 2, step by step

Legal: use Tier 2 only on domains you own or have written permission to test. The TXT record proves control of the zone, not legal authorisation. See Legal / Authorized use.

Without verification (default): on New investigation enter the domain, choose Tier 2 (marked "Ownership not verified — you carry full responsibility"), read the warning in the confirmation dialog, tick the box and start. Steps 5–7 below apply; steps 1–4 and 8 only matter with TIER2_REQUIRE_VERIFICATION=true (or to record a verification anyway).

  1. Open Settings → Verified domains → Manage, enter the domain and press Add domain.
  2. The page shows the TXT record once: name _shadowspace-challenge.<domain> and value shadowspace-verify=<token>, each with a copy button. Save the value now; only its hash is stored, so a lost value means generating a new token.
  3. In your DNS provider's panel (e.g. Cloudflare: DNS › Records › Add record; GoDaddy: DNS › Add new record) add a TXT record with that name and value. Panels that append the domain themselves only want _shadowspace-challenge. Propagation can take a few minutes.
  4. Press Verify. If it fails, the row says why in plain words (record not found yet, no public nameserver, …); wait and try again.
  5. On New investigation enter the domain and choose Tier 2. With TIER2_REQUIRE_VERIFICATION=true, the option is locked for an unverified, expired or revoked domain and links to the verification page.
  6. The confirmation dialog lists the methods (brute-force, permutations, AXFR), the expected number of queries, the rate limit and the estimated duration. The scan starts only after the ownership/permission box is ticked.
  7. While it runs, the scan page shows an Active scan (Tier 2) band and a Stop button (asks first; a stopped scan keeps partial results). Names found by Tier 2 carry brute-force, permutation or AXFR badges in the subdomain table and the graph.
  8. Keep the TXT record while you use Tier 2. If it is removed, the next Tier 2 scan says "Tier 2 did not run — the scan continued with Tier 1". Revoke on the verification page ends Tier 2 for the domain at once.

What Tier 2 does, all within TIER2_DNS_QPS (20 queries/s), TIER2_MAX_QUERIES (10,000) and TIER2_TIME_BUDGET_S (600 s) per scan:

  • DNS brute-force of <label>.<domain> (A queries through the normal resolver). Three random names are asked first; answers that match the zone's wildcard are not counted.
  • Permutations (dev-api, api-dev, dev.api) of names found with high confidence (by brute-force, AXFR, certificate logs or two independent sources), at most TIER2_MAX_PERMUTATIONS (3,000) candidates.
  • AXFR: one zone transfer attempt per authoritative nameserver, only for a zone whose apex is within the verified domain. A nameserver that hands out the zone is a finding (DNS-003, high).

Names found this way go through the same steps as all others (DNS verification, host selection, TLS/HTTP, subdomain rules). A scan can be stopped from its page; what it collected is kept. Each Tier 2 scan leaves an append-only audit record (verification, consent time, re-check, methods, query counts, duration, whether it was stopped) that is shown on the scan and in the report.

Brute-force queries use the system resolver rather than the zone's nameservers: answers match what users and the later steps see, CNAMEs leaving the zone are followed, and with DNSSEC the resolver can answer many non-existent names from cache instead of asking the target. A name created minutes earlier may still be cached as non-existent (up to the zone's negative TTL).

Own wordlist: set TIER2_WORDLIST to a file with one label per line (UTF-8, lines that are not valid labels are skipped). With Docker Compose, mount it into the backend and the worker, e.g. in a docker-compose.override.yml:

services:
  backend:
    volumes: ["./my-wordlist.txt:/wordlists/custom.txt:ro"]
    environment: { TIER2_WORDLIST: /wordlists/custom.txt }
  worker:
    volumes: ["./my-wordlist.txt:/wordlists/custom.txt:ro"]
    environment: { TIER2_WORDLIST: /wordlists/custom.txt }

The bundled lists are part of the image (backend/app/wordlists/, see its README for sources and licences). make tier2-demo runs the whole Tier 2 flow against two fake nameservers on 127.0.0.1 without touching the network; those servers can only be set in that script, never through the API or .env.

What a contacted host sees: http://host/, https://host/ and https://host/.well-known/security.txt, plus at most three redirect steps each, never leaving the registrable domain and never more than six requests per host. Only names with a live record and only public addresses are contacted, one connection per address at a time (three for addresses in the networks of Cloudflare, Akamai, Fastly, AWS, Azure or Google Cloud), with the User-Agent ShadowSpace/<version> (+PROJECT_URL). Certificates are not verified for this inspection (broken ones are findings); it sends no cookies or credentials and stores neither page bodies nor cookie values.

A TLS handshake that is reset or cut off before it completes is tried once more after 1–2 s; a completed one is never repeated, and timeouts and TLS alerts are not retried. If the connection was reset or cut, that one retry offers a smaller ClientHello (P-256 only, without the post-quantum key share, which makes the first one span two packets); the HTTP inspection does the same once per host when an HTTPS connection is reset before it is established, so no request is sent twice. Such results say so in their evidence, with what was agreed on. When more than a tenth of the connections to an address are reset, cut off or time out (judged from ten attempts on), that address goes back to one connection at a time.

Which hosts, when there are too many: the investigated name and www (looked up in DNS on every scan) first, then names that several independent sources report (the two certificate-log sources count as one), names with their own DNS record and single-source wildcard names. Up to a fifth of the limit, plus any places left over, goes to wildcard names that only the web archive knows (see below). Every address gets at least one host where possible, numbered families (node-1, node-2, …) take at most three places until all others had a chance, and wildcard names seen only in certificate logs use at most half of HTTP_HOST_LIMIT. SUBDOMAIN_MAX uses the same ranking and never drops www or multi-source names. A port that refuses a connection, or ignores two (5 s each), is not tried again for other names on that address; a port that connected once is never given up on.

Names only the web archive knows: behind a wildcard certificate such names never reach the certificate logs. They are ranked by their number of distinct archived URLs. For each wildcard the least archived one is the representative; every other answer is compared with it (certificate fingerprint, status codes, normalised bodies). Identical answers are marked as the default response and add nothing to findings; different ones are separate virtual hosts; incomplete ones stay unjudged. After five default answers in a row the wildcard's remaining archive names are not contacted (with three connections per address, up to two more may already be under way).

Certificate chains are followed to Mozilla's root list from the certifi package (its version is stored with the finding), so results do not depend on the machine; missing intermediates are not downloaded.

Developer setup (without Docker)

For working on the code: hot reload, tests and linters. To just run ShadowSpace, use the quick start above.

Requirements

  • uv (it installs Python 3.12 itself)
  • Node.js 22 and npm
  • PostgreSQL 14 or newer
  • Redis 6 or newer on 127.0.0.1:6379
  • make and setsid (util-linux): Linux or WSL

On Ubuntu / WSL, start the services with sudo service postgresql start && sudo service redis-server start.

1. Database and user

One user owns two databases: one for the app, one for the tests (the tests migrate it and roll back every change they make).

sudo -u postgres psql -c "CREATE USER shadowspace WITH PASSWORD 'change-me';"
sudo -u postgres createdb -O shadowspace shadowspace
sudo -u postgres createdb -O shadowspace shadowspace_test

2. Configuration

cp .env.example .env

In .env, set DATABASE_URL to the user and password from step 1: DATABASE_URL=postgresql+asyncpg://shadowspace:change-me@localhost:5432/shadowspace. The tests use the same URL with the database shadowspace_test; for another name, add TEST_DATABASE_URL=... to .env. Everything else works with the defaults. Variables set in the shell take priority over .env.

3. Install, migrate, run

(cd backend && uv sync)
(cd frontend && npm install)
make migrate      # create the tables (make dev also does this)
make dev          # API on :8000, worker, UI on http://localhost:5173

4. First scan

Open http://localhost:5173, enter a domain you are allowed to scan (for example example.com) and start. Progress updates live; a typical scan takes from a few seconds to a minute. The same works through the API:

curl -X POST localhost:8000/api/investigations \
  -H 'content-type: application/json' -d '{"domain":"example.com"}'

An error from a single third-party source (for example crt.sh with status 502) does not stop the scan; that source is listed with its error on the scan page.

Command What it does
make test Backend and frontend tests (offline; uses shadowspace_test and Redis database 15, which is flushed)
make perf Wall-clock benchmark (5,000 subdomains in < 5 s); kept out of make test because timing depends on the machine
make worker Run only the job worker (make dev already starts it)
make lint ruff, mypy, ESLint and TypeScript checks
make fmt Format the code
make types Regenerate frontend API types from the OpenAPI schema
make report-check Optional: print a report to PDF with headless Chromium and check the layout (see below)
make migrate Apply database migrations
make up Run the whole stack with Docker Compose (same as the quick start)

Investigations are queued in Redis and executed by one worker process. The worker does not reload on code changes; restart make dev after editing backend collectors or services.

Ctrl+C (or closing the terminal) stops everything make dev started, child processes included; whatever ignores SIGTERM for 5 seconds is killed. make dev does not start while another worker is running, and it never stops that worker itself. It needs setsid (util-linux: Linux or WSL).

Report print check (optional)

make report-check prints a scan's report to PDF with headless Chromium, checks that the pages are A4, that the main sections are there and that the toolbar is not printed, and saves PNG previews of the first pages. It is not part of make test. It needs make dev running and a Chrome or Chromium binary (found on PATH, in the Playwright cache, or set with CHROME=); pdfinfo, pdftotext and pdftoppm (poppler-utils) enable the checks and previews.

make report-check                                  # latest finished scan, Turkish
make report-check ID=<investigation id> REPORT_LANG=en

Output goes to report-check/ (ignored by git; set OUT= to change it).

Configuration

Settings are read from environment variables or .env; see backend/app/core/config.py.

Variable Default Purpose
DATABASE_URL postgresql+asyncpg://shadowspace@localhost:5432/shadowspace Main database
TEST_DATABASE_URL DATABASE_URL with database shadowspace_test Test database; migrated by the tests
REDIS_URL redis://127.0.0.1:6379/0 Job queue and source cache
REDIS_ALLOWED_HOSTS 127.0.0.1,localhost Accepted Redis hosts besides loopback addresses
TEST_REDIS_URL redis://127.0.0.1:6379/15 Must use database 15 and differ from REDIS_URL; flushed by tests
CERTSPOTTER_API_KEY empty Optional, for a higher rate limit
OTX_API_KEY empty Optional; without it AlienVault OTX is queried anonymously
SUBDOMAIN_CACHE_TTL_S 86400 How long source results are cached (0 disables)
SUBDOMAIN_MAX 10000 Most subdomains kept and verified per investigation
HTTP_HOST_LIMIT 100 Most hosts contacted (TLS and HTTP) per investigation
TIER2_REQUIRE_VERIFICATION false true: Tier 2 only on domains with verified ownership. false: no verification; you alone are responsible for the target
HTTP_MAX_RESPONSE_BYTES 5000000 Response size limit; inspected pages are cut there
PROJECT_URL https://github.com/KayraDev0/shadowspace Sent in the User-Agent
ALLOWED_HOSTS localhost,127.0.0.1 Accepted Host headers (DNS rebinding protection)
POSTGRES_PASSWORD none (required) Docker Compose only: database password
SHADOWSPACE_PORT 8080 Docker Compose only: UI port on 127.0.0.1

Frontend bundle size

npm run build warns that some chunks are larger than 500 kB. The warning is about raw (minified, not compressed) size and does not affect the first-load budget of 250 KB gzip: the entry chunk is ~183 KB gzip and, with CSS (~12 KB) and the dashboard page, the first load is about 210 KB. The other large chunk is Cytoscape (graph page only, ~175 KB gzip); Recharts (~108 KB gzip) loads after the page when a chart is shown. Both are loaded with import() only where used.

Third-party data sources

  • Shodan InternetDB (open ports, tags, CVEs per IP address; no key needed): Shodan states it is "free for non-commercial use" and that making money with the API needs an enterprise licence (https://internetdb.shodan.io/, checked 2026-11-27). The page says the data is updated weekly and states no rate limit; we found no separate terms-of-service document linked from it. If you use ShadowSpace commercially, get the licence first. Port and CVE data is not verified by ShadowSpace.
  • Team Cymru IP-to-ASN (DNS): https://www.team-cymru.com/ip-asn-mapping.

Bundled wordlists

File Source Licence
backend/app/wordlists/subdomains-top2000.txt SecLists subdomains-top1million-5000.txt, trimmed MIT
backend/app/wordlists/permutation-words.txt altdns words.txt Apache-2.0

Licence texts: backend/app/wordlists/LICENSE-*; see also THIRD_PARTY_NOTICES.md. GPL-licensed lists are not bundled.

Third-party libraries

Not a complete list (see frontend/package.json and backend/pyproject.toml); these are the ones added for the relationship graph, loaded only by the graph page:

Package Version License
cytoscape 3.35.0 MIT
cytoscape-fcose 2.2.0 MIT
cose-base (dependency of fcose) 2.2.0 MIT
layout-base (dependency of cose-base) 2.0.1 MIT

Security notes

  • The API has no authentication. Run it on your own machine only and do not expose it to a network. ALLOWED_HOSTS restricts the accepted Host header (DNS rebinding protection).
  • Outbound connections to private, loopback, link-local and reserved addresses are blocked when the connection is made.
  • Subfinder runs as a separate program (passive mode, rate and time limited), so its requests do not pass through ShadowSpace's HTTP client.
  • A real record that points to the same address as a wildcard is also reported as wildcard.
  • DNSSEC is checked for presence only; signatures are not validated.
  • A DKIM key that is not found under common selectors may still exist under another name.

⚖️ Legal / Authorized use

ShadowSpace is intended for security research, education, and assessing domains you own or are explicitly authorized to assess. Users are solely responsible for complying with applicable laws and the terms of service of the data sources used.

Tier 2 (active discovery) sends many DNS queries and zone transfer requests to the target's nameservers. Use it only for domains you own or have written permission to test, and only within the scope of that permission. By default (TIER2_REQUIRE_VERIFICATION=false) ShadowSpace does not check ownership before Tier 2: ticking the confirmation box is your statement that you have that permission, and you alone are responsible for it. Even when required, the DNS TXT verification only shows control of the zone at one point in time; it is not a legal authorisation. Unauthorised active reconnaissance may be illegal in your country and may breach your provider's terms. Keep the audit record and your written permission together. Port scanning, directory scanning, crawling and exploitation are not part of ShadowSpace.

This software is provided "as is", without warranty of any kind.

License

MIT

About

Passive OSINT & attack surface intelligence for domains — not just what is exposed, but what it means.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages