### Install Maigret Globally Source: https://github.com/krishpranav/maigret/blob/master/README.md Install the Maigret tool globally on your system using Cargo. This makes the `maigret` command available from any directory. ```bash cargo install --path . ``` -------------------------------- ### Basic Username Scan with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Scan a single username across all supported sites. Ensure Maigret is installed and in your PATH. ```bash # Basic username scan across all 2000+ sites maigret johnsmith ``` -------------------------------- ### Screenshot Capture with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Capture screenshots of found profiles by using the --screenshot flag. Requires Chrome version 60 or higher to be installed. ```bash # Capture screenshots of found profiles (requires Chrome 60+) maigret johnsmith --screenshot ``` -------------------------------- ### Screenshot Capture with Headless Chrome in Rust Source: https://context7.com/krishpranav/maigret/llms.txt Captures screenshots of profiles using headless Chrome automation. Requires initialization with resolution, timeout, and user-agent, followed by setup to locate the browser. Saves screenshots to `screenshots//.png`. Requires `crate::chrome::{Chrome, take_screenshot}`. ```rust use crate::chrome::{Chrome, take_screenshot}; use std::sync::Arc; // Initialize Chrome with configuration let mut chrome = Chrome::new( "1024x768".to_string(), // resolution 60, // timeout in seconds "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36".to_string() // user-agent ); // Setup Chrome (locates Chrome/Chromium v60+ on the system) // Searches common paths: /usr/bin/chromium, /usr/bin/google-chrome, etc. chrome.setup()?; let chrome = Arc::new(chrome); // Take a screenshot of a profile // Saves to: screenshots//.png take_screenshot( "torvalds", // username (creates folder) "GitHub", // site name "https://github.com/torvalds", // URL to screenshot &chrome // Chrome instance )?; // Output: screenshots/torvalds/github.com.png ``` -------------------------------- ### Scan Specific Site Source: https://github.com/krishpranav/maigret/blob/master/README.md Limit the scan to a single specified site using the `--site` flag followed by the site name. For example, to only check GitHub. ```bash maigret user --site github ``` -------------------------------- ### Interpret ScanResult Status Source: https://context7.com/krishpranav/maigret/llms.txt Shows how to get a formatted status tag and check if a profile was found using the `is_found()` method on ResultStatus. ResultStatus includes variants like Confirmed, Likely, NotFound, Error, etc. ```rust // Get formatted status tag for display let tag = result.status_tag(); // Output: "[CONFIRMED] (confidence: 0.95)" or "[NOT_FOUND]" // Check if result indicates a found profile if result.status.is_found() { // Matches: Confirmed, Likely, Private println!("Profile found!"); } ``` -------------------------------- ### Build Maigret from Source Source: https://github.com/krishpranav/maigret/blob/master/README.md Clone the repository, navigate to the directory, and build the release version using Cargo. The binary will be located in `./target/release/maigret`. ```bash git clone https://github.com/krishpranav/maigret cd maigret cargo build --release ``` -------------------------------- ### Display Help Message Source: https://github.com/krishpranav/maigret/blob/master/README.md Show the full help message, listing all available commands, flags, and their descriptions. This is useful for understanding all of Maigret's capabilities. ```bash maigret --help ``` -------------------------------- ### Initialize and Use IntelligentScraper in Rust Source: https://context7.com/krishpranav/maigret/llms.txt Demonstrates initializing the IntelligentScraper with optional Tor support and defining site data for username checking. Requires importing necessary modules. ```rust use crate::scraper::{IntelligentScraper, ScrapingStrategy}; use crate::core::SiteData; use std::sync::Arc; // Create a new intelligent scraper with optional Tor support let use_tor = false; let proxy_pool = Vec::new(); let scraper = Arc::new(IntelligentScraper::new(use_tor, proxy_pool)?); // Define site data for checking let site_data = SiteData { error_type: "status_code".to_string(), error_msg: String::new(), url: "https://github.com/{}".to_string(), url_main: "https://github.com".to_string(), url_probe: String::new(), error_url: String::new(), username_claimed: "torvalds".to_string(), username_unclaimed: "randomuser123456789xyz".to_string(), regex_check: String::new(), }; // Check a username with a specific strategy let result = scraper.check_username_intelligent( "torvalds", // username to check "GitHub", // site name &site_data, // site configuration false, // use_tor ScrapingStrategy::Fast // scraping strategy: Fast, Stealth, or AntiBlock ).await; // Result contains: // - result.exist: bool - whether the username was found // - result.link: String - URL of the profile if found // - result.status: ResultStatus - Confirmed, Likely, NotFound, Blocked, etc. // - result.confidence: f32 - confidence score (0.0-1.0) // - result.error: bool - whether an error occurred // - result.error_msg: String - error message if any if result.exist { println!("Found: {} (confidence: {:.2})", result.link, result.confidence); } // Get scraper statistics after scanning let stats = scraper.get_stats(); println!("Total requests: {}", stats.total_requests); println!("Blocked: {}", stats.blocked_count); println!("Cloudflare detected: {}", stats.cloudflare_detected); ``` -------------------------------- ### Use Custom Database with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Specify a custom database file for scanning using the --database option. Provide the full path to your JSON database file. ```bash # Use a custom database file maigret johnsmith --database /path/to/custom/data.json ``` -------------------------------- ### Site Database Management in Rust Source: https://context7.com/krishpranav/maigret/llms.txt Loads and filters a large database of site configurations. Supports loading from a local file or forcing an update from the Sherlock project repository. Requires `crate::core::{load_site_data, filter_sites, SiteDatabase}`. ```rust use crate::core::{load_site_data, filter_sites, SiteDatabase}; // Load site data from default location (downloads from Sherlock if needed) let database: SiteDatabase = load_site_data("data.json", false).await?; println!("Loaded {} sites", database.len()); // Force update from Sherlock project repository let database = load_site_data("data.json", true).await?; // Filter sites by name (case-insensitive) let github_only = filter_sites(&database, Some("github")); // Returns HashMap with only matching sites // Get all sites (no filter) let all_sites = filter_sites(&database, None); // Access site data for (site_name, site_data) in database.iter() { println!("Site: {} - URL pattern: {}", site_name, site_data.url); println!(" Error type: {}", site_data.error_type); println!(" Claimed username: {}", site_data.username_claimed); println!(" Unclaimed username: {}", site_data.username_unclaimed); } ``` -------------------------------- ### Capture Screenshots of Profiles Source: https://github.com/krishpranav/maigret/blob/master/README.md Enable screenshot capture for found profiles using the `--screenshot` flag. Screenshots will be saved in the `screenshots//` directory. ```bash maigret user --screenshot ``` -------------------------------- ### Test Mode for Site Configurations Source: https://github.com/krishpranav/maigret/blob/master/README.md Run Maigret in test mode using the `--test` flag. This validates the site configurations in the database without performing actual username scans. ```bash maigret --test ``` -------------------------------- ### Initialize Maigret Logger Source: https://context7.com/krishpranav/maigret/llms.txt Initializes the Logger with options for color output and verbosity. Set `no_color` to `true` to disable colors and `verbose` to `true` to show all messages, including 'not found' and errors. ```rust use crate::logger::Logger; use crate::scraper::ScraperStats; use std::time::Duration; // Create logger instance let logger = Logger::new( false, // no_color: false = colors enabled true // verbose: show all messages including "not found" ); ``` -------------------------------- ### Scan Specific Site with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Limit the scan to a single specified website using the --site option. Replace 'github' with the desired site name. ```bash # Scan specific site only maigret johnsmith --site github ``` -------------------------------- ### Run Site Validation Tests with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Execute site validation tests to check the integrity and configuration of the site database. This is useful for debugging or custom database creation. ```bash # Run site validation tests maigret --test ``` -------------------------------- ### Log Scan Summary with Logger Source: https://context7.com/krishpranav/maigret/llms.txt Logs a summary of the scan, including the number of profiles found, total sites checked, and elapsed time. This provides a concise overview of the scan's completion. ```rust // Print scan summary logger.print_summary( 12, // found count 2300, // total sites checked Duration::from_secs_f64(3.2) // elapsed time ); // Output: // ═══════════════════════════════════════ // 🧠 SCAN COMPLETE // ═══════════════════════════════════════ // Found: 12 // Checked: 2300 // Time: 3.20s // ═══════════════════════════════════════ ``` -------------------------------- ### Download Profile Content with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Download content from supported sites, such as Instagram profile data, using the --download flag. This feature allows for data collection. ```bash # Download profile content from supported sites maigret johnsmith --download ``` -------------------------------- ### Create and Update ScanResult Source: https://context7.com/krishpranav/maigret/llms.txt Demonstrates creating a new ScanResult and updating its status to Confirmed, NotFound, or Error. Use this to manage the outcome of a username scan on a specific site. ```rust use crate::core::{ScanResult, ResultStatus, ConfidenceScore}; // Create a new scan result let mut result = ScanResult::new("torvalds".to_string(), "GitHub".to_string()); // Mark as found with confidence result = result.found( "https://github.com/{}".to_string(), // url pattern "https://github.com/torvalds".to_string(), // actual link ResultStatus::Confirmed, // status 0.95 // confidence (0.0-1.0) ); // Mark as not found result = ScanResult::new("randomuser".to_string(), "GitHub".to_string()) .not_found( "https://github.com/randomuser".to_string(), ResultStatus::NotFound, 0.90 ); // Mark as error result = ScanResult::new("user".to_string(), "Site".to_string()) .with_error("Connection timeout".to_string(), ResultStatus::Error); ``` -------------------------------- ### Logger Utility Source: https://context7.com/krishpranav/maigret/llms.txt The Logger utility provides professional CLI output, including colored formatting, progress tracking, and intelligence reporting. ```APIDOC ## Logger Utility ### Description Handles formatted console output for scan progress, results, and final intelligence reports. ### Key Methods - **print_banner**: Displays the investigation header. - **print_found_with_confidence**: Logs a successful match with confidence score. - **print_blocked**: Logs a blocked request (e.g., rate limit). - **print_summary**: Displays the final scan statistics (found count, total checked, elapsed time). - **print_intelligence_summary**: Displays a detailed report including scraper statistics like fastest/slowest sites and Cloudflare detections. ``` -------------------------------- ### Download Profile Content Source: https://github.com/krishpranav/maigret/blob/master/README.md Download the content of found profiles from supported websites using the `--download` flag. This feature is available for sites like Instagram. ```bash maigret user --download ``` -------------------------------- ### Adaptive Strategy Scanning in Rust Source: https://context7.com/krishpranav/maigret/llms.txt Automatically retries scans with different strategies (Fast, Stealth, AntiBlock) upon encountering errors. Includes exponential backoff between retries. Requires `crate::scraper::check_with_adaptive_strategy` and `crate::core::SiteData`. ```rust use crate::scraper::{check_with_adaptive_strategy, IntelligentScraper}; use crate::core::SiteData; use std::sync::Arc; let scraper = Arc::new(IntelligentScraper::new(false, Vec::new())?); let site_data = SiteData { error_type: "message".to_string(), error_msg: "Page not found".to_string(), url: "https://twitter.com/{}".to_string(), url_main: "https://twitter.com".to_string(), url_probe: String::new(), error_url: String::new(), username_claimed: "twitter".to_string(), username_unclaimed: "nonexistentuser1234567".to_string(), regex_check: String::new(), }; // Adaptive scan with automatic retry on failure // - Starts with Fast strategy // - On error, retries with Stealth (random user-agent) // - On second error, retries with AntiBlock // - Adds exponential backoff delay between retries let result = check_with_adaptive_strategy( &scraper, "elonmusk", // username "Twitter", // site name &site_data, // site configuration false, // use_tor 2 // max_retries ).await; match result.status { ResultStatus::Confirmed => println!("Profile confirmed at {}", result.link), ResultStatus::Likely => println!("Profile likely exists at {}", result.link), ResultStatus::NotFound => println!("Username not found"), ResultStatus::Blocked => println!("Request was blocked: {}", result.error_msg), ResultStatus::Error => println!("Error: {}", result.error_msg), _ => {} } ``` -------------------------------- ### Update Maigret Site Database CLI Source: https://context7.com/krishpranav/maigret/llms.txt Update the tool's site database to the latest version from the Sherlock project using the --update flag. This ensures accurate scanning. ```bash # Update the site database from Sherlock project maigret johnsmith --update ``` -------------------------------- ### Scan Multiple Usernames with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Perform scans for multiple usernames in a single command execution. This is useful for batch analysis. ```bash # Scan multiple usernames in a single run maigret johnsmith janedoe hacker42 ``` -------------------------------- ### Log Scan Events with Logger Source: https://context7.com/krishpranav/maigret/llms.txt Provides functions to log various scan events, including banners, found/not found profiles, blocked requests, and errors. Use these to give users real-time feedback during the scanning process. ```rust // Print scan banner logger.print_banner("torvalds"); // Output: 🔎 Investigating torvalds on: // Print found profile with confidence logger.print_found_with_confidence( "GitHub", "https://github.com/torvalds", "[CONFIRMED] (confidence: 0.95)" ); // Output: [+] GitHub: https://github.com/torvalds [CONFIRMED] (confidence: 0.95) // Print not found (only shown in verbose mode) logger.print_not_found("Pinterest"); // Output: [-] Pinterest: Not Found! // Print blocked request logger.print_blocked("Twitter", "Rate limited"); // Output: [⊗] Twitter: BLOCKED: Rate limited // Print error (only shown in verbose mode) logger.print_error("SomeSite", "Connection timeout"); // Output: [!] SomeSite: ERROR: Connection timeout // Print info/warning/success messages logger.print_info("Loading site database..."); logger.print_warning("Tor not detected, using direct connection"); logger.print_success("Scan complete!"); ``` -------------------------------- ### Verbose Output Scan Source: https://github.com/krishpranav/maigret/blob/master/README.md Run a scan with verbose output enabled using the `-v` or `--verbose` flag. This will display sites where the username was not found. ```bash maigret user -v ``` -------------------------------- ### Content Downloader for Instagram in Rust Source: https://context7.com/krishpranav/maigret/llms.txt Downloads profile content, specifically profile pictures and recent posts, from supported sites like Instagram. Uses a `DownloaderRegistry` to manage downloaders. Saves content to `downloads///`. Requires `crate::downloader::DownloaderRegistry`. ```rust use crate::downloader::DownloaderRegistry; use std::sync::Arc; // Create downloader registry with built-in site support let registry = DownloaderRegistry::new(); // List available downloaders let available = registry.list_available(); println!("Supported sites for download: {:?}", available); // Output: ["instagram"] // Download content from a specific site // For Instagram: downloads profile picture and recent posts // Saves to: downloads/// registry.download( "Instagram", // site name "https://instagram.com/username", // profile URL "username" // username ).await?; // Output directory structure: // downloads/ // └── username/ // └── instagram/ // ├── 0.jpg (profile picture) // ├── 1.jpg (post 1) // ├── 2.mp4 (video post) // └── ... ``` -------------------------------- ### Implement Concurrent Scanning with Tokio Semaphores Source: https://context7.com/krishpranav/maigret/llms.txt Uses a semaphore to limit the number of concurrent asynchronous tasks during site reconnaissance. Requires the tokio runtime and appropriate site data structures. ```rust use crate::core::{load_site_data, filter_sites}; use crate::scraper::{check_with_adaptive_strategy, IntelligentScraper}; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; use tokio::sync::Semaphore; #[tokio::main] async fn main() -> anyhow::Result<()> { let database = load_site_data("data.json", false).await?; let sites = filter_sites(&database, None); let scraper = Arc::new(IntelligentScraper::new(false, Vec::new())?); // Control concurrency: 32 workers default, 8 with screenshots let semaphore = Arc::new(Semaphore::new(32)); let found_count = Arc::new(AtomicUsize::new(0)); let mut tasks = Vec::new(); for (site_name, site_data) in sites.iter() { let username = "torvalds".to_string(); let site_name = site_name.clone(); let site_data = site_data.clone(); let scraper = Arc::clone(&scraper); let semaphore = Arc::clone(&semaphore); let found_count = Arc::clone(&found_count); let task = tokio::spawn(async move { // Acquire semaphore permit to limit concurrent requests let _permit = semaphore.acquire().await.unwrap(); let result = check_with_adaptive_strategy( &scraper, &username, &site_name, &site_data, false, 2 ).await; if result.exist { found_count.fetch_add(1, Ordering::SeqCst); println!("[+] {}: {}", site_name, result.link); } }); tasks.push(task); } // Wait for all tasks to complete for task in tasks { let _ = task.await; } let found = found_count.load(Ordering::SeqCst); println!("Found {} profiles across {} sites", found, sites.len()); Ok(()) } ``` -------------------------------- ### Scan Multiple Usernames Source: https://github.com/krishpranav/maigret/blob/master/README.md Scan for multiple usernames in a single command. Provide a space-separated list of usernames after the `maigret` command. ```bash maigret krishpranav blue red ``` -------------------------------- ### Basic Username Scan Source: https://github.com/krishpranav/maigret/blob/master/README.md Perform a basic scan for a single username. Maigret will check this username against all supported platforms. ```bash maigret krishpranav ``` -------------------------------- ### Log Intelligence Summary with Logger Source: https://context7.com/krishpranav/maigret/llms.txt Logs a detailed intelligence report including confirmed/likely counts, blocked requests, Cloudflare detections, and fastest/slowest site statistics. This requires ScraperStats to be populated. ```rust // Print intelligence summary with scraper statistics let stats = ScraperStats { total_requests: 2300, blocked_count: 15, cloudflare_detected: 45, fastest_site: Some(("GitHub".to_string(), Duration::from_millis(120))), slowest_site: Some(("SomeSlowSite".to_string(), Duration::from_secs(8))), }; logger.print_intelligence_summary(10, 2, 15, &stats); // Output: // ─────────────────────────────────────── // 🎯 INTELLIGENCE REPORT // ─────────────────────────────────────── // Confirmed: 10 // Likely: 2 // Blocked: 15 // Cloudflare: 45 // Fastest: GitHub (0.12s) // Slowest: SomeSlowSite (8.00s) // ─────────────────────────────────────── ``` -------------------------------- ### Update Site Database Source: https://github.com/krishpranav/maigret/blob/master/README.md Update the internal site database used by Maigret. This ensures you have the latest site configurations for accurate scanning. ```bash maigret user --update ``` -------------------------------- ### Verbose Scan Output with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Use the -v flag for verbose output, which includes displaying results for usernames that were not found. This is helpful for detailed logging. ```bash # Scan with verbose output (shows "Not Found" results) maigret johnsmith -v ``` -------------------------------- ### Scan with Tor Proxy Source: https://github.com/krishpranav/maigret/blob/master/README.md Perform a scan using the Tor network for increased anonymity. Ensure Tor is running on the default address `127.0.0.1:9050` and use the `--tor` flag. ```bash maigret user --tor ``` -------------------------------- ### ScanResult and ResultStatus Source: https://context7.com/krishpranav/maigret/llms.txt The ScanResult structure manages the outcome of a username scan, including confidence scoring and status tracking. ```APIDOC ## ScanResult Structure ### Description Represents the outcome of a username scan on a specific site, including confidence levels and status tags. ### ResultStatus Variants - **Confirmed**: High confidence the profile exists - **Likely**: Profile probably exists but lower confidence - **Private**: Profile exists but is private - **NotFound**: Username not found on this site - **Blocked**: Request was blocked (rate limit, WAF, etc.) - **Soft404**: Server returned 200 but page shows "not found" - **Redirected**: URL redirected to a different page - **Error**: Request failed with an error ``` -------------------------------- ### Tor Anonymized Scan with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Enable anonymous scanning by routing traffic through the Tor network. Ensure Tor is running on the default port (9050). ```bash # Scan using Tor proxy (requires Tor running on localhost:9050) maigret johnsmith --tor ``` -------------------------------- ### Disable Colored Output with Maigret CLI Source: https://context7.com/krishpranav/maigret/llms.txt Disable colored output in the terminal using the --no-color flag. This is useful when processing logs or redirecting output to files. ```bash # Disable colored output for log processing maigret johnsmith --no-color ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.