<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Agent features on Goauld</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/</link><description>Recent content in Agent features on Goauld</description><generator>Hugo</generator><language>en</language><atom:link href="https://Hazegard.github.io/Goauld-doc/02-agent/index.xml" rel="self" type="application/rss+xml"/><item><title>Tunneling</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/01-tunnels/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/01-tunnels/</guid><description>&lt;p&gt;The Goauld agent supports multiple transport mechanisms to communicate with the server.
If a transport fails, the agent automatically falls back to the next available method.&lt;/p&gt;
&lt;p&gt;The agent attempts to connect to the server using several transports:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Direct SSH connection&lt;/li&gt;
&lt;li&gt;SSH over QUIC&lt;/li&gt;
&lt;li&gt;SSH over TLS&lt;/li&gt;
&lt;li&gt;SSH over WebSocket&lt;/li&gt;
&lt;li&gt;SSH over HTTP&lt;/li&gt;
&lt;li&gt;SSH over DNS&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For each transport protocol, the agent tries establish a connection to the server, with a 60 seconds timeout (configurable using &lt;code&gt;--ssh-timeout&lt;/code&gt; flag). If the connection is established, the agent finalizes the connection.&lt;/p&gt;</description></item><item><title>Exposed proxies</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/02-proxies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/02-proxies/</guid><description>&lt;p&gt;The agent exposes three proxies that allow interaction with the host’s network:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An HTTP proxy&lt;/li&gt;
&lt;li&gt;An HTTP proxy that performs NTLM/Kerberos application-level authentication&lt;/li&gt;
&lt;li&gt;A SOCKS proxy&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="td-alert td-alert--md alert alert-note" role="alert"&gt;&lt;div class="td-alert-heading alert-heading" role="heading"&gt;Note&lt;/div&gt;
 &lt;div class="td-alert-body"&gt;
 &lt;p&gt;Given that performing NTLM/Kerberos application-level authentication requires to intercept the traffic (MITM) to inject appropriate headers, this feature has been implemented in a dedicated proxy.&lt;/p&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="http-proxy"&gt;HTTP proxy&lt;a class="td-heading-self-link" href="#http-proxy" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For each incoming request, the HTTP proxy determines whether an upstream proxy should be used and which one.&lt;/p&gt;</description></item><item><title>Relay</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/03-relay/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/03-relay/</guid><description>&lt;p&gt;If an agent &lt;code&gt;A&lt;/code&gt; cannot reach the Goauld server, but can reach anothe agent &lt;code&gt;B&lt;/code&gt; that can reach the server, then agent &lt;code&gt;B&lt;/code&gt; can be configured to run as a relay.&lt;/p&gt;
&lt;h2 id="configure-an-agent-as-a-relay"&gt;Configure an agent as a relay&lt;a class="td-heading-self-link" href="#configure-an-agent-as-a-relay" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--relay&lt;/code&gt;: Enable relay mode on the agent&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="td-alert td-alert--md alert alert-note" role="alert"&gt;&lt;div class="td-alert-heading alert-heading" role="heading"&gt;Note&lt;/div&gt;
 &lt;div class="td-alert-body"&gt;
 &lt;p&gt;The agent listens on all interfaces using a randomly assigned port. This port is logged in the agent logs:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-log" data-lang="log"&gt;INF agent/agent.go:468 &amp;gt; Relay listening on port Port=57129
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or in the TUI (Press &lt;code&gt;+&lt;/code&gt; to view details about the agent)&lt;/p&gt;</description></item><item><title>WireGuard</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/04-wireguard/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/04-wireguard/</guid><description>&lt;p&gt;The agent exposes a virtual WireGuard interface, allowing TCP, UDP, and ICMP (ping) traffic without relying on a SOCKS proxy.&lt;/p&gt;
&lt;p&gt;The virtual WireGuard interface uses the gVisor network stack (&lt;a href="https://github.com/google/gvisor/tree/go"&gt;https://github.com/google/gvisor/tree/go&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The implementation works as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The agent exposes a WireGuard server port on the host.&lt;/li&gt;
&lt;li&gt;The agent forwards the WireGuard port to the server using UDP-over-TCP encapsulation to traverse the existing agent tunnel.&lt;/li&gt;
&lt;li&gt;The client forwards the WireGuard port exposed on the server to the local machine.&lt;/li&gt;
&lt;li&gt;The client decapsulates the UDP-over-TCP traffic to expose the WireGuard port.&lt;/li&gt;
&lt;li&gt;The WireGuard client on the operator machine connects to the agent&amp;rsquo;s virtual WireGuard interface.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="td-alert td-alert--md alert alert-note" role="alert"&gt;&lt;div class="td-alert-heading alert-heading" role="heading"&gt;Note&lt;/div&gt;
 &lt;div class="td-alert-body"&gt;
 &lt;p&gt;This implementation uses TCP-over-TCP encapsulation, which reduces performance.
However, this architecture was chosen because the server does not expose a WireGuard server common to all connected agents, which could result in unauthorized access between agents.&lt;/p&gt;</description></item><item><title>Password Management</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/05-password_management/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/05-password_management/</guid><description>&lt;p&gt;For historical reasons, the agent password consists of two parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Part 1&lt;/strong&gt;: Generated by the agent at each start and sent to the server through the control socket.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part 2&lt;/strong&gt;: It is stored only locally on the agent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The second part can be generated through different methods:&lt;/p&gt;
&lt;h3 id="1-at-compile-time"&gt;1. At compile-time&lt;a class="td-heading-self-link" href="#1-at-compile-time" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When compiling an agent through the client (see &lt;a href="https://Hazegard.github.io/Goauld-doc/04-client/12-compilation/"&gt;client/compilation&lt;/a&gt;), the generated password is displayed either in the standard output during compilation or in the &lt;code&gt;.env&lt;/code&gt; file that contains all the variables set for the agent.&lt;/p&gt;</description></item><item><title>Killswitch</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/06-killswitch/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/06-killswitch/</guid><description>&lt;p&gt;To ensure that no agent runs indefinitely, a killswitch has been implemented. After a specified number of days, the agent automatically shuts down.&lt;/p&gt;
&lt;h2 id="flag"&gt;Flag&lt;a class="td-heading-self-link" href="#flag" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--kill-switch&lt;/code&gt;: Set the number of days before exiting&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="td-alert td-alert--md alert alert-note" role="alert"&gt;&lt;div class="td-alert-heading alert-heading" role="heading"&gt;Note&lt;/div&gt;
 &lt;div class="td-alert-body"&gt;
 &lt;p&gt;The timer counts from the agent&amp;rsquo;s execution time.
Consequently, if an external system (scheduled task, cron job, etc.) restarts the agent, the killswitch timer resets.&lt;/p&gt;
 &lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Connection flow</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/07-connection_flow/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/07-connection_flow/</guid><description>&lt;p&gt;The agent separates orchestration (control) from operational traffic (data):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Control socket&lt;/strong&gt;: A Socket.IO component, which is used to transmit agent metadata and receive control instructions from the server (reset/kill, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data socket&lt;/strong&gt;: An SSH channel, which may be encapsulated depending on egress filtering restrictions, which is used to tunnel operational traffic (proxies, SSH access, pivoting services, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If a connection is lost, the agent automatically attempts to reconnect to both channels using an exponential backoff strategy.&lt;/p&gt;</description></item><item><title>Working days</title><link>https://Hazegard.github.io/Goauld-doc/02-agent/08-working_days/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://Hazegard.github.io/Goauld-doc/02-agent/08-working_days/</guid><description>&lt;p&gt;During assessments, it may be necessary to keep an agent running for several days (it can be difficult to execute).&lt;/p&gt;
&lt;p&gt;To reduce the agent&amp;rsquo;s network footprint, a mechanism allows it to pause all network activity at a specified time and automatically resume later at a specified hour.&lt;/p&gt;
&lt;p&gt;If the agent starts outside the working period, it will wait until the next start hour.&lt;/p&gt;
&lt;h2 id="flags"&gt;Flags&lt;a class="td-heading-self-link" href="#flags" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--only-working-days&lt;/code&gt;: to enable the working days feature&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--working-day-start&lt;/code&gt; : the given hour when the agent resumes network connection (format: &lt;code&gt;[HOURS]:[MINUTES]&lt;/code&gt;, 24-hour format)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--working-day-end&lt;/code&gt;: the given hour when the agent stops all network connection (format: &lt;code&gt;[HOURS]:[MINUTES]&lt;/code&gt;, 24-hour format)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--working-day-timezone&lt;/code&gt;: the timezone to use&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>