Adversaries may use an internal proxy to direct command and control traffic between two or more systems in a compromised environment. Many tools exist that enable traffic redirection through proxies or port redirection, including [HTRAN](https://attack.mitre.org/software/S0040), ZXProxy, and ZXPortMap. (Citation: Trend Micro APT Attack Tools) Adversaries use internal proxies to manage command and control communications inside a compromised environment, to reduce the number of simultaneous outbound network connections, to provide resiliency in the face of connection loss, or to ride over existing trusted communications paths between infected systems to avoid suspicion. Internal proxy connections may use common peer-to-peer (p2p) networking protocols, such as SMB, to better blend in with the environment.By using a compromised internal system as a proxy, adversaries may conceal the true destination of C2 traffic while reducing the need for numerous connections to external systems.
Enable traffic redirection.
Note that this test may conflict with pre-existing system configuration.
Supported Platforms: macOS, Linux
Name | Description | Type | Default Value |
---|---|---|---|
proxy_server | Proxy server URL (host:port) | url | 127.0.0.1:8080 |
proxy_scheme | Protocol to proxy (http or https) | string | http |
export #{proxy_scheme}_proxy=#{proxy_server}
unset http_proxy
unset https_proxy
Enable traffic redirection on macOS UI (not terminal). The test will modify and enable the "Web Proxy" and "Secure Web Proxy" settings in System Preferences => Network => Advanced => Proxies for the specified network interface.
Note that this test may conflict with pre-existing system configuration.
Supported Platforms: macOS
Name | Description | Type | Default Value |
---|---|---|---|
proxy_server | Proxy server URL (host) | string | 127.0.0.1 |
proxy_port | Proxy server port | string | 8080 |
interface | Protocol to proxy (http or https) | string | Wi-Fi |
networksetup -setwebproxy #{interface} #{proxy_server} #{proxy_port}
networksetup -setsecurewebproxy #{interface} #{proxy_server} #{proxy_port}
networksetup -setwebproxystate #{interface} off
networksetup -setsecurewebproxystate #{interface} off
Adds a registry key to set up a proxy on the endpoint at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PortProxy\v4tov4 Upon execution there will be a new proxy entry in netsh netsh interface portproxy show all
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
connectaddress | Specifies the IPv4 address to which to connect. Acceptable values are IP address, computer NetBIOS name, or computer DNS name. If an address is not specified, the default is the local computer. | string | 127.0.0.1 |
connectport | Specifies the IPv4 port, by port number or service name, to which to connect. If connectport is not specified, the default is the value of listenport on the local computer. | string | 1337 |
listenport | Specifies the IPv4 port, by port number or service name, on which to listen. | string | 1337 |
netsh interface portproxy add v4tov4 listenport=#{listenport} connectport=#{connectport} connectaddress=#{connectaddress}
netsh interface portproxy delete v4tov4 listenport=#{listenport} -ErrorAction Ignore | Out-Null