How mushorg/glutton works
Project type and purpose
• Glutton is a network‐level, protocol‐agnostic, low‐interaction honeypot written in Go.
• It intercepts all inbound traffic using iptables+TPROXY, demultiplexes by protocol, then logs or “replays” minimal responses to adversaries.
File structure
Top‐level folders
• app/ – main server bootstrap (app/server.go)
• connection/ – connection lifecycle manager (accept, close, timeouts)
• protocols/ – protocol handlers (tcp/, udp/), protocol‐agnostic interfaces & mocks
• scanner/ – packet inspection / payload scanner
• producer/ – logging/telemetry output (e.g., JSON, file, network sinks)
• rules/ – rules engine determining handshake behavior, drop/accept logic
• config/ – YAML/JSON schemas and default policy files
• docs/ – human‐readable usage & extension guides
Other important files
• glutton.go – root CLI entry point
• server.go – core server loop, TPROXY / iptables integration (system.go, iptables.go)
• Makefile/Dockerfile(s) – build and deployment automations
• .github/ – CI pipelines, funding, release workflows
README
• Confirms honeypot purpose, Go language, iptables+TPROXY interception.
• Links to full docs detailing setup, configuration, extension API.
Main components
a. Network Interception Layer
• iptables + TPROXY (kernel components)
• redirect traffic to userland socket (UDP/TCP)
b. Glutton Core Server
• CLI/entry (glutton.go) → initializes config, rules, producers
• Packet Receiver (server.go/system.go)
• Connection Manager (connection package)
c. Packet Scanner
• scanner package inspects payload, identifies protocol anomalies
d. Protocol Dispatcher & Handlers
• protocols package (interfaces, helpers)
• tcp/ and udp/ submodules, each handler implements a common interface
e. Rules Engine
• rules package loads config/rules.yaml, decides response strategy
f. Producer/Logger
• producer package formats and emits events to chosen sinks (file, JSON, remote)
g. Configuration Store
• config folder: config.yaml, schema.json, rules.yaml
h. External Services (optional)
• ELK/Graylog, InfluxDB, or any SIEM/log aggregator
Relationships & data flow
1. Incoming packets hit iptables → TPROXY → redirected to Glutton UDP/TCP sockets
2. Core server receives raw packets → passes to scanner
3. Scanner tags protocol type → dispatch to protocols dispatcher
4. Connection Manager wraps dispatch, applies timeouts, tracking
5. Protocol handler consults rules engine for handshake/interaction policy
6. Interaction events sent to Producer/Logger
7. Producer writes to disk or forwards to external log system
Architectural patterns & principles
• Modular plugin‐style protocol handlers (protocols/interfaces)
• Dependency injection for logger & honeypot modules (via mockery mocks)
• Configuration‐driven rules & schema validation
• Separation of concerns: network I/O, scanning, protocol logic, output