Documentation
¶
Index ¶
- type Babbler
- func (b *Babbler) BabbleHandler(t string) http.HandlerFunc
- func (b *Babbler) HoneypotMiddleware(extensions ...string) func(http.Handler) http.Handler
- func (b *Babbler) SetCallback(callback HoneypotCallback)
- func (b *Babbler) SetResponseDelay(minDelayMs, maxDelayMs uint)
- func (b *Babbler) StatsHandler() http.HandlerFunc
- type HoneypotCallback
- type JSONStorer
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Babbler ¶
type Babbler struct {
// contains filtered or unexported fields
}
Babbler
func NewBabbler ¶
NewBabbler creates a new Babbler instance
func (*Babbler) BabbleHandler ¶
func (b *Babbler) BabbleHandler(t string) http.HandlerFunc
Handler returns an HTTP handler that serves babble text based on type
func (*Babbler) HoneypotMiddleware ¶
HoneypotMiddleware returns a Chi middleware that intercepts requests for sensitive files and serves fake content to waste attackers' time. Should be used as the last middleware before your application routes.
func (*Babbler) SetCallback ¶
func (b *Babbler) SetCallback(callback HoneypotCallback)
SetCallback sets a callback function that will be called whenever a honeypot request is intercepted
func (*Babbler) SetResponseDelay ¶
SetResponseDelay sets the maximum response delay in milliseconds
func (*Babbler) StatsHandler ¶
func (b *Babbler) StatsHandler() http.HandlerFunc
StatsHandler returns an HTTP handler that serves babble statistics
type HoneypotCallback ¶
HoneypotCallback defines the callback function signature Called when a honeypot request is intercepted
type JSONStorer ¶
type JSONStorer struct {
// contains filtered or unexported fields
}
JSONStorer implements the Storer interface using JSON
func NewJSONStorer ¶
func NewJSONStorer(filepath string) *JSONStorer
NewJSONStorer creates a new JSONStorer instance
func (*JSONStorer) GetStats ¶
func (s *JSONStorer) GetStats() ([]byte, error)
GetStats retrieves the count for a given babble type
func (*JSONStorer) Increment ¶
func (s *JSONStorer) Increment(t string) error
Increment increments the count for a given babble type