spoof

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package spoof serves decoy content at phishing domains to hide the proxy's true purpose. When a visitor should not be phished (bot, blacklisted IP, invalid lure), the Server reverse-proxies a legitimate site's content or serves a default "It works!" page, making the server appear to host real content.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server renders a legitimate site's content in place of a phishing response. It rewrites domain references in the response body so the spoofed site's links point to the phishing domain, strips security headers, and removes the session tracking cookie.

When no spoof URL is configured, ServeHTTP serves an Apache-style default page — a 200 OK that makes the server look like an ordinary unconfigured web host.

func NewServer

func NewServer(defaultSpoofURL, sessionCookieName string, logger *slog.Logger) *Server

New creates a Server. defaultSpoofURL is used when no per-request URL is provided. sessionCookieName is the cookie stripped from spoofed requests.

func (*Server) Spoof

func (s *Server) Spoof(w http.ResponseWriter, r *http.Request)

Spoof serves the default spoof URL, or the default page if none is configured.

func (*Server) SpoofTarget

func (s *Server) SpoofTarget(w http.ResponseWriter, r *http.Request, spoofURL string)

SpoofTarget serves the provided URL, falling back to the default spoof URL, and finally to the default page if neither is available.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL