BountyHunter.psm1

<#
.SYNOPSIS
  ReconHelper functions for opening browser-based searches against Bug Bounty targets.
 
.DESCRIPTION
  Provides a generic Invoke-ReconSearch cmdlet plus specialized helpers
  for GitHub Pages, CVEs, subdomain takeovers, and bounty history lookups.
 
.EXAMPLE
  Invoke-ReconSearch -Query "cloudflare site:github.io"
 
  Search-GitHubPages -Target cloudflare
 
  Search-CVEs -Target netflix
 
  Search-SubdomainTakeovers -Target example.com
 
  Search-BugBountyHistory -Target adobe
 
#>


function Invoke-ReconSearch {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)][string]$Query
    )

    $encoded = [System.Web.HttpUtility]::UrlEncode($Query)
    $url     = "https://www.google.com/search?q=$encoded"

    Write-Host "🌐 Opening browser for query: $Query"
    if ($IsWindows) {
        Start-Process $url
    }
    else {
        $proc = if ($IsMacOS) { "open" } else { "xdg-open" }
        Start-Process -FilePath $proc -ArgumentList $url
    }
}

function Search-GitHubPages {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)][string]$Target
    )

    Invoke-ReconSearch -Query "$Target site:github.io"
}

function Search-CVEs {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)][string]$Target
    )

    # Use single quotes around the phrase to avoid nested double-quote syntax errors
    Invoke-ReconSearch -Query "$Target CVE OR 'Common Vulnerabilities and Exposures'"
}

function Search-SubdomainTakeovers {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)][string]$Target
    )

    Invoke-ReconSearch -Query "site:$Target 'This site can’t be reached' OR 'No such host is known'"
}

function Search-BugBountyHistory {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)][string]$Target
    )

    Invoke-ReconSearch -Query "$Target HackerOne bounty report OR CVE"
}

Export-ModuleMember -Function Invoke-ReconSearch, Search-GitHubPages, Search-CVEs, Search-SubdomainTakeovers, Search-BugBountyHistory