Bazar
- Type
- Backdoor
- Capabilities
- Initial accessPersistenceReconnaissanceProcess injectionPost exploitationDefense evasion
- Delivery
- PhishingSpearphishingVishingLure
- Platforms
- Windows
Bazar, also known as BazaLoader, KEGTAP, and Team9, is a Windows malware family used to establish backdoor access and deliver additional payloads to compromised systems. It has development ties to the TrickBot group and has been used by Wizard Spider and other threat actors to establish footholds in high-value targets. Follow-on payloads have included Cobalt Strike, IcedID, TrickBot, and Emotet. Bazar infections have also served as an entry point for ransomware attacks, including Ryuk deployments.
Distribution methods include phishing emails with malicious links and spearphishing attachments containing macro-enabled Microsoft Office documents or PDFs with download links. BazarCall campaigns, active from early 2021, used fraudulent subscription emails to persuade recipients to call purported cancellation services. Telephone operators then guided victims into downloading files containing BazaLoader, leading to further compromise.
Bazar supports command-and-control-directed payload download and execution, including execution of PowerShell scripts. It can establish persistence through scheduled tasks, enumerate remote systems using the Windows Net utility, identify its current process, and inject code using VirtualAllocExNuma. Its command-and-control activity has used TLS certificates issued by trusted certificate authorities.
Associated vulnerabilities
2 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
10 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Wizard Spider has used spearphishing attachments to deliver Microsoft documents containing macros or PDFs containing malicious links to download either Emotet, Bokbot, TrickBot, or Bazar.
This actor has predominantly used BazaLoader since April of 2020, but on February 3rd, 2021 they distributed a new malware we are calling NimzaLoader... there has been some research community analysis suggesting that NimzaLoader is just another variant of BazaLoader, but based on our observations of significant differences, we are tracking this as a distinct malware family.
Domains serving Bazar loader files ... Bazar domains ... Operational Backdoor
Microsoft attributes this campaign to Storm-0249, an access broker active since 2021 and known for distributing, at minimum, BazaLoader, IcedID, Bumblebee, and Emotet malware.
BazaLoader is a downloader written in C++ whose primary function is to download and execute additional modules. It was first observed in the wild in April 2020 and since has steadily been adopted by more actors.
TA578 uses email campaigns to deliver malware like Ursnif, IcedID, KPOT Stealer, Buer Loader, and BazaLoader, as well as Cobalt Strike.
+4 more in the app. View in Mallory
Techniques & procedures
79 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
3 techniques
Initial Access
Lately, Ryuk attacks usually start with a phishing campaign that installs the BazarLoader/KegTap infection on a recipient's computer.
The content repeatedly describes threat actors sending spearphishing or phishing emails with malicious attachments such as Microsoft Office documents, PDFs, RAR/ZIP archives, CHM files, and executables disguised as documents.
[Bazar](https://attack.mitre.org/software/S0534) has been spread via emails with embedded malicious links.(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)(Citation: CrowdStrike Wizard Spider October 2020)
Execution
14 techniques
Execution
[Bazar](https://attack.mitre.org/software/S0534) can execute a WMI query to gather information about the installed antivirus engine.(Citation: Cybereason Bazar July 2020)(Citation: DFIR Ryuk's Return October 2020)
After execution of the initial access malware, many threat actors deploy persistence mechanisms, such as the creation of scheduled tasks... Scheduled tasks were the most common persistence method observed in our intrusions.
[Bazar](https://attack.mitre.org/software/S0534) can create a scheduled task for persistence.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
Command 12, 13: C2 server replies with a script file to Bazar in a command. Bazar then decrypts the script file and saves it to a Windows temporary folder. Finally, Bazar runs it by calling the API CreateProcessA().
[Bazar](https://attack.mitre.org/software/S0534) can execute a PowerShell script received from C2.(Citation: NCC Group Team9 June 2020)(Citation: CrowdStrike Wizard Spider October 2020)
[Bazar](https://attack.mitre.org/software/S0534) can launch cmd.exe to perform reconnaissance commands.(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)
The Excel sheet contains macros that, if enabled by the user, will download BazaLoader.
The maldoc then leverages Excel 4.0 macros stored in a hidden sheet, which allow an externally-hosted payload to be downloaded, written to disk and executed
[Bazar](https://attack.mitre.org/software/S0534) can use various APIs to allocate memory and facilitate code execution/injection.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) has been downloaded via Windows BITS functionality.(Citation: NCC Group Team9 June 2020)
The downloaded file is an executable that will install the BazarLoader infection onto a victim's computer when executed.
[Bazar](https://attack.mitre.org/software/S0534) can gain execution after a user clicks on a malicious link to decoy landing pages hosted on Google Docs.(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)(Citation: CrowdStrike Wizard Spider October 2020)
there is an Excel spreadsheet named subscription_1617056233.xlsb . This spreadsheet has malicious macros. | At the video's 10 minute mark, I enable macros on the malicious spreadsheet, but nothing apparently happened. So the call center operator had me re-open the spreadsheet and enable macros again.
Bazar has manually loaded ntdll from disk in order to identity and remove API hooks set by security products. Donut can patch AMSI, WLDP, as well as exit-related Native API functions... Turla has used a AMSI bypass, which patches the in-memory amsi.dll.
Persistence
8 techniques
Persistence
After execution of the initial access malware, many threat actors deploy persistence mechanisms, such as the creation of scheduled tasks... Scheduled tasks were the most common persistence method observed in our intrusions.
[Bazar](https://attack.mitre.org/software/S0534) can create a scheduled task for persistence.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
Across the content, malware repeatedly 'adds Registry Run keys', 'creates Registry entries', 'modifies the Windows Registry', or 'overwrites registry keys' to maintain persistence.
[Bazar](https://attack.mitre.org/software/S0534) has been downloaded via Windows BITS functionality.(Citation: NCC Group Team9 June 2020)
Command 17: The C2 server replies with a piece of native code... Bazar decrypts the native code... and deploys it on a newly-create thread to execute. To achieve this, it needs to call some APIs, such as VirtualAlloc(), memcpy(), VirtualProtect(), and CreateThread().
[Bazar](https://attack.mitre.org/software/S0534) can create or add files to Registry Run Keys to establish persistence.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can use Winlogon Helper DLL to establish persistence.(Citation: Zscaler Bazar September 2020)
[Bazar](https://attack.mitre.org/software/S0534) can establish persistence by writing shortcuts to the Windows Startup folder.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
Privilege Escalation
9 techniques
Privilege Escalation
After execution of the initial access malware, many threat actors deploy persistence mechanisms, such as the creation of scheduled tasks... Scheduled tasks were the most common persistence method observed in our intrusions.
[Bazar](https://attack.mitre.org/software/S0534) can create a scheduled task for persistence.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can inject code through calling <code>VirtualAllocExNuma</code>.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) can inject into a target process including Svchost, Explorer, and cmd using process hollowing.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can inject into a target process using process doppelgänging.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
Command 17: The C2 server replies with a piece of native code... Bazar decrypts the native code... and deploys it on a newly-create thread to execute. To achieve this, it needs to call some APIs, such as VirtualAlloc(), memcpy(), VirtualProtect(), and CreateThread().
[Bazar](https://attack.mitre.org/software/S0534) can create or add files to Registry Run Keys to establish persistence.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can use Winlogon Helper DLL to establish persistence.(Citation: Zscaler Bazar September 2020)
[Bazar](https://attack.mitre.org/software/S0534) can establish persistence by writing shortcuts to the Windows Startup folder.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
Stealth
21 techniques
Stealth
Bazar hides key APIs in the code... ASM Code Obfuscation... All constant strings are encoded in Bazar... Bazar’s constant strings are hidden in encrypted data throughout the code to perform anti-analysis.
[Bazar](https://attack.mitre.org/software/S0534) has a variant with a packed payload.(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)
[Bazar](https://attack.mitre.org/software/S0534) can hash then resolve API calls at runtime.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) has used XOR, RSA2, and RC4 encrypted files.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)(Citation: CrowdStrike Wizard Spider October 2020)
actors used the following command to rename one of their tools to a benign file name: ren "%temp%\upload" audiodg.exe ... APT1 ... used ... AcroRD32.exe ... as a name for malware ... APT28 ... changed extensions on files containing exfiltrated data to make them appear benign ... APT32 has renamed a NetCat binary to kb-10233.exe to masquerade as a Windows update.
[Bazar](https://attack.mitre.org/software/S0534) can create a task named to appear benign.(Citation: Cybereason Bazar July 2020)
The [Bazar](https://attack.mitre.org/software/S0534) loader has named malicious shortcuts "adobe" and mimicked communications software.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)(Citation: CrowdStrike Wizard Spider October 2020)
The [Bazar](https://attack.mitre.org/software/S0534) loader has used dual-extension executable files such as PreviewReport.DOC.exe.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) can inject code through calling <code>VirtualAllocExNuma</code>.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) can inject into a target process including Svchost, Explorer, and cmd using process hollowing.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can inject into a target process using process doppelgänging.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can delete its loader using a batch file in the Windows temporary folder.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534)'s loader can delete scheduled tasks created by a previous instance of the malware.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can decrypt downloaded payloads. [Bazar](https://attack.mitre.org/software/S0534) also resolves strings and other artifacts at runtime.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) has been downloaded via Windows BITS functionality.(Citation: NCC Group Team9 June 2020)
In this post I’ll work through analyzing an AppX package from Magnitude Exploit Kit that drops Magniber... AppX packages have gotten some mileage as droppers lately.
[Bazar](https://attack.mitre.org/software/S0534) can attempt to overload sandbox analysis by sending 1550 calls to <code>printf</code>.(Citation: Cybereason Bazar July 2020)
The content includes environment-aware checks such as "Bazar can also check if the Russian language is installed on the infected machine and terminate if it is found," "CaddyWiper can also halt execution if the compromised host is identified as a domain controller," and "OopsIE checks for information on the CPU fan, temperature, mouse, hard disk, and motherboard as part of its anti-VM checks."
[Bazar](https://attack.mitre.org/software/S0534) can use a timer to delay execution of core functionality.(Citation: NCC Group Team9 June 2020)
Bazar has manually loaded ntdll from disk in order to identity and remove API hooks set by security products. Donut can patch AMSI, WLDP, as well as exit-related Native API functions... Turla has used a AMSI bypass, which patches the in-memory amsi.dll.
Decrypting the Resource data uncovers a piece of ASM (assembly language) code and a PE file. This ASM code, called by the Bazar loader, dynamically deploys the PE file into memory and executes it.
Defense Impairment
3 techniques
Defense Impairment
Across the content, malware repeatedly 'adds Registry Run keys', 'creates Registry entries', 'modifies the Windows Registry', or 'overwrites registry keys' to maintain persistence.
[Bazar](https://attack.mitre.org/software/S0534) has been signed with fake certificates including those appearing to be from VB CORPORATE PTY. LTD.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) has manually loaded ntdll from disk in order to identity and remove API hooks set by security products.(Citation: NCC Group Team9 June 2020)
Credential Access
1 technique
Credential Access
All of these (malicious tools) are used to gain access to corporate networks, steal files and network credentials, and ultimately deploy ransomware on the network.
Discovery
21 techniques
Discovery
[Bazar](https://attack.mitre.org/software/S0534) can query <code>Windows\CurrentVersion\Uninstall</code> for installed applications.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can collect the IP address and NetBIOS name of an infected machine.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) can enumerate remote systems using <code> Net View</code>.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) can identify the username of the infected user.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can identity the current process on a compromised host.(Citation: Cybereason Bazar July 2020)
Brute Ratel C4 can use LDAP queries, net group "Domain Admins" /domain and net user /domain for discovery. OilRig has run net group "domain admins" /domain and net group "Exchange Trusted Subsystem" /domain to get account listings on a victim. Wizard Spider has identified domain admins through the use of net group "Domain admins" /DOMAIN.
[Bazar](https://attack.mitre.org/software/S0534) can fingerprint architecture, computer name, and OS version on the compromised host. [Bazar](https://attack.mitre.org/software/S0534) can also check if the Russian language is installed on the infected machine and terminate if it is found.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can enumerate the victim's desktop.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
“actors used the following commands… to enumerate user accounts: net user >> %temp%\download; net user /domain >> %temp%\download … APT1 used the commands net localgroup, net user, and net group to find accounts… APT32 enumerated administrative users using the commands net localgroup administrators … OilRig has run net user, net user /domain, net group "domain admins" /domain …”
[Bazar](https://attack.mitre.org/software/S0534) can identify administrator accounts on an infected host.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) has the ability to identify domain administrator accounts.(Citation: NCC Group Team9 June 2020)(Citation: DFIR Ryuk's Return October 2020)
[Bazar](https://attack.mitre.org/software/S0534) can collect the time on the compromised host.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can enumerate shared drives on the domain.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can use [Nltest](https://attack.mitre.org/software/S0359) tools to obtain information about the domain.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can attempt to overload sandbox analysis by sending 1550 calls to <code>printf</code>.(Citation: Cybereason Bazar July 2020)
The content includes environment-aware checks such as "Bazar can also check if the Russian language is installed on the infected machine and terminate if it is found," "CaddyWiper can also halt execution if the compromised host is identified as a domain controller," and "OopsIE checks for information on the CPU fan, temperature, mouse, hard disk, and motherboard as part of its anti-VM checks."
[Bazar](https://attack.mitre.org/software/S0534) can use a timer to delay execution of core functionality.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can query the Registry for installed applications.(Citation: Cybereason Bazar July 2020)
[Bazar](https://attack.mitre.org/software/S0534) can identify the installed antivirus engine.(Citation: Cybereason Bazar July 2020)
Examples include: “Bazar … check if the Russian language is installed … and terminate if it is found.”; “DropBook … checked for the presence of Arabic language …”; “Maze … checked the language … GetUserDefaultUILanguage”; “SynAck … checks installed keyboard layouts to estimate … countries.”
[Bazar](https://attack.mitre.org/software/S0534) can perform a check to ensure that the operating system's keyboard and language settings are not set to Russian.(Citation: NCC Group Team9 June 2020)
Collection
1 technique
Collection
[Bazar](https://attack.mitre.org/software/S0534) can retrieve information from the infected machine.(Citation: Cybereason Bazar July 2020)
Command and Control
13 techniques
Command and Control
Many entries describe XOR, XOR/ADD, bitwise NOT and XOR, ROR plus XOR, hexadecimal encoding after encryption, and custom encoding/obfuscation of HTTP traffic or beacons.
[Bazar](https://attack.mitre.org/software/S0534) has the ability to use an alternative C2 server if the primary server fails.(Citation: NCC Group Team9 June 2020)
Cobalt Strike was sent through encrypted HTTPS traffic generated by BazaLoader.
[Bazar](https://attack.mitre.org/software/S0534) can use HTTP and HTTPS over ports 80 and 443 in C2 communications.(Citation: Cybereason Bazar July 2020)(Citation: NCC Group Team9 June 2020)(Citation: DFIR Conti Bazar Nov 2021)
In the past several years, we have seen multiple malware samples using DNS tunneling to exfiltrate data... Anchor malware that uses DNS tunneling to communicate with C2 servers... DNS tunneling is an old technique that allows attackers to communicate with C2 servers and exfiltrate data through many firewalls.
[Bazar](https://attack.mitre.org/software/S0534) downloads have been hosted on Google Docs.(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)
The [Bazar](https://attack.mitre.org/software/S0534) loader is used to download and execute the [Bazar](https://attack.mitre.org/software/S0534) backdoor.(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)
[Bazar](https://attack.mitre.org/software/S0534) can download and deploy additional payloads, including ransomware and post-exploitation frameworks such as [Cobalt Strike](https://attack.mitre.org/software/S0154).(Citation: Cybereason Bazar July 2020)(Citation: Zscaler Bazar September 2020)(Citation: NCC Group Team9 June 2020)(Citation: CrowdStrike Wizard Spider October 2020)
The A record of the domains is encrypted, just as in previous versions. Meaning, the four bytes of the IP are XORed with 0xFE. The IP is then used in URLs of format https://{ip}:443.
[Bazar](https://attack.mitre.org/software/S0534) can implement DGA using the current date as a seed variable.(Citation: Cybereason Bazar July 2020)
The content is a catalog of malware and threat groups that encrypt command-and-control communications using algorithms such as DES, AES, RC4, XOR, Blowfish, RSA, Camellia, RC2, RC6, and custom ciphers.
[Bazar](https://attack.mitre.org/software/S0534) can send C2 communications with XOR encryption.(Citation: NCC Group Team9 June 2020)
[Bazar](https://attack.mitre.org/software/S0534) can use TLS in C2 communications.(Citation: Zscaler Bazar September 2020)
Exfiltration
2 techniques
Exfiltration
When this collection is done, it sends all of the gathered information in the 'body' of the 'POST' request to the C2 server... Command 16: Bazar reads a file path from the C2 server’s command and collects the file’s contents. It sends the collected data as the 'body' of a 'POST' request back to the C2 server.
The TrickBot cybercrime group is responsible for a variety of sophisticated malware targeting Windows and Linux devices to gain access to victim's networks, steal data, and deploy other malware, such as ransomware.
Impact
1 technique
Impact
All of these (malicious tools) are used to gain access to corporate networks, steal files and network credentials, and ultimately deploy ransomware on the network.
Observables
250 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
160 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.