(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
 

Enlarge / Eric Trump, son of then-presidential nominee Donald Trump, looks at wife Lara Yunaska's voting booth. An NSA report indicates Russia may have attempted to plant malware on the computers of election officials in the days before voting. (credit: Bloomberg / Getty Images News)

A Top Secret NSA analyst's report published by The Intercept suggests that, in August 2016, the Russian General Main Staff Intelligence Directorate (GRU) hacked into an election-related hardware and software vendor in the US. The GRU then used data from the company for at least two "spear phishing" campaigns against local government officials associated with elections—including one attack close to the election that appeared to target officials dealing with absentee ballots. The report was based on information that only became available in April of this year, and the NSA report does not reveal the name of the company.

Within an hour of the story's publication, the FBI announced the arrest of the alleged source of the leaked report. Reality Leigh Winner was arrested at home in Augusta, Georgia, after an NSA audit identified her as the person who printed and removed the report from a secure facility. The Intercept had turned over a copy of the report to the NSA to verify its provenance while asking for comment. After analysis of the document showed that it had been folded up, suggesting it had been printed, the NSA determined only six employees had access to the document, and only Winner had been in e-mail contact with The Intercept.

Seven e-mail accounts at the vendor company were targeted with a method similar to the one that obtained access to e-mail accounts used by members of the Clinton campaign earlier in 2016, according to the text of the report. At least one of those accounts appears to have been compromised, as information from the company was then used in two separate sets of e-mails with malicious attachments sent to election officials just days before the election.

Read 4 remaining paragraphs | Comments

 

Malware authors often encode their malicious payload, to avoid detection and make analysis more difficult.

I regurlarly see payloads encoded with the XOR function. Often, they will use a sequence of bytes as encoding key. For example, lets take Password as encoding key. Then the first byte of the payload is XORed with the first byte of the key (P), the second byte of the payload is XORed with the second byte of the key (a), and so on until all bytes of the key have been used. And then we start again with the first byte of the key: the ninth byte of the payload is XORed with the first byte of the key (P), ...

Let width:889px" />

So just by opening a XOR encoded PE file with a binary editor, we can see the repeating key, provided that the key is smaller than the sequences of 0x00 bytes.

Second interesting property of the XOR function: if you XOR the original file (cleartext) with the encoded file (ciphertext), you get the key (or to be more precise, the keystream).

Lets take another example. We know that in many PE files, you can find the string This program can not be run in DOS mode. width:882px" />

So if we have the encoded file, and the partially unencoded file, we can also recover the key, provided again that the key is smaller than the unencoded text, and that we know where to line-up the encoded and unencoded text.

In a next diary entry, I will show a tool to automate this analysis process.

Didier Stevens
Microsoft MVP Consumer Security
blog.DidierStevens.com DidierStevensLabs.com

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.
 
GnuTLS CVE-2017-6891 Stack Buffer Overflow Vulnerability
 
Multiple Puppet Products YAML Deserialization CVE-2017-2295 Remote Code Execution Vulnerability
 
RETIRED: Sendmail Remote Code Execution Vulnerability
 
Cisco Mobility Express Software CVE-2017-3834 Default Credentials Security Bypass Vulnerability
 
Linux Kernel CVE-2017-1000363 Integer Overflow Vulnerability
 
X41-2017-005 - Multiple Vulnerabilities in peplink balance routers
 
Wireshark 'epan/dissectors/packet-ipv6.c' Denial of Service Vulnerability
 
[SECURITY] [DSA 3873-1] perl security update
 
Internet Storm Center Infocon Status