Analysis and Takeapart of a UPS Parcel Shipping Problem Spoof

Analysis and Takeapart of a UPS Parcel Shipping Problem Spoof

At least once a week I get attachments from a “reputable” organization saying my account (that I don't have) has been locked due to suspicious activity being detected, a bank account (that I don't have) needs verification, or there is a problem with the shipment of a parcel (I didn't order). This week I got an interesting one from "Jordan Mccabe, UPS Station Manager". Sadly the sending individual doesn't know enough about the target to realize that "UPS" and "Post Office", well, kind of mismatch. But this one got me interested in doing some reverse engineering of the suspicious attachment because of it's small size, only 817 bytes.

Dear Customer,
Your item has arrived at the UPS Post Office at February 25, but the courier was unable to deliver parcel to you.
Postal label is enclosed to this e-mail. Please check the attachment!
Yours sincerely,
Jordan Mccabe,
UPS Station Manager.

The highlighted areas indicate areas that commonly give away the fact that it is a spoof. Usually the sender address is strange or wrong, the grammar is wrong, and the context of the message is wrong.

Unzipping the attachments creates a second zip file with a .doc.zip extension (Microsoft Word Document.Compressed File) that is 694 bytes long. Most Windows installations will show this as .doc file rather than as it's true extension which is a .zip file.Unzipped Attachment: UPS-Parcel-ID-001210497.doc.zipUnzipped Attachment Checksum (MD5): 6a6d2e478e7a2b0259f1fcc333e7cde3

My interpretation is that if one were to double click on that file in a File Explorer window, Windows would actually extract the compressed file and try to execute it with the proper software. But we are doing this on Ubuntu 16.04, so we have to do it manually and make some assumptions that may not be valid. We'll get to that later…

Unzipping the compressed document file gives a third file with a .doc.js extension (Microsoft Word Document.JavaScript Source) that is, again, 817 bytes long. I believe that this JavaScript file would then be executed by the default browser on the system, which would normally be Microsoft Internet Explorer or, now, Microsoft Edge.Unzipped Document File: UPS-Parcel-ID-001210497.doc.jsUnzipped Document File Checksum (MD5): f1bce6d06683909f54cefd27490c097d

The content of this JavaScript installer is as follows. It is simply encoded in an attempt to defeat malware scanners. For simplicity I've removed blank lines:

The JavaScript goes out to five websites and downloads encoded preliminary payloads that are using something similar to steganography for obfuscation purposes. After configuring variables, the script creates an ActiveX object, vDJmB (line 10), assigns it to a variable, e (line 13), then tries to open the ActiveX object with the parameters shown in (line 16). The five sites listed for this version are in array variable x (line 4), and the key is in variable m (line 3). If successful, the script assigns the response to a variable, r (line 18), checks it's size, and then evaluates the decoded primary payload (line 21), which is also JavaScript.