{"id":2094,"date":"2024-09-25T11:26:45","date_gmt":"2024-09-25T11:26:45","guid":{"rendered":"https:\/\/xdr-mdr.lmntrix.com\/main_web\/?p=2094"},"modified":"2025-07-29T03:18:26","modified_gmt":"2025-07-29T03:18:26","slug":"analysis-of-qakbot-malware","status":"publish","type":"post","link":"https:\/\/lmntrix.com\/blog\/analysis-of-qakbot-malware\/","title":{"rendered":"Analysis of Qakbot Malware"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"446\" height=\"318\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/PredatorThief20malware.webp\" alt=\"\" class=\"wp-image-2630\"\/><\/figure>\n<\/div>\n\n\n<p><strong>QakBot<\/strong>, aka QBot, QuakBot or Pinkslipbot, is a banking trojan malware that has existed for over a decade. The main purpose of Qbot is to steal banking credentials and other financial information (e.g., login credentials, passwords etc), while being able to deploy additional malware, log a user&#8217;s keystrokes, and create a backdoor to the compromised machines.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Some highlights of Qbot (Qakbot) malware are as follows,<\/strong><\/p>\n\n\n\n<p>The malware operates with a modular framework to inject DLL (payload) in to an existing Windows process,<\/p>\n\n\n\n<p>Deploy any ransomware such as Blackbyte, Blackbasta (Conti Affiliates) or, Royal Ransomware on will,<\/p>\n\n\n\n<p>Persist and survive reboots with Cobalt Strike payloads, and\/or scheduled tasks on Windows,<\/p>\n\n\n\n<p>Last but not least, through the cookie grabber and password stealer &#8211; it can steal passwords from popular browsers.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Did You Know?<\/strong> Malware authors also love continuous development lifecycles such as devops! Anecdotal evidence suggests around the first half of 2018, Qbot&#8217;s major version was 324! The most recent version of Qbot observed by LMNTRIX CDC was 401 to 403 in Jan 2021.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Infection Chain:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"351\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/1_qbot_inf_chain-1024x351-1.webp\" alt=\"\" class=\"wp-image-2095\"\/><\/figure>\n\n\n\n<p>The initial attack vector may vary depending on the targets as we all know, the threat actors perform basic reconnaissance after initial access is established to decide their next steps. We have observed 3 variations of Qbot (Qakbot) being delivered namely,<\/p>\n\n\n\n<p>Malspam -&gt; Zip -&gt; Javascript -&gt; Qbot Infection<\/p>\n\n\n\n<p>Malspam -&gt; Zip -&gt; VBS -&gt; Qbot Infection<\/p>\n\n\n\n<p>Malspam -&gt; Word DOC (Macro) -&gt; Qbot Infection<\/p>\n\n\n\n<p>Qbot was previously distributed by Emotet, as observed by LMNTRIX CDC. Generally, QBot infects the victims by initial infection vector of malspam e-mails. This kind of e-mail contains Microsoft Office documents (Excel) or sometimes comes with password-protected archives format attachments. Usually, the document contains macros, and the victims are tricked to enable the macro content leading to the malicious actions. (e.g., an invoice or shipping attachment). <\/p>\n\n\n\n<p><strong>Sample Information:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"305\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/2_sample_info-1024x305-1.webp\" alt=\"\" class=\"wp-image-2096\"\/><\/figure>\n\n\n\n<p><strong>Why are malware authors using this file format?<br><\/strong>XLSB is an Excel Binary Workbook file. They store information in binary format instead of XML like with most other Excel files (like XLSX). They can be read from and written much faster, making them extremely useful for very large spreadsheets. Also, the file sizes are smaller in XLSB, when compared with XLSX. Mainly .XLSB files have macros embedded in it, where they can store potentially malicious code.<\/p>\n\n\n\n<p><strong>Technical Analysis of Qbot XLSB:<\/strong><\/p>\n\n\n\n<p><strong>Snap 1: Enabled Content<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"525\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/3_qbot_enabled_content-1024x525-1.webp\" alt=\"\" class=\"wp-image-2097\"\/><\/figure>\n\n\n\n<p><strong>Snap 2: Hidden Sheets<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"492\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/4_qbot_hidden_sheets-1024x492-1.webp\" alt=\"\" class=\"wp-image-2098\"\/><\/figure>\n\n\n\n<p>Excel worksheets are in hidden mode, and we need to unhide to see the contents embedding in the Sheets. Usually, it will contain URLs, Malicious\/blacklisted IPs, and payload file paths etc., So far, QBot hasn\u2019t changed the infection flow for macro styled attacks.<strong><br><\/strong><\/p>\n\n\n\n<p><strong>File Structure of the .xlsb:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"449\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/5_file-struct-xlsb-1024x449-1.webp\" alt=\"\" class=\"wp-image-2099\"\/><\/figure>\n\n\n\n<p><strong><br>Macrosheets:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"450\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/6_qbot_macro_sheets-1024x450-1.webp\" alt=\"\" class=\"wp-image-2100\"\/><\/figure>\n\n\n\n<p><br>In&nbsp;fact,&nbsp;for&nbsp;huge&nbsp;Excel&nbsp;files&nbsp;used&nbsp;for&nbsp;accounting&nbsp;or&nbsp;statistical&nbsp;purposes,&nbsp;the&nbsp;XLSB&nbsp;format&nbsp;is&nbsp;very&nbsp;beneficial considering&nbsp;the&nbsp;amount&nbsp;of&nbsp;memory&nbsp;used&nbsp;by&nbsp;an&nbsp;XLSX&nbsp;file. With respect to this, the malware authors enter their malicious code directly into the cell formulas, which are hidden.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>By changing the font color.<br>Ex: [Sheet White color &amp; Font white color].<\/li>\n\n\n\n<li>By making hidden sheets with empty data but usually containing malicious contents.<\/li>\n<\/ul>\n\n\n\n<p><strong><br>Hidden Content:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"431\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/7_qbot_hidden_content-1024x431-1.webp\" alt=\"\" class=\"wp-image-2101\"\/><\/figure>\n\n\n\n<p><strong>Payload files:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"522\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/8_qbot_payload-1024x522-1.webp\" alt=\"\" class=\"wp-image-2102\"\/><\/figure>\n\n\n\n<p>Once the user enables the content, then the payload files will execute on the victim&#8217;s computer.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Ready, Set, Qbot:<\/strong> Following&nbsp;an&nbsp;infection,&nbsp;Qbot&nbsp;acts rapidly&nbsp;to&nbsp;accomplish&nbsp;privilege&nbsp;escalation,&nbsp;and&nbsp;10&nbsp;minutes&nbsp;later, it can steal your e-mail, passwords, banking credentials and start&nbsp;a&nbsp;full-fledged&nbsp;reconnaissance&nbsp;scan&nbsp;in 30 minutes or less.<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p><strong>Using Regsvr32, payload files will be present in the C:\\\\ Drive:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"514\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/9_qbot_regsvr32-1024x514-1.webp\" alt=\"\" class=\"wp-image-2103\"\/><\/figure>\n\n\n\n<p><strong><br>Payload files (in DLL format) &#8211; Dropped in the C Drive:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"501\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/10_qbot_payload_files-1024x501-1.webp\" alt=\"\" class=\"wp-image-2104\"\/><\/figure>\n\n\n\n<p><strong>A brief description of anti-analysis techniques used by Qbot,<\/strong><\/p>\n\n\n\n<p><strong>Instance 1: Encrypted Strings<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>import idc<br>import idautils<\/p>\n\n\n\n<p>dec_routine = 0x4065B7<br>enc_strings = 0x40B930<br>bytes_arr = 0x410120<\/p>\n\n\n\n<p>def decrypt_string(idx):<br>if idx &gt;= 0x36F4:<br>return # out of bounds<br>res = &#8220;&#8221;<br>while True:<br>c = idc.get_wide_byte(enc_strings+idx) ^ idc.get_wide_byte(bytes_arr + (idx&amp;0x3F))<br>if c == 0: break<br>res += chr(c)<br>idx += 1<br>return res<\/p>\n\n\n\n<p>xrefs = idautils.CodeRefsTo(dec_routine, 0)<br>for x in xrefs:<br>ea = idc.prev_head(x)<br>t = idc.get_operand_type(ea, 1)<br>if t == idc.o_imm:<br>idx = idc.get_operand_value(ea, 1)<br>dec = decrypt_string(idx)<br>idc.set_cmt(ea, dec, 1)<\/p>\n<\/blockquote>\n<\/div><\/div>\n\n\n\n<p>The majority of the embedded strings are encrypted and decrypted on demand by Qbot. The decryption routine takes one argument, the string index, and XOR function is used&nbsp;with an&nbsp;array until it encounters a null byte. Decrypting the strings can be aided by a framework such as IDAPython.<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p><strong>Instance 2: Simply put, it can stop functioning normally, when it&#8217;s being analysed<\/strong>.<\/p>\n\n\n\n<p>Some of the interesting, anti VM features include,<\/p>\n\n\n\n<p>(1) Qbot forcing an exception to exit when debugger is present,<\/p>\n\n\n\n<p>(2) Blacklisting malware analysis tools such as fiddler, process hacker, ollydbg, windbg, wireshark, tcpview, resource hacker, and around 37 analysis tools have been blacklisted, by the malware authors.<\/p>\n\n\n\n<p>(3) The &#8220;\/C&#8221; parameter instructs QBot to spawn a new process thread, which aids in performing anti-analysis checks. Qbot executes assembly code with the keyword &#8220;VMXh,&#8221; which causes an exception when run in a Virtual Machine. If the exception handler is successful, it returns exit code 1, otherwise it returns 0. The parent process examines the spawned process&#8217;s exit code. If the exit code is 0, QBot continues to function normally; if the exit code is not zero (0), QBot is being analysed and thus ceases to function.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Initial IOC (Indicator of Compromise &#8211; HTTP)<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"423\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/11_qbot_initial_ioc-1024x423-1.webp\" alt=\"\" class=\"wp-image-2105\"\/><\/figure>\n\n\n\n<p><strong>Once a victim is infected, the following process\/functions are performed by Qakbot;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Collecting information about the compromised host.<\/li>\n\n\n\n<li>Creating scheduled tasks (privilege escalation and persistence).<\/li>\n\n\n\n<li>Credentials harvesting &amp; dumping (.exe access).<\/li>\n\n\n\n<li>Password stealing (from browser history and cookies).<\/li>\n\n\n\n<li>Targeting web banking links (web injects).<\/li>\n\n\n\n<li>Password brute forcing.<\/li>\n\n\n\n<li>Registry manipulation (persistence) to survive reboots.<\/li>\n\n\n\n<li>Replicating\/relaunching it&#8217;s own copies through multiple instances using regsvr32.<\/li>\n\n\n\n<li>Process injection to conceal malicious actions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion:<\/h2>\n\n\n\n<p>When the victim&nbsp;opens the latest variant&#8217;s HTML file, the javascript code (shellcode)&nbsp;is executed. The ZIP file includes a Windows shortcut file that looks like a text file. The most recent Qbot infections result in the execution of a loader program. As per our observations of Qbot&#8217;s recent operations, adversaries behind the distribution of Qbot have taken new approaches to take their evasion capabilities to the next level by imitating common formats with ZIP file extensions to lure targets with&nbsp;malicious attachments that install Qbot. <\/p>\n\n\n\n<p>Not to forget, Qbot is also polymorphic in nature, which means it can change even after it has been installed on an endpoint. LMNTRIX CDC has observed that, Qbot has been recently used by Blackbasta, Blackbyte and Royal ransomware groups in 2023 for launching multi stage attacks after initial infection. <\/p>\n\n\n\n<p>The threat actors behind the Qbot banking trojan keep constantly changing files, infection vectors and the dropper (payloads) in the newer versions of Qbot is constantly cycling through command-and-control servers. We consider Qbot as a highly dangerous malware, because of the combination of anti-analysis, anti-vm and polymorphic capabilities.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Indicators of Compromises [IOC] to detect Qakbot\/Qbot;<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>SHA256<\/td><\/tr><tr><td>77be6944abc910b26f861b4f7e92312b3587866f62df822dab82f263a2abc30e<\/td><\/tr><tr><td>85568068da6d4822b42621edc3e3a2e2a9305f19aa83b1d6901a9b5b5d192427<\/td><\/tr><tr><td>543a6979f645d48d87b27bf4f4745542a0f259ad3f30958d94370d2a5a47e1dc<\/td><\/tr><tr><td>2b25d6b0d7e175b21f6ef78f18a609b9f9099e3d83dd3d80475bedb2bbe501c0<\/td><\/tr><tr><td>2ae7122a31087d4af5cb9975fde6d875391b76f312003452eb22b7cd1c9ed7c6<\/td><\/tr><tr><td>c0175a4b424083ecfb6ed9fafb2beb7be4e92f4937ef73948f2225a6161127ee<\/td><\/tr><tr><td>881307774570c509616466363b86163f82b01248d3fb4f084598dcccb2f9b92a<\/td><\/tr><tr><td>f5d1f79c5ae796efffc2649fe6d61b1f6e1017061f573545e3038cb7729928c2<\/td><\/tr><tr><td>4c59f956bdf4569e2fade1dc737494fda7300933a75bb0b4b2da1651b84952dc<\/td><\/tr><tr><td>72b2ba0f0a21cd30e9ecc18e2db0b8e6b553b81ea4b25450093d03420dca8bda<\/td><\/tr><tr><td>59558951a8f67deb88d7aba394c10e5cc1ff8034526c2abce74ca98be8288ce2<\/td><\/tr><tr><td>f41c34247b99d977d027a2d71b6d5e9f4538594e075aa99aa8cede3ca7c0b68b<\/td><\/tr><tr><td>bb15f44ddfd5061d32da1ad3441643d4b2a3ae2a29e15b994b47cd6544a4464a<\/td><\/tr><tr><td>f58f33af6fcd57fd5696621fb6363a110444212d2e4cf414c6b5733351630b6b<\/td><\/tr><tr><td>3463615b1e091e9d28c724181f6e622e437d61c20375877dbae882d0571c4037<\/td><\/tr><tr><td>c94f22c56e964d49947002774fc30ba887f72bd458bae9a9fb959cc475b1001a<\/td><\/tr><tr><td>d24d58d48ac759c504408b26ec6c80b9165042758b001b1f84682adc96162c90<\/td><\/tr><tr><td>02c8410377d4ebe450bab9f1ebff93363876433995868def38b16f3b0af0e11c<\/td><\/tr><tr><td>5f3dea46780846464cdb3386fd7a1a24881964b91cf307765af46db3ed328c70<\/td><\/tr><tr><td>0da5eff6246fc7f33a324833274fc402abf69864195b7b505ec15d7ca2bcc7ac<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>MITRE ATT&amp;CK Tactics &amp; Techniques used by QBot:<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>ID<\/td><td>Tactics<\/td><td>Technique<\/td><\/tr><tr><td>TA0001<\/td><td>Initial Access<\/td><td>T1566.001 \u2013 Spearphishing Attachment T1566.002 \u2013 Spearphishing Link<\/td><\/tr><tr><td>TA0002<\/td><td>Execution<\/td><td>T1027 \u2013 Obfuscated Files or Information T1059.005 \u2013 Visual Basic T1204.002 \u2013 Malicious File<\/td><\/tr><tr><td>TA0003<\/td><td>Persistence<\/td><td>T1053.005 \u2013 Scheduled Task T1547.001 \u2013 Registry Run Keys \/ Startup Folder<\/td><\/tr><tr><td>TA0004<\/td><td>Privilege Escalation<\/td><td>T1053.005 \u2013 Scheduled Task<\/td><\/tr><tr><td>TA0005<\/td><td>Defense Evasion<\/td><td>T1027.002 \u2013 Software Packing T1055 \u2013 Process Injection T1055.012 \u2013 Process Hollowing T1497.001 \u2013 System Checks<\/td><\/tr><tr><td>TA0006<\/td><td>Credential Access<\/td><td>T1003 \u2013 OS Credential Dumping T1110.001 \u2013 Password Guessing T1555.003 \u2013 Credentials from Web Browsers<\/td><\/tr><tr><td>TA0007<\/td><td>Discovery<\/td><td>T1016 \u2013 System Network Configuration Discovery<\/td><\/tr><tr><td>TA0011<\/td><td>C&amp;C Server<\/td><td>T1071.001 \u2013 Web Protocols T1090 \u2013 Proxy T1090.002 \u2013 External Proxy<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-text-align-center\"><em>This lab article is a living blog post\u2026 We will update this blog post, as appropriate.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>QakBot, aka QBot, QuakBot or Pinkslipbot, is a banking trojan malware that has existed for over a decade. The main purpose of Qbot is to steal banking credentials and other financial information (e.g., login credentials, passwords etc), while being able to deploy additional malware, log a user&rsquo;s keystrokes, and create a backdoor to the compromised [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2630,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-2094","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-labs"],"_links":{"self":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/comments?post=2094"}],"version-history":[{"count":3,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2094\/revisions"}],"predecessor-version":[{"id":4203,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2094\/revisions\/4203"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/media\/2630"}],"wp:attachment":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/media?parent=2094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/categories?post=2094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/tags?post=2094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}