Skip to main content

A Python module for detecting Incognito mode and monitoring browser search queries

Project description

StealthMon 🕵️‍♂️🔍

Detect Incognito Mode & Monitor Browser Search Queries

Overview

StealthMon is a Python module that helps detect whether a browser is running in Incognito/Private mode and monitors search queries from the system. It is designed for privacy monitoring, parental control, cybersecurity research, and system audits.

Features

Detect Incognito Mode – Identify when browsers like Chrome, Firefox, Edge, Brave, or Opera are running in private mode. ✅ Monitor Search Queries – Track user searches made on Google, Bing, DuckDuckGo, and more. ✅ Alert System – Configurable alerts when specific queries are detected. ✅ Multi-Threading Support – Efficient monitoring with background threads. ✅ Visual Notifications – Optional UI components for alerts and notifications. ✅ Cross-Platform – Works on Windows & Linux (Mac support coming soon). ✅ Lightweight & Easy to Use – Simple Python module with clear API.

Use Cases

🔹 Parental Control – Keep track of Incognito browsing on a child's system. 🔹 Cybersecurity & Monitoring – Detect stealth browsing behavior in workplaces or shared systems. 🔹 Forensics & Investigations – Useful for analyzing browser activity on compromised systems.

Installation

pip install stealthmon

Or install from source:

git clone https://github.com/yourusername/stealthmon
cd stealthmon
pip install -e .

Dependencies

StealthMon requires the following dependencies:

  • Python 3.7+
  • psutil
  • pywin32 (Windows only)
  • tkinter (for UI components)
  • pygame (for sound alerts)

Quick Start

# You can use either StealthMon or StealthMonitor (they're the same)
from stealthmon import StealthMon
# or
from stealthmon import StealthMonitor

# Initialize the monitor
monitor = StealthMon()

# Check for incognito mode for a specific browser
is_chrome_incognito = monitor.check_browser("chrome")
print(f"Chrome: {'Incognito Mode' if is_chrome_incognito else 'Normal Mode'}")

# Check all browsers
for browser in ["chrome", "firefox", "edge", "opera"]:
    try:
        is_incognito = monitor.check_browser(browser)
        print(f"{browser}: {'Incognito Mode' if is_incognito else 'Normal Mode'}")
    except Exception as e:
        print(f"{browser}: Error - {str(e)}")

# Start monitoring with a callback function
def handle_results(results, queries):
    # results = dict of browser -> incognito status
    for browser, is_incognito in results.items():
        if is_incognito:
            print(f"Incognito detected: {browser}")
    
    # queries = dict of browser -> query data
    for browser, data in queries.items():
        for query_data in data.get('queries', []):
            query = query_data.get('query', '')
            engine = query_data.get('engine', '')
            print(f"Search query detected: {query} on {engine}")

# Start continuous monitoring with 1 second interval
monitor.start(interval=1.0, callback=handle_results)

# To stop monitoring
# monitor.stop()

Using Simplified API

# You can also use the simplified API functions
from stealthmon import create_monitor, stop_monitoring

# Start monitoring with default settings (checks all browsers every 1 second)
results = create_monitor()

# Or customize the monitoring
def handle_results(results, queries):
    # Process monitoring results
    pass

results = create_monitor(browser="chrome", interval=2.0, callback=handle_results)

# Later, stop the monitoring
stop_monitoring()

Advanced Usage

Tracking Specific Search Queries

from stealthmon import StealthMon

# Initialize with configuration
monitor = StealthMon()

# Define a callback function that filters specific queries
def handle_results(results, queries):
    for browser, data in queries.items():
        for query_data in data.get('queries', []):
            query = query_data.get('query', '').lower()
            if "python tutorial" in query:
                print(f"Educational search detected: {query}")

# Start monitoring with the callback
monitor.start(callback=handle_results)

Customizing Detection Behavior

from stealthmon import StealthMon

# Custom configuration
config = {
    "browsers_to_monitor": ["chrome", "firefox", "edge"],
    "check_interval": 3,  # seconds
    "search_engines": {
        "google": {
            "domain_patterns": ["google.com"],
            "title_pattern": r"(.+) - Google Search"
        },
        "bing": {
            "domain_patterns": ["bing.com"],
            "title_pattern": r"(.+) - Bing"
        }
    }
}

# Initialize with custom config
monitor = StealthMon(config=config)

# Start monitoring
monitor.start()

Command Line Interface

StealthMon also includes a command-line interface:

# Check all browsers once
stealthmon --once

# Monitor specific browser continuously
stealthmon --browser chrome

# Set custom interval
stealthmon --interval 2.5

# Quiet mode (no continuous display)
stealthmon --quiet

Error Handling

StealthMon includes robust error handling for various scenarios:

  • Browser detection failures
  • Privilege or permission issues
  • Missing dependencies
  • Platform compatibility issues

Contributing

We welcome contributions! If you want to enhance the project, feel free to submit issues and pull requests.

License

MIT License - See LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stealthmon-3.2.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stealthmon-3.2.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file stealthmon-3.2.1.tar.gz.

File metadata

  • Download URL: stealthmon-3.2.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stealthmon-3.2.1.tar.gz
Algorithm Hash digest
SHA256 0b59697849c6e6a95f4ee751123a542efb2a096841533eeb55f4240d83879cbb
MD5 ed24101bd3cdf695bcae3e19dbb38d46
BLAKE2b-256 e3974a450313a029dc6bd7e42671af0737b098d7b55dd4f0ccf0a511ea9c3bc6

See more details on using hashes here.

File details

Details for the file stealthmon-3.2.1-py3-none-any.whl.

File metadata

  • Download URL: stealthmon-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stealthmon-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad6dbd6c479a8f90db40cc434b7abffbf7b79c2a4f9931fab033c019ba634969
MD5 d250f32e00537bf084bdc5ec97f59cfb
BLAKE2b-256 a74e72be8ee00096c38140d4b4261190cc885440920b66592d304759439d55ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page