SafeSurf is a privacy and browsing safety environment for defensive everyday use. It provides a persistent command shell for checking website reputation, cleaning URLs, launching a browser with safer defaults, reviewing exposure lookups, managing shell-native settings and profiles, and exporting reports.
The project is intentionally plain. It behaves like a practical command shell instead of a dashboard or themed terminal UI. Output is text-first, readable, and structured for daily use.
SafeSurf is built around a few core ideas:
- Keep the interaction shell-like and low-friction.
- Prefer realistic checks and honest limitations over dramatic claims.
- Treat privacy features as risk reduction, not anonymity guarantees.
- Store useful history and reports so the shell becomes an operational workspace.
- Interactive shell loop with plain prompt and persistent line history
- Website scanning with URL normalization and trust scoring
- DNS, SSL, redirect, header, tracking, WHOIS, and heuristic analysis
- Public breach reputation analysis with local and remote catalog matching
- URL cleaning with tracker removal and clipboard copy support
- Integrated browser window connected to the shell, with navigation controls and session tracking
- External Chromium-based browser launching as a fallback mode
- Leak lookup support for defensive informational checks
- Local threat-feed refresh command for blacklist and breach catalogs
- Nested settings management entirely from inside the shell
- Named SafeSurf behavior profiles
- Persistent SQLite history and saved report files
SafeSurf/
|-- main.py
|-- launcher.py
|-- requirements.txt
|-- README.md
|-- config/
| |-- settings.json
| |-- defaults.json
| |-- profiles.json
| `-- browser_profiles.json
|-- core/
| |-- __init__.py
| |-- shell.py
| |-- command_router.py
| |-- parser.py
| |-- app_state.py
| |-- logger.py
| |-- settings_manager.py
| |-- profile_manager.py
| |-- browser_launcher.py
| |-- output.py
| `-- utils.py
|-- commands/
| |-- __init__.py
| |-- scan.py
| |-- browser.py
| |-- clean.py
| |-- feeds.py
| |-- leaks.py
| |-- history.py
| |-- reports.py
| |-- settings.py
| |-- profiles.py
| |-- help_cmd.py
| `-- system.py
|-- modules/
| |-- __init__.py
| |-- site_reputation.py
| |-- dns_tools.py
| |-- ssl_tools.py
| |-- whois_tools.py
| |-- headers_analysis.py
| |-- redirects_analysis.py
| |-- tracking_analysis.py
| |-- url_cleaner.py
| |-- leak_checker.py
| |-- public_breach_checker.py
| |-- scoring.py
| |-- threat_feeds.py
| `-- report_builder.py
|-- services/
| |-- __init__.py
| |-- api_clients.py
| |-- cache.py
| |-- validators.py
| `-- storage.py
|-- ui/
| |-- __init__.py
| `-- integrated_browser.py
`-- data/
|-- history.db
|-- reports/
|-- sessions/
`-- cache/
- Python 3.12+
- PySide6 for the integrated browser window
- A Chromium-based browser is optional as a fallback mode
- Network access for live site scans and leak lookups
Install dependencies:
pip install -r requirements.txtRun the interactive shell from the project root:
python main.pyor:
python launcher.pyExpected startup:
SafeSurf Shell
Type 'help' for commands.
C:\Users\<username> ~ SafeSurf >
Examples:
scan https://example.com
scan --full https://example.com
clean https://example.com/?utm_source=test&fbclid=abc
clean --copy --explain https://example.com/?utm_source=test
browser https://example.com
browser --profile hardened https://example.com
browser --blank
browser --detach https://example.com
feeds refresh
leaks lookup someone@example.com
settings list
settings set browser.incognito true
profile use strict
history list
report export last --format mdScans a URL or domain, normalizes it, runs trust and privacy checks, and computes a score.
Options:
--fullincludes technical findings and score breakdown--no-whoisdisables WHOIS lookup for this scan--no-headersdisables header analysis for this scan--no-ssldisables SSL inspection for this scan--no-dnsdisables DNS lookup for this scan--jsonprints raw structured output
Launches the SafeSurf integrated browser by default. The shell waits for the browser window to close, then returns to the prompt with the session recorded. If integrated mode is unavailable and fallback is enabled, SafeSurf can fall back to an external browser.
Options:
--profile NAMEuse a named browser profile fromconfig/browser_profiles.json--blanklaunchabout:blank--temp-profileforce a temporary user data directory--incognitoforce incognito mode--directbypass the scan gate if allowed by settings--scanforce a prelaunch scan--detachrequests a detached session; in integrated mode SafeSurf falls back to an external browser if fallback is enabled
Removes common tracking parameters and normalizes a URL.
Options:
--copycopy the cleaned URL to the clipboard when possible--explainshow removed parameters and HTTPS suggestion--previewshow the cleaned target prominently--jsonprint structured output
Performs defensive informational exposure lookups.
Subcommands:
leaks lookup [--source auto|leakcheck|xon] <value>leaks history
Refreshes SafeSurf's local threat feeds from public catalog sources.
Options:
refreshupdates local feed files--blacklistrefresh only the SafeSurf blacklist underextra/safesurf-bl.txt--breachesrefresh only the local breach catalog underextra/safesurf_breachreputation.txt--jsonprints structured output
Works with persistent command history stored in SQLite.
Subcommands:
history listhistory show <ref>history search <term>history delete <id>history clear
Exports or displays reports from history or previously saved report records.
Subcommands:
report listreport show <ref>report export <ref> [--format txt|md|json]
Manages nested configuration from inside the shell.
Examples:
settings list
settings get browser.incognito
settings set browser.incognito true
settings set scan.timeout 15
settings reset browser
settings export
settings import settings.export.json
settings reloadApplies grouped SafeSurf behavior presets.
Built-in profiles:
defaultstrictminimalresearchprivate
Examples:
profile list
profile use strict
profile create research2
profile clone strict safer
profile show privatehelpclearreloadexitquitbackhome
SafeSurf settings are stored in JSON and merged from defaults plus user overrides. Core sections include:
shellscanscoringbrowserleaksreportshistoryloggingclipboard
The shell exposes these settings through settings get, settings set, settings reset, settings export, and settings import.
Useful integrated-browser settings:
browser.ui_themesupportsocean,graphite,sand,midnight,forest,ember,slate,ice,olive, orrosebrowser.show_activity_panelenables the live SafeSurf activity panelbrowser.inspect_page_sourceenables HTML source inspection after page loadbrowser.block_suspicious_sourceblocks pages whose source looks suspiciousbrowser.redact_detected_indicatorskeeps suspicious endpoint indicators partially redactedbrowser.silence_js_consolehides noisy page console warnings from the terminalbrowser.log_to_shellmirrors browser activity logs into the shell in real timebrowser.security_levelcontrols the integrated browser hardening levelleaks.enable_public_breach_historytoggles public domain breach-history matching during scansbrowser.block_private_networkblocks localhost,.local, and private-network IP targetsbrowser.block_raw_ip_hostsblocks direct raw-IP browsing targetsbrowser.block_dangerous_schemesblocks non-web schemes such asfile:,data:, orjavascript:browser.block_suspicious_portsblocks navigation to higher-risk portsbrowser.https_only_modeoptionally denies plain HTTP navigation
Browser launch profiles define runtime behavior such as:
- incognito mode
- temporary profile usage
- extension disabling
- sync disabling
- background networking limits
- speculative prefetch limits
- blank startup behavior
- prelaunch scan requirement
- custom Chromium flags
In integrated mode, SafeSurf uses an embedded Qt WebEngine browser window with:
- back, forward, reload, home, and address bar controls
- a SafeSurf home screen
- session-level visited URL tracking
- real-time SafeSurf activity panel inside the browser window
- toolbar buttons with local SVG icons
- in-browser
Settingspage viasafesurf://settings - one-click log panel show/hide from the toolbar
- source inspection for suspicious collection or exfiltration behavior
- popup blocking and stricter in-browser security defaults
- private-network and raw-IP destination blocking
- permission denial for sensitive browser features unless explicitly relaxed in settings
- a dedicated
Blocked by SafeSurfpage with findings and indicators - shell return after the browser window is closed
- optional fallback to an external browser
These profiles change browser behavior only. They do not provide anonymity, sandboxing, or guaranteed tracking prevention.
Reports are stored under data/reports/ and can be exported as:
- plain text
- Markdown
- JSON
Reports are derived from stored command details, so scans, browser launches, cleaned URLs, and leak lookups can all be turned into saved artifacts.
SafeSurf uses SQLite in data/history.db to persist:
- scans
- cleaned URLs
- browser launches
- leak lookups
- timestamps
- scores
- classifications
- profile information
SafeSurf is designed for defensive and informational use only. It does not perform offensive actions, bypass protections, exploit targets, or provide anonymity guarantees. Exposure lookup support is intended for legal, authorized self-checks or organizational defensive workflows.
- Live scan quality depends on network reachability and third-party responses.
- WHOIS availability varies by TLD and registrar.
- Integrated browser mode depends on PySide6 Qt WebEngine support being available.
- External fallback mode depends on an installed Chromium-based browser.
- Leak lookup endpoints may change behavior or rate-limit requests over time.
- This shell reduces browsing risk but cannot determine trust with certainty.
- More detailed browser profile management commands from inside the shell
- Optional confirmation prompts for destructive history actions
- Better pager integration for very long technical results
- Configurable command aliases stored in settings
- Optional offline domain reputation lists
- More granular report templates