Reverse HTTP Listener for Built Agents
The HTTP listener opens an HTTP/HTTPS server on a specified port and manages data traffic with agents.
Plugin ID: shelldot.listener.agent-reverse-http
HTTP Listener Configuration
The table below documents all available configuration parameters in a logical order:
Attribute | Explanation |
---|---|
port | Port number where the generated payload calls home. If bindToPort is set to null, it will also be the port that listener runs |
bindToPort | Port number where the listener actually runs. Default is "null", in that case the "port" variable is used |
https | Protocol flag (0 = HTTP, 1 = HTTPS). |
startTime | Optional UTC start time (e.g., "2023-04-10T11:02:09Z"). |
getUri | URI used by the agent for GET requests when idle. |
postUri | URI for sending data via POST (also receives data). |
stagedUri | URI requested for generating agent executable/dll/service/shellcode. |
fileStorageUri | Base URI for retrieving files from file storage. |
metadataCookieName | Cookie name used to hold metadata. |
metadataPrefix | Prefix appended to metadata. |
metadataSuffix | Suffix appended to metadata. |
headers[ ] | Additional HTTP headers (array of objects with "name" and "value"). |
instantResponses | Boolean indicating if the agent sends data immediately or waits for the sleep timeout (for OPSEC). |
httpCallbacks[ ] | Array of callback configuration objects. |
↳ hosts[ ] | Array of IP addresses or hostnames the agent can use to connect. |
↳ hostsRotation: | Rotation rules for host selection. |
↳ type | Rotation method (FAILOVER, ROTATE, RANDOM). |
↳ counter | Numeric value indicating when to rotate hosts. |
↳ unit | Unit for the counter (TRIES, SECONDS, MINUTES, HOURS). |
↳ sleep | Base sleep time (ms) between requests. |
↳ sleepRandom | Variation (ms) in the sleep time. |
↳ hostHeaders[ ] | Array of HTTP host header values used when connecting. |
↳ hostHeaderRotation: | Rotation rules for host headers. |
↳ type | Rotation method for host headers (FAILOVER, ROTATE, RANDOM). |
↳ counter | Numeric value for header change frequency. |
↳ unit | Unit for the header counter (TRIES, SECONDS, MINUTES, HOURS). |
Hosts string array
If inner hosts string array contains more than 1 hostname/IP, then it's same as host object array to contain same number of objects, each with only one value in host string array bus rest configuration same. This is just so users would be able to keep configuration smaller.
These two configurations are equal:
vs
Examples
Example 1: Basic Configuration with Host Rotation
Example 2: Complex Rotation Rules
How the rotation works:
- Agent starts with connection to IP localhost using host header "alpha"
- For the localhost connection:
- Host rotation occurs after 5 minutes of failed connections
- Host headers rotate every 30 seconds between "alpha", "bravo", and "charlie"
- For the 192.168.1.100 connection:
- Host rotation occurs after 3 failed connection attempts
- Host headers randomly switch between "delta" and "echo" with 50% probability before each request
Note: Host rotation and header rotation operate independently. A successful connection resets the host rotation counter, while header rotation continues according to its own rules.