Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

http-sse

Consume Server-Sent Events (SSE / EventSource) from a device endpoint.

Usage

iottack http http-sse --host <HOST> [OPTIONS]

Description

Connects to an HTTP EventSource endpoint and keeps the connection open for a configurable duration, collecting Server-Sent Events as they arrive. The plugin analyses the stream for security issues including open access, cleartext transmission, CORS policy, event rate, event types and potentially sensitive data disclosed in event payloads.

The SSE/EventSource protocol is commonly used by IoT firmware to push sensor readings, device state, and log messages to browser-based dashboards over a persistent HTTP connection.

Checks performed

CheckFindingSeverity
HTTP status 401 or 403Access deniedInfo
HTTP status other than 200Unexpected statusMedium
Content-Type is not text/event-streamWrong content typeMedium
Endpoint on port 80SSE stream over cleartext HTTPHigh
Endpoint reachable without credentialsOpen accessMedium
Access-Control-Allow-Origin: *Wildcard CORS policyMedium
Access-Control-Allow-Origin set to specific originCORS restrictedInfo
No Access-Control-Allow-Origin headerNo CORS headerInfo
Events receivedEvent count and rateInfo
Unique event type namesEvent typesInfo
Payload contains sensitive keywordsSensitive data in streamHigh
First event contentEvent sampleInfo

Sensitive keywords checked in event payloads: password, token, secret, key, auth, credential, private, serial.

Options

FlagShortDefaultDescription
--host <HOST>-H(required)Target hostname or IP address
--port <PORT>-p80TCP port
--path <PATH>-u/eventsEventSource endpoint path
--timeout-ms <MS>-t5000Connection timeout (ms)
--duration-s <SECS>-d10How long to collect events (seconds)
--max-events <COUNT>-n100Maximum number of events to collect
--output <FILE>-o-Save result to a file
--format <FORMAT>-ftexttext or json
--verbose-v-Increase log verbosity

Examples

Probe a device’s default event stream for 10 seconds:

$ iottack http http-sse --host 192.168.1.1

Target a non-standard path and port, collect for 30 seconds:

$ iottack http http-sse --host 192.168.1.1 --port 8080 --path /api/events --duration-s 30

Collect up to 50 events and save the result as JSON:

$ iottack http http-sse --host 192.168.1.1 --max-events 50 --output result.json --format json

Check a device running an ESPHome web server (default port 80, path /events):

$ iottack http http-sse --host esphome-device.local