{"id":8466,"date":"2025-11-15T04:03:47","date_gmt":"2025-11-15T04:03:47","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/11\/15\/32480\/"},"modified":"2025-11-15T04:03:47","modified_gmt":"2025-11-15T04:03:47","slug":"32480","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/11\/15\/32480\/","title":{"rendered":"Formbook Delivered Through Multiple Scripts, (Thu, Nov 13th)"},"content":{"rendered":"<p>    Formbook Delivered Through Multiple Scripts, (Thu, Nov 13th)<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p data-endline=\"1\" data-startline=\"1\" id=\"Formbook-Delivered-Through-Multiple-Layers-of-Scripts\">When I\u2019m teachning FOR610[<a href=\"https:\/\/www.sans.org\/cyber-security-courses\/reverse-engineering-malware-malware-analysis-tools-techniques\">1<\/a>], I always say to my students that reverse engineering does not only apply to \u201cexecutable files\u201d (read: PE or ELF files). Most of the time, the infection path involves many stages to defeat the Security Analyst or security controls. Here is an example that I found yesterday. An email was received via an attached ZIP\u00a0archive. It contained a simple file: \u201cPayment_confirmation_copy_30K__202512110937495663904650431.vbs\u201d (SHA256:d9bd350b04cd2540bbcbf9da1f3321f8c6bba1d8fe31de63d5afaf18a735744f) identified by 17\/65 antiviruses on VT[<a href=\"https:\/\/www.virustotal.com\/gui\/file\/d9bd350b04cd2540bbcbf9da1f3321f8c6bba1d8fe31de63d5afaf18a735744f\">2<\/a>]. Let\u2019s have a look at the infection path.<\/p>\n<p data-endline=\"5\" data-startline=\"5\">The VBS script was obfuscated but\u00a0easy to reverse. First it started with a delay loop of 9 seconds:<\/p>\n<pre data-endline=\"12\" data-startline=\"7\" style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nDim Hump\nHump = DateAdd(\u201cs\u201d, 9, Now())\nDo Until (Now() &gt; Hump)\n    Wscript.Sleep 100\n    Frozen = Frozen + 1\nLoop<\/pre>\n<p data-endline=\"14\" data-startline=\"14\">This allow the script to wait before performing nasty actions and avoid using the sleep() function which is often considered as suspicious. Then the script will generate a PowerShell script by concatenating a lot of strings. The \u201cPowerShell\u201d string is hidden behind this line:<\/p>\n<pre data-endline=\"18\" data-startline=\"18\" style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nNestlers= array(79+1,79,80+7,60+9,82,83,72,69,76,76)<\/pre>\n<p data-endline=\"20\" data-startline=\"20\">The script is reconstructed like this:<\/p>\n<pre data-endline=\"33\" data-startline=\"23\" style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nRoastable11 = Roastable11 + \u201cmv 'udenri\u201d\nRoastable11 = Roastable11 + \u201cgstjenes\u201d\nRoastable11 = Roastable11 + \u201cte\u2019;\u201d\nRoastable11 = Roastable11 + \u201cfunction \"\nRoastable11 = Roastable11 + \u201cMicrocoulomb\u201d\nRoastable11 = Roastable11 + \" ($s\u201d\nRoastable11 = Roastable11 + \u201ckattes\u201d\nRoastable11 = Roastable11 + \u201ckemas='sel\u201d\nRoastable11 = Roastable11 + \u201cvang\u201d\nRoastable11 = Roastable11 + \u201cav\u2019)\u201d\n...<\/pre>\n<p data-endline=\"35\" data-startline=\"35\">The result is executed with an Shell.Application object. The PowerShell script is also heavily obfuscated. Two functions are used for this purpose:<\/p>\n<pre data-endline=\"58\" data-startline=\"55\" style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nfunction Microcoulomb ($skatteskemas=\u2018selvangav\u2019)\n{\n    $bletr=4;\n    do {\n        folkesangeren+=skatteskemas[$bletr];\n        $bletr+=5;\n        overhringens=Get-Date\n    }\n    until (!skatteskemas[$bletr]);\n    $folkesangeren\n}\n\nfunction Blokbogstavers65 ($srlings)\n{\n    countryish22(srlings)\n}<\/pre>\n<p data-endline=\"60\" data-startline=\"60\">The second function just invokes an \u201cInvoke-Expression\u201d with the provided string. The first one reconstrusts strings by extraction some characters from the provided one. Example:<\/p>\n<pre data-endline=\"63\" data-startline=\"62\" style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\n$mesoventrally=Microcoulomb \u2019 :::n TTTEJJJJTjjjj.nnnnw::::E\u2019;\n$mesoventrally+=Microcoulomb \u2018i iiB SSSCccc l EE INNNNe * *n;;;;t\u2019;<\/pre>\n<p data-endline=\"65\" data-startline=\"65\">The variable meseventrally will containt \u201cnET.wEBClIent\u201d.<\/p>\n<p data-endline=\"67\" data-startline=\"67\">The first part of the deobfuscated script will prepare the download of the next payload:<\/p>\n<pre data-endline=\"77\" data-startline=\"69\" style=\"background: rgb(238, 238, 238); border: 1px solid rgb(204, 204, 204); padding: 5px 10px;\">\nwhile ((!brandmesterens))\n{\n    Blokbogstavers65 (Microcoulomb '...\u2019) ;\n    Blokbogstavers65 retsforflgende;\n    Blokbogstavers65 (Microcoulomb '...');<s>\n<\/s>    Blokbogstavers65 (Microcoulomb '...<em>') ;\n    <\/em>Blokbogstavers65 (Microcoulomb '...\u2019) ;\n    fedayee=serigraphic[$dichotomically]\n}<\/pre>\n<p data-endline=\"79\" data-startline=\"79\">The loop waits for a successful download from ths URL: hxxps:\/\/drive[.]google[.]com\/uc?export=download&amp;id=1jFn0CatcuICOIjBsP_WxcI_faBI9WA9S<\/p>\n<p data-endline=\"81\" data-startline=\"81\">It stores the payload in C:UsersREMAppDataRoamingbudene.con. Once decoded, it\u2019s another piece of PowerShell that also implements deobfuscation functions.<\/p>\n<p data-endline=\"94\" data-startline=\"83\">The script will invoke an msiexec.exe process and inject the FormBook into it. The injected payload\u00a0is C:UsersREMAppDataLocalTempbin.exe (SHA256:12a0f592ba833fb80cc286e28a36dcdef041b7fc086a7988a02d9d55ef4c0a9d)[<a href=\"https:\/\/www.virustotal.com\/gui\/file\/12a0f592ba833fb80cc286e28a36dcdef041b7fc086a7988a02d9d55ef4c0a9d\">3<\/a>]. The C2 server is 216[.]250[.]252[.]227:7719.<\/p>\n<p data-endline=\"94\" data-startline=\"83\">Here is an overview of the activity generated by all the scripts on the infected system:<\/p>\n<p data-endline=\"94\" data-startline=\"83\"><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/isc-20251113-1.png?ssl=1\" style=\"width: 1000px; height: 678px;\"><\/p>\n<p>[1]\u00a0<a href=\"https:\/\/www.sans.org\/cyber-security-courses\/reverse-engineering-malware-malware-analysis-tools-techniques\">https:\/\/www.sans.org\/cyber-security-courses\/reverse-engineering-malware-malware-analysis-tools-techniques<\/a><br \/>\n[2]\u00a0<a href=\"https:\/\/www.virustotal.com\/gui\/file\/d9bd350b04cd2540bbcbf9da1f3321f8c6bba1d8fe31de63d5afaf18a735744f\">https:\/\/www.virustotal.com\/gui\/file\/d9bd350b04cd2540bbcbf9da1f3321f8c6bba1d8fe31de63d5afaf18a735744f<\/a><br \/>\n[3]\u00a0<a href=\"https:\/\/www.virustotal.com\/gui\/file\/12a0f592ba833fb80cc286e28a36dcdef041b7fc086a7988a02d9d55ef4c0a9d\">https:\/\/www.virustotal.com\/gui\/file\/12a0f592ba833fb80cc286e28a36dcdef041b7fc086a7988a02d9d55ef4c0a9d<\/a><\/p>\n<p>Xavier Mertens (@xme)<br \/>\nXameco<br \/>\nSenior ISC Handler &#8211; Freelance Cyber Security Consultant<br \/>\n<a href=\"https:\/\/keybase.io\/xme\/key.asc\">PGP Key<\/a><\/p>\n<p> (c) SANS Internet Storm Center. https:\/\/isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.<\/p><\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><\/p>\n<p> \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/isc.sans.edu\/diary\/rss\/32480\">Go to isc.sans.edu<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Formbook Delivered Through Multiple Scripts, (Thu, Nov 13th) When I\u2019m teachning FOR610[1], I always say to my students that reverse engineering does not only apply to \u201cexecutable files\u201d (read: PE or ELF files). Most of the time, the infection path involves many stages to defeat the Security Analyst or security controls. Here is an example [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[69],"class_list":["post-8466","post","type-post","status-publish","format-standard","hentry","category-isc-sans-edu","tag-isc-sans-edu"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/8466"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=8466"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/8466\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=8466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=8466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=8466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}