{"id":2831,"date":"2024-09-25T20:10:15","date_gmt":"2024-09-25T20:10:15","guid":{"rendered":"https:\/\/xdr-mdr.lmntrix.com\/main_web\/?p=2831"},"modified":"2025-07-29T06:41:18","modified_gmt":"2025-07-29T06:41:18","slug":"_%e3%83%84_-%c2%af-hit-by-shrug-ransomware-heres-how-to-decrypt-without-paying","status":"publish","type":"post","link":"https:\/\/lmntrix.com\/blog\/_%e3%83%84_-%c2%af-hit-by-shrug-ransomware-heres-how-to-decrypt-without-paying\/","title":{"rendered":"_(\u30c4)_\/\u00af &#8211; hit by Shrug Ransomware? Here\u2019s how to decrypt without paying"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"500\" height=\"158\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/1-2-4.webp\" alt=\"\" class=\"wp-image-2834\"\/><\/figure>\n<\/div>\n\n\n<p><strong>Overview<\/strong><\/p>\n\n\n\n<p>Shrug Ransomware, the latest malware LMNTRIX researchers have seen in the wild, had the potential to be devasting \u2013 fortunately, its authors left the keys needed to unlock files in the registry. This means victims can basically \u2018shrug it off\u2019 because files can be decrypted without having to pay the ransom.&nbsp;<\/p>\n\n\n\n<p>To be specific, Shrug uses Random Key Generation for each user and the key is stored in the registry \u2013 this value is referenced by the ransomware for encryption\/decryption.<\/p>\n\n\n\n<p>By following the below steps, a victim can decrypt their files and remove the ransomware:&nbsp;<\/p>\n\n\n\n<p><strong>Step 1<\/strong>. Restart the infected machine to remove the Lock screen and terminate the malicious process responsible for locking the mouse and keypad (explained in further detail in the analysis)&nbsp;<\/p>\n\n\n\n<p><strong>Step 2<\/strong>: &nbsp;Open File explorer<\/p>\n\n\n\n<p><strong>Step 3<\/strong>: Enter the Shrug ransomware installer path (C:\\Users\\USERNAME\\AppData\\Local\\Temp\\shrug.exe)&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"523\" height=\"215\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/a.webp\" alt=\"\" class=\"wp-image-2835\"\/><\/figure>\n\n\n\n<p><strong>Step 4<\/strong>. Perform a Permanent delete of the installer file \u201c<strong>shrug.exe<\/strong>\u201d [Shift + Delete]\n\n\n\n<p><strong>Step 5<\/strong>. Open RUN app on Windows by typing \u201cRUN\u201d on Windows search panel, type <strong>Regedit<\/strong> and hit <strong>OK<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"452\" height=\"255\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/b.webp\" alt=\"\" class=\"wp-image-2836\"\/><\/figure>\n\n\n\n<p><strong>Step 6<\/strong>. Navigate to the location <strong>HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"267\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/c.webp\" alt=\"\" class=\"wp-image-2837\"\/><\/figure>\n\n\n\n<p><strong>Step 7<\/strong>. Identify the Key value titled <strong>\u201cShrug\u201d<\/strong><\/p>\n\n\n\n<p><strong>Step 8<\/strong>. Copy the key value of <strong>\u201cShrug\u201d<\/strong> for future reference in a text file, right-click on it and hit <strong>\u201cDelete\u201d<\/strong><\/p>\n\n\n\n<p><strong>Step 9<\/strong>. Clear your <strong>Recycle Bin<\/strong> and Restart the machine<\/p>\n\n\n\n<p>Although the ransomware can be easily removed, prevention is always better than cure. In Shrug\u2019s case, its authors primarily deliver the payload via drive by downloads or embedding the ransomware in fake software or gaming applications. Users should ensure they\u2019re only downloading authentic versions of software to avoid falling victim in the first place.&nbsp;<\/p>\n\n\n\n<p>While we will unpack Shrug in detail, first let\u2019s look at the functionality that allows us to negate the ransomware without having to pay anything.<\/p>\n\n\n\n<p>Hypothetically, after a ransom is paid, Shrug ransomware uses the same unique identifier it uploads to a remote server to decrypt files.<\/p>\n\n\n\n<p>A unique identifier list is downloaded from:&nbsp;<\/p>\n\n\n\n<p>\u201chxxp:\/\/tempacc11vl[.]000webhostapp[.]com\/marthas_stuff\/freehashes.txt&#8221;.<\/p>\n\n\n\n<p>Once the list is downloaded, Shrug searches the list using the Unique Identifier for the paying victim\u2019s machine and decrypts the files.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"505\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/d.webp\" alt=\"\" class=\"wp-image-2838\"\/><\/figure>\n\n\n\n<p><em>Figure 1: Shrug\u2019s decryption process and messages<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"632\" height=\"210\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/e.webp\" alt=\"\" class=\"wp-image-2839\"\/><\/figure>\n\n\n\n<p><em>Figure 2: &nbsp;ShrugForm Decrypt<\/em><\/p>\n\n\n\n<p>Shrug stores the Random Key Generation for a specific user in the registry. It is this value that the ransomware references for encryption\/decryption. The Keys are stored under Windows\\CurrentVersion\\Run \u201cShrug\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"254\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/f.webp\" alt=\"\" class=\"wp-image-2840\"\/><\/figure>\n\n\n\n<p><em>Figure 3 Code to write registry key<\/em><\/p>\n\n\n\n<p>With that being said, lets dive in to Shrug in more detail:<\/p>\n\n\n\n<p><ins><strong>File Analysis<\/strong><\/ins><\/p>\n\n\n\n<p><strong>File Hash (SHA256):&nbsp;<\/strong><\/p>\n\n\n\n<p>\u2022&nbsp;&nbsp; &nbsp;b14a57ad391d9ba5b2714dad4773118f118ed8d64b523466bb60f3b18336efc1<\/p>\n\n\n\n<p>\u2022&nbsp;&nbsp; &nbsp;9f802a6a86b4df3730bc47372626279eef4544e4a2d75a7989fdf5405627ac7c<\/p>\n\n\n\n<p><strong>File Size<\/strong>: 24.5 KB<\/p>\n\n\n\n<p>The original file is compiled using .NET. The ransomware\u2019s main function contains the below code (see Figure 4) to drop Shrug.exe. This contains the function cryptor to decrypt the contents of \u201cShrugEnc\u201d and drops Shrug.exe in %temp% directory.&nbsp;<\/p>\n\n\n\n<p>It then creates a Windows\\CurrentVersion\\Run entry, with the value \u2018Shrug\u2019, to point to the dropped .exe file \u2013 this ensures it runs on every windows start-up.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"299\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/g.webp\" alt=\"\" class=\"wp-image-2841\"\/><\/figure>\n\n\n\n<p><em>Figure 4: Main Function<\/em><\/p>\n\n\n\n<p>The cryptor (String Key, String IV) function uses common AES Encryption\/Decryption functions from \u201cSystem.Security.Cryptography;&#8221; as shown below in Figure 5.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"885\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/h-1024x885.webp\" alt=\"\" class=\"wp-image-2842\"\/><\/figure>\n\n\n\n<p><em>Figure 5: AES Cryptography Encryption\/Decryption Functions<\/em><\/p>\n\n\n\n<p>The main file contains an Encrypted Resource named \u201cShrugEnc\u201d as shown below in Figure 6.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"603\" height=\"690\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/i.webp\" alt=\"\" class=\"wp-image-2843\"\/><\/figure>\n\n\n\n<p><em>Figure 6: Encrypted ShrugEnc in Resources<\/em><\/p>\n\n\n\n<p>After being dropped, Shrug.exe contains strings that clearly give away its ransomware functionality, as shown in below Figure 7:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/j-1024x567.webp\" alt=\"\" class=\"wp-image-2844\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"59\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/k.webp\" alt=\"\" class=\"wp-image-2845\"\/><\/figure>\n\n\n\n<p><em>Figure 7: Shrug.exe after Decryption and Windows Run Entry.<\/em><br><br>After successful infection, Shrug locks the screen with a ransom note (see Figure 8 below) and prompts the user to pay USD $50 in bitcoin to have files restored. Files are encrypted with a unique ID and an AES Random key. The user is given three days to pay, before the files are permanently deleted.&nbsp;<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/l-1024x585.webp\" alt=\"\" class=\"wp-image-2846\"\/><\/figure>\n\n\n\n<p><br>&nbsp;<br><br><em>Figure 8 Ransom note, Timer, Attacker Bitcoin Wallet details<\/em><\/p>\n\n\n\n<p>Below is a list of files Shrug encrypts with the \u201c.SHRUG\u201d extension.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>&#8220;txt&#8221;,&#8221;docx&#8221;,&#8221;xls&#8221;,&#8221;doc&#8221;,&#8221;xlsx&#8221;,&#8221;ppt&#8221;,&#8221;pptx&#8221;,&#8221;odt&#8221;,&#8221;jpg&#8221;,&#8221;png&#8221;,&#8221;jpeg&#8221;,&#8221;csv&#8221;,&#8221;psd&#8221;,&#8221;sql&#8221;,&#8221;md<br>b&#8221;,&#8221;db&#8221;,&#8221;sln&#8221;,&#8221;html&#8221;,&#8221;php&#8221;,&#8221;asp&#8221;,&#8221;aspx&#8221;,&#8221;html&#8221;,&#8221;xml&#8221;,&#8221;json&#8221;,&#8221;dat&#8221;,&#8221;cpp&#8221;,&#8221;cs&#8221;,&#8221;py&#8221;,&#8221;pyw&#8221;,&#8221;<br>c&#8221;,&#8221;js&#8221;,&#8221;java&#8221;,&#8221;mp4&#8243;,&#8221;ogg&#8221;,&#8221;mp3&#8243;,&#8221;wmv&#8221;,&#8221;avi&#8221;,&#8221;gif&#8221;,&#8221;mpeg&#8221;,&#8221;.msi&#8221;,&#8221;zip&#8221;,&#8221;rar&#8221;,&#8221;7zip&#8221;,&#8221;7z&#8221;,&#8221;<br>bmp&#8221;,&#8221;apk&#8221;,&#8221;yml&#8221;,&#8221;qml&#8221;,&#8221;py3&#8243;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><em>Figure 9 Targeted Extensions<\/em><br><br><strong>Encryption<\/strong><br><br>Even though a victim is able to decrypt the files themselves, it is worth examining how the ransom process was designed to work, had the attackers been competent. Shrug prompts the user to pay, and in order to do so, they must provide their wallet id. These details are sent to the remote server [hxxp:\/\/tempacc11v1.000webhostapp] as shown below in Figure 10.<br><br>The details uploaded to the remote server include the victim\u2019s unique identifier (Username+MachineName), Cryptor (key, IV) and the user\u2019s Wallet id.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"518\" height=\"588\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/m.webp\" alt=\"\" class=\"wp-image-2847\"\/><\/figure>\n\n\n\n<p><em>Figure 10 Unique identifier<\/em><\/p>\n\n\n\n<p><strong>Shrug Ransomware Functionality:<\/strong><\/p>\n\n\n\n<p>Shrug ransomware could have been a devastating malware variant due to its functionality. As well as encrypting files, it had the ability to<strong> lock the screen, remove system restore points,<\/strong> and<strong> lock keyboard and mouse events <\/strong>\u2013 each of which we\u2019ll unpack in further detail below.<\/p>\n\n\n\n<p><strong>Lock Screen<\/strong><\/p>\n\n\n\n<p>Shrug uses typical Windows screen methods to lock the screen; it calculates the maximum screen coordinates using the \u2018primaryscreen\u2019 height and width values and sets the Form to that location (see Figure 11 below).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"259\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/n.webp\" alt=\"\" class=\"wp-image-2848\"\/><\/figure>\n\n\n\n<p><em>Figure 11 LockScreen (Primaryscreen)<\/em><\/p>\n\n\n\n<p><strong>Remove System Restore Points<\/strong><\/p>\n\n\n\n<p>System Restore points are removed so the user can\u2019t retrieve files through system backups. It does so using the function SRRemoveRestorePoint () from srclient.dll.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"180\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/o.webp\" alt=\"\" class=\"wp-image-2849\"\/><\/figure>\n\n\n\n<p><em>Figure 12 code snippet for removing system restore point<\/em><\/p>\n\n\n\n<p><strong>Lock Keyboard and Mouse Events:<\/strong><br><br>Keyboard and mouse events are disabled using the BlockInput() Function.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"332\" height=\"122\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/p.webp\" alt=\"\" class=\"wp-image-2850\"\/><\/figure>\n\n\n\n<p><br>&nbsp;<br><br><em>Figure 13 Keyboard-mouse events<\/em><br><br>Shrug monitors keyboard events using the function SetWindowsHookEx() and sets a call-back function to a low-level keyboard hook using the function LowLevelKeyboardProc().&nbsp;<br><br>This enables Shrug to hook all keyboard events, and block users from terminating the application.<br><br>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"153\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/q.webp\" alt=\"\" class=\"wp-image-2851\"\/><\/figure>\n\n\n\n<p><br><br><em>Figure 14 WH_Keyboard<\/em><br><br>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"267\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/r-1024x267.webp\" alt=\"\" class=\"wp-image-2852\"\/><\/figure>\n\n\n\n<p><br><br><em>Figure 15 CallNextHookEx<\/em><br><br>CallNextHookEx contains a pointer to the Ransomware module. CallNextHookEx is used when there are other applications which also use the LowLevelKeyboardProc for processing keyboard hooks in the chain. Here, Shrug doesn\u2019t allow other applications to take control of the hook chain.<br><br>When a victim tries to exit the program or use the below combination of keyboard keys to terminate, it prevents those keyboard events.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Ctrl+Alt+Delete<br>Shift+ESC<br>Ctrl+W<br>Alt+Tab<br>Alt+F4<br>Windows Key<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"483\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/s.webp\" alt=\"\" class=\"wp-image-2853\"\/><\/figure>\n\n\n\n<p><em>Figure 16 ShrugForm keydown<\/em><br><br><ins><strong>Threat Indicators<\/strong><\/ins><br><br><strong>File Hashes (SHA256)<\/strong><br><br>\u2022&nbsp;&nbsp; &nbsp;b14a57ad391d9ba5b2714dad4773118f118ed8d64b523466bb60f3b18336efc1<br><br>\u2022&nbsp;&nbsp; &nbsp;9f802a6a86b4df3730bc47372626279eef4544e4a2d75a7989fdf5405627ac7c<br><br><strong>File Extension<\/strong><br><br>\u2022&nbsp;&nbsp; &nbsp;.SHRUG<br><br><strong>Files Dropped<\/strong><br><br>\u2022&nbsp;&nbsp; &nbsp;\\AppData\\Local\\Temp\\Shrug.exe<br><br><strong>Command and Control<\/strong><br><br>hxxp:\/\/tempacc11vl[.]000webhostapp[.]com\/marthas_stuff\/freehashes.txt<br><br><strong>Registry entry added as:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Key: HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run&nbsp;<br>Value: &#8220;Shrug&#8221;<br>Data: C:\\Documents and Settings\\user\\AppData\\Local\\Temp\\Shrug.exe<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Key: HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\Shrug<br>Values:&nbsp;<br>installdate,&nbsp;<br>identifier,&nbsp;<br>installed,&nbsp;<br>key,&nbsp;<br>IV<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Conclusion<\/strong><br><br>Although attribution is always difficult in cyber security, it is fair to assume APT\u2019s or other sophisticated actors were not behind the Shrug ransomware.&nbsp;<br><br>&nbsp;<\/p>\n\n\n\n<p>On 2018-07-23<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Shrug Ransomware, the latest malware LMNTRIX researchers have seen in the wild, had the potential to be devasting &ndash; fortunately, its authors left the keys needed to unlock files in the registry. This means victims can basically &lsquo;shrug it off&rsquo; because files can be decrypted without having to pay the ransom.&nbsp; To be specific, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2834,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-2831","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\/2831","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=2831"}],"version-history":[{"count":4,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2831\/revisions"}],"predecessor-version":[{"id":4316,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2831\/revisions\/4316"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/media\/2834"}],"wp:attachment":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/media?parent=2831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/categories?post=2831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/tags?post=2831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}