{"id":2007,"date":"2024-06-13T18:20:23","date_gmt":"2024-06-14T01:20:23","guid":{"rendered":"https:\/\/www.skierpage.com\/blog\/?p=2007"},"modified":"2024-06-13T18:53:48","modified_gmt":"2024-06-14T01:53:48","slug":"software-sneaky-gnihctamsim-phishing","status":"publish","type":"post","link":"https:\/\/www.skierpage.com\/blog\/2024\/06\/software-sneaky-gnihctamsim-phishing\/","title":{"rendered":"software: sneaky &#8220;gnihctamsim&#8221; phishing"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I got an e-mail asking for my bank details.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:70%\">\n<p class=\"wp-block-paragraph\">From: <code>Michael Doyle &lt;ventas@farbiq.com.ar><\/code><br>To: undisclosed recipients:;<br>Reply to: <code>logistica.industrialparts@gmail.com<\/code><br>Subject: <strong>Re: URGENT PROFORMA INVOICE<\/strong><br><br>Hello Dear, Greetings<br><br>Our company has approved the attached purchase order. Please review the purchase order list, and return to us proforma invoice with your receiving bank account for payment.<br><br>I wait for your reply.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Michael L. Doyle<br>President<br>Direct: +1 978.834.0505 x12<br>Email: md@ppsystems.com<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15%\"><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">with an attached file <code>PURCHASE QUOTATION LIST sxlx..zip<\/code> , a compressed &#8220;zip&#8221; archive file that suggests it&#8217;s a Microsoft Office Excel spreadsheet. <strong><em>This is a scam!<\/em><\/strong> Bad writing, it&#8217;s not specifically addressed to me, the three e-mail addresses don&#8217;t match, I&#8217;ve never heard of the company, and there&#8217;s no reason to compress a real Office<code>.xlsx<\/code> (or <code>.docx<\/code>, etc.) file, which is already compressed. If you get something like this, mark it as junk\/spam, and if it claims to be from a legit company do a web search for &#8220;<em>company name<\/em> report phishing e-mail&#8221; and forward it to the e-mail address any good company should provide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Excel? XL SX? sxlx?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">But for fun let&#8217;s investigate what&#8217;s going on. First, save the attachment to a temporary folder.  The part of the filename before the extension in  <code>P<\/code><code>URCHASE QUOTATION LIST sxlx..zip<\/code> implies it contains an Excel spreadsheet (the Excel file extension is <code>.xlsx<\/code>), but in reality it is  meaningless; the zip file could contain any set of files with any names. I&#8217;m on Linux, so start a terminal and type some commands to examine the zip file. (There might be Windows or Mac equivalents to these commands; on Windows you can install the Windows Subsystem for Linux for maximum geekery.) To start let&#8217;s test and list (using <strong><code>-tv<\/code><\/strong> options) its contents.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>unzip -tv \/tmp\/PURCHASE\\ QUOTATION\\ LIST\\ sxlx..zip<\/strong> \nArchive:  \/tmp\/PURCHASE QUOTATION LIST sxlx..zip\nPURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe:  mismatching \"local\" filename (PURCHASE QUOTATION LIST\u0442\u0410\u043es\u2550\u041fx\u2550\u041fl\u2550\u041fx\u2550\u041f..exe),\n         continuing with \"central\" filename version\n    testing: PURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe   OK\nAt least one warning-error was detected in \/tmp\/PURCHASE QUOTATION LIST sxlx..zip.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Notice there&#8217;s a reversed message from the unzip program here. The name of the one file in the zip archive very likely has some special character codes in it that changes text display into right-to-left mode (for languages such as Hebrew), and they spill over into the display of the message, making it hard to read and <em>importantly<\/em>, obscuring the order of the letters in the file&#8217;s name. If you copy and paste only the word &#8220;gnihctamsim&#8221; above and paste it somewhere else the letters appear the right way round, because you probably didn&#8217;t copy the character code that flips the order of the visible letters; and if you click at the start of the message and drag to the right to select it you&#8217;ll see the selection highlight jump around as the selection feedback tries to show you selecting the<em> end<\/em> of the text and then less and less of the backwards text. (The details of how this blog post appears depend on how your browser handles special characters \u2013 download Firefox!) The warning message is <strong>mismatching &#8220;local&#8221; filename  :exe..xlxs<\/strong> , warning that the file extension doesn&#8217;t match what it appears to be, and I think that triggers the final &#8220;At least one warning-error was detected&#8230;&#8221; message. In Windows, a file with a <code>.exe<\/code> extension can be an  <strong>exe<\/strong>cutable file, a binary program of computer instructions that can literally do anything: show a fun game, forward your sensitive documents to a foreign computer, encrypt all your files and demand a ransom, install malware that will forever mine Bitcoins or spy on you, and worse! Here the <code>exe<\/code> part seems to come before the ending <code>..xlxs<\/code> and it&#8217;s the &#8220;final&#8221; dot-whatever that influences how the operating system treats the file. But because the text has gone into right-to-left mode, it looks like <code><em>blab blah exe blah<\/em>.xlxs<\/code>, which almost looks like the file extension for a spreadsheet so maybe people will ignore the warning, assuming it even shows up on Windows built-in zip file handling. (I don&#8217;t know what the point of the weird characters <strong>T\u0442\u0410\u043es\u2550\u041fx\u2550\u041fl\u2550\u041fx\u2550\u041f<\/strong> in the file are before\/after the right-to-left &#8220;TSIL&#8221;\/LIST.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s actually use the <strong><code>unzip<\/code><\/strong> utility to uncompress the zip file it into a temporary subfolder. This would be risky on Windows, but I&#8217;m on Linux and I don&#8217;t think I have any Windows emulators or WINE (&#8220;Wine Is Not an Emulator&#8221;) that can actually run the file, and I&#8217;ll be careful not to accidentally run or &#8220;double-click&#8221; it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>mkdir \/tmp\/PURCHASE_QUOTATION_quarantine<\/strong>\n% <strong>cd \/tmp\/PURCHASE_QUOTATION_quarantine<\/strong>\n% <strong>unzip ..\/PURCHASE\\ QUOTATION\\ LIST\\ sxlx..zip<\/strong> \nArchive:  ..\/PURCHASE QUOTATION LIST sxlx..zip\nPURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe:  mismatching \"local\" filename (PURCHASE QUOTATION LIST\u0442\u0410\u043es\u2550\u041fx\u2550\u041fl\u2550\u041fx\u2550\u041f..exe),\n         continuing with \"central\" filename version\n  inflating: PURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe  <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That looks OK, because it looks like it ends in &#8220;.xlsx&#8221;. But with all the right-to-left and mirror writing crap going on, does it really?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s really at the end? What is the end in the middle?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s try to get a listing of the one file we uncompressed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>ls --size<\/strong>\n<em>appears to my eyes as<\/em> 2396 'PURCHASE QUOTATIONLISTsxlx..exe'\n<em>pastes here as <\/em>2396 'PURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe'\n% <em>type<\/em> <strong>*.exe<\/strong>&#91;Tab]\n<em>expands to<\/em> % PURCHASE\\ QUOTATION\\ LIST&lt;202e>s&lt;034f>x&lt;034f>l&lt;034f>x&lt;034f>..exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s where it gets extra weird. The one file in the archive uncompressed into a 2,396 kilobyte (2 Megabytes or so) file. What I see in the terminal is &#8216;PURCHASE QUOTATION LISTsxlx.<strong>.exe<\/strong>, which is <strong>BAD<\/strong>, it&#8217;s an executable. But when I copy-pasted it into the paragraph above, it appears backwards with <strong>.xlxs<\/strong> on the end. It&#8217;s only when I expand the filename on the command line by pressing [Tab] or when I view the directory contents in my editor (vim) that I see the escape codes messing this up. And I&#8217;m now in a mess of what&#8217;s actually in the file name versus the terminal escape codes that tell the terminal to display things in bold and go into reverse mode and such. I wasted time trying to find a set of arguments to utilities <strong><code>hexdump<\/code><\/strong>, <strong><code>od<\/code><\/strong>, and <strong><code>strings<\/code><\/strong> that would print the regular letters and reveal the Unicode code points (or terminal escape characters?), e.g.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>ls *.exe | strings --unicode=x<\/strong> \nPURCHASE QUOTATION LIST&lt;0xe280ae&gt;s&lt;0xcd8f&gt;x&lt;0xcd8f&gt;l&lt;0xcd8f&gt;x&lt;0xcd8f&gt;..exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I even asked ChatGPT to write a program to get the filename in the directory and print it out using Unicode escapes for the code points. After some coaxing it politely and helpfully wrote a 30-line Python program that when run prints:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>python3 ~\/bin\/dirlist_codepoints.py<\/strong> \nOriginal: PURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe\nCode Points: PURCHASE\u00a0QUOTATION<em>\\u0020<\/em>LIST<em>\\u00e2\\u0080\\u00ae<\/em>s<em>\\u00cd\\u008f<\/em>x<em>\\u00cd\\u008f<\/em>l<em>\\u00cd\\u008f<\/em>x<em>\\u00cd\\u008f<\/em>..exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">How come none of these agree? Is it really that complicated? (Yes, it is.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Careful with that tfeL-ot-thgiR<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">What is the <code>202e<\/code> when the file name first starts to display weird? Most sequences of text these days use Unicode to represent regular &#8220;typewriter&#8221; characters, accented characters, symbols, hieroglyphs, Asian logographs, emoji, and the thousands of other &#8220;characters&#8221; we now put in text. A DuckDuckGo web search for &#8220;unicode \\202e&#8221; reveals<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>U+202E RIGHT-TO-LEFT OVERRIDE &#8211; Unicode Explorer<\/strong><br>The Right-To-Left Override character can be used to force a right-to-left direction withing a text. This is often abused by hackers to disguise file extensions: when using it in the file name my-text.&#8217;U+202E&#8217;cod.exe, the file name is actually displayed as my-text.exe.doc &#8211; so it seems to be a <code>.doc<\/code> file while in reality it is an <code>.exe<\/code> file. There&#8217;s even an <a href=\"https:\/\/xkcd.com\/1137\/\" target=\"_blank\" rel=\"noreferrer noopener\">xkcd comic<\/a> for this character!<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">So that&#8217;s the explanation for the start of the problem and why part of the filename and text nearby appear reversed. I&#8217;ll leave the decoding of the rest of the weird characters to actual security and Unicode professionals.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Danger nerd humor alert<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">What&#8217;s extreme nerd humor is many of the search results are from useless web sites that try to appear high in search results with computer-generated web pages for every possible Unicode character, like &#8220;Unicode Character <img loading=\"lazy\" decoding=\"async\" height=\"16\" width=\"16\" src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/tf7\/1\/16\/1f48c.png\" alt=\"\ud83d\udc8c\"> (U+1F48C) is &#8216;LOVE LETTER&#8217;&#8230;&#8221; (together with a bunch of ads and privacy-sucking JavaScript tracking). But when the page &#8220;shows&#8221; the Right-to-Left Override &#8220;character,&#8221; the snippet in search results (and the web site&#8217;s page, but don&#8217;t go there) appears in reverse.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/images\/web\/unicode_rtl_garbled_search_results.png\" alt=\"screenshot showing reversed text in search results for RIGHT-TO-LEFT OVERRIDE Unicode code point\n\"\/><figcaption class=\"wp-element-caption\">Naively print out a direction change &#8220;character&#8221; and you&#8217;re gonna have a bad time<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" height=\"16\" width=\"16\" alt=\"\ud83e\udd16\" src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/t36\/1\/16\/1f916.png\"> ha. ha. ha. <img loading=\"lazy\" decoding=\"async\" height=\"16\" width=\"16\" alt=\"\ud83d\ude06\" src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/td4\/1\/16\/1f606.png\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the executable?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Let&#8217;s not run it!<\/em>, even under Linux.Instead use the <strong><code>file<\/code><\/strong> utility to see what kind of file it is.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>file PURCHASE\\ QUOTATION\\ LIST&lt;202e&gt;s&lt;034f&gt;x&lt;034f&gt;l&lt;034f&gt;x&lt;034f&gt;..exe<\/strong>\nPURCHASE QUOTATION LIST\u202es\u034fx\u034fl\u034fx\u034f..exe: PE32+ executable (GUI) x86-64 Mono\/.Net assembly, for MS Windows, 2 sections<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Any utility that displays the file&#8217;s name without extreme care is going to have reversed output, and <strong><code>file<\/code><\/strong> does too. The right-to-left text is telling us it&#8217;s an <strong>assembly, for MS Windows, 2 sections sxlx..exe: PE32+ executable (GUI) x86-64 Mono\/.Net<\/strong>. You can write a 2 MB standalone program that does a hell of a lot of bad stuff, but who knows what the executable section would do. I wonder if there&#8217;s actually a spreadsheet in there as well as computer code. For fun let&#8217;s see what strings of characters are in it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>% <strong>strings *.exe | less<\/strong>\n!This program cannot be run in DOS mode.\n.text\n...\noT8=\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n&lt;assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n  &lt;assemblyIdentity version=\"1.0.0.0\" name=\"MyApplication.app\"\/>\n  &lt;trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n    &lt;security>\n      &lt;requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        &lt;requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\"\/>\n      &lt;\/requestedPrivileges>\n    &lt;\/security>\n  &lt;\/trustInfo>\n&lt;\/assembly>\nxkcva2wfKaiDsaDdws,\n...\n%xkcva2wfKaiDsaDdwsPAPADDINGXXPAPADDINGXXPAPADDINGXX...<em>PADDINGXX repeated thousands of times sover and over and over<\/em>...PADDINGXXPAPADDIN\n(END)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So there is some kind of program in there announcing that it wants to run with my privileges, which when I boot into Windows is an administrator with lots of rights.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">scary stuff!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got an e-mail asking for my bank details. From: Michael Doyle &lt;ventas@farbiq.com.ar>To: undisclosed recipients:;Reply to: logistica.industrialparts@gmail.comSubject: Re: URGENT PROFORMA INVOICE Hello Dear, Greetings Our company has approved the attached purchase order. Please review the purchase order list, and return &hellip; <a href=\"https:\/\/www.skierpage.com\/blog\/2024\/06\/software-sneaky-gnihctamsim-phishing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,18],"tags":[],"class_list":["post-2007","post","type-post","status-publish","format-standard","hentry","category-search","category-software"],"_links":{"self":[{"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/posts\/2007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/comments?post=2007"}],"version-history":[{"count":10,"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/posts\/2007\/revisions"}],"predecessor-version":[{"id":2018,"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/posts\/2007\/revisions\/2018"}],"wp:attachment":[{"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/media?parent=2007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/categories?post=2007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skierpage.com\/blog\/wp-json\/wp\/v2\/tags?post=2007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}