Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthStrategy ¶
type AuthStrategy struct {
// MinFailures is the minimum number of unique credentials that must fail
// before any credential can succeed.
MinFailures int `json:"min_failures"`
// SuccessProbability is the probability (0.0-1.0) that a new unique credential
// succeeds after MinFailures is reached. A value of 0.3 means ~30% chance.
SuccessProbability float64 `json:"success_probability"`
// FailureStatusCode is the HTTP status code for failed attempts (e.g., 401, 403).
FailureStatusCode int `json:"failure_status_code"`
// FailureBody is the response body for failed attempts.
FailureBody string `json:"failure_body"`
// FailureHeaders are additional headers for failed responses.
FailureHeaders map[string]string `json:"failure_headers,omitempty"`
// CredentialFields specifies which request body fields are considered credentials.
// Only these fields are used to determine unique login attempts.
// If empty, the entire request body is used as a fallback.
CredentialFields []string `json:"credential_fields,omitempty"`
}
AuthStrategy defines how a login endpoint handles authentication attempts. When attached to a route, the server tracks unique credential submissions per source IP. The first MinFailures unique credentials always fail. After that, each new unique credential succeeds with SuccessProbability chance (determined once and cached).
type Meta ¶
type Meta struct {
Name string `json:"name"`
Description string `json:"description"`
ServerSignature string `json:"server_signature"`
Headers map[string]string `json:"headers"`
Theme string `json:"theme"`
}
Meta holds scenario metadata including server signature and headers.
type Page ¶
type Page struct {
Path string `json:"path"`
HTMLFile string `json:"html_file"`
ContentType string `json:"content_type"`
}
Page represents an HTML page served by the honeypot.
type Route ¶
type Route struct {
Path string `json:"path"`
Method string `json:"method"`
StatusCode int `json:"status_code"`
Headers map[string]string `json:"headers"`
Body string `json:"body"`
BodyFile string `json:"body_file,omitempty"`
Auth *AuthStrategy `json:"auth,omitempty"`
// Hang makes the route wait indefinitely without sending a response.
// The connection stays open until the client gives up (timeout).
Hang bool `json:"hang,omitempty"`
}
Route defines an API endpoint served by the honeypot.
Click to show internal directories.
Click to hide internal directories.