redirect

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 redirect delivers session-completion notifications to victim browsers. When a phishing session captures all required tokens, the Notifier signals waiting browsers to redirect the victim to the legitimate site so they don't notice the interception.

Browsers connect via WebSocket (WaitForRedirect) and block until the session completes. A fallback polling endpoint (PollForRedirect) covers environments where WebSocket connections are unreliable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

Notifier manages active WebSocket connections waiting for session completion. When EventSessionCompleted fires, the notifier sends the redirect URL to all connections waiting on that session ID.

func NewNotifier

func NewNotifier(bus eventSubscriber, sessions sessionGetter, lures lureGetter, logger *slog.Logger) *Notifier

func (*Notifier) PollForRedirect

func (n *Notifier) PollForRedirect(w http.ResponseWriter, sessionID string)

PollForRedirect is the fallback polling endpoint GET /t/done. Returns {"redirect_url":"..."} if the session is complete, {"done":false} otherwise.

func (*Notifier) WaitForRedirect

func (n *Notifier) WaitForRedirect(w http.ResponseWriter, r *http.Request, sessionID string)

WaitForRedirect handles GET /ws/{sid}: blocks until the session completes, then sends the redirect URL and closes the connection.

Jump to

Keyboard shortcuts

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