• Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg
  • Delicious

Anti-Malware Laboratory

Yet Another Malware Blog

About

An informal blog from your friendly neighborhood software security humans.

Blog Archive

  • ►  2015 (5)
    • ►  October (1)
    • ►  August (2)
    • ►  May (1)
    • ►  March (1)
  • ▼  2014 (8)
    • ▼  October (1)
      • Upatre: .ENC File Extension
    • ►  July (1)
    • ►  June (1)
    • ►  May (4)
    • ►  April (1)
  • ►  2013 (12)
    • ►  December (3)
    • ►  November (5)
    • ►  August (2)
    • ►  March (2)
  • ►  2012 (35)
    • ►  April (4)
    • ►  March (12)
    • ►  February (17)
    • ►  January (2)

Categories

adobe (1) android (10) android february (1) baksmali (1) Black Hole (2) crimepack (1) disassembler (1) exploit (3) Exploits (4) Fakeav Winrar sfx (1) Fishbowl (1) flash (1) gift certificates (1) Google Authenticator (1) google play (1) hcp (1) java (1) Malware (5) mdac (1) Mobile (24) NSA Mobility Program (1) obfuscated script (1) pdf (1) Reversing (2) rhino (1) skype (1) smali (1) spam (1) test (1) Unpacking (1) vouchers (1) vulnerability (3)

Popular Posts

  • Bank of America spam: An Analysis
    An email claiming to be from Bank of America lures users to open an attachment that shows how to open secure emails from the bank. The mess...
  • [BE CAUTIOUS] Dragon Ball Z: Resurrection of F MALWARE and SCAM
    Be wary of downloading movies in torrent sites.  Executables can also be executed with a file size as huge as a gigabyte...
  • Unpacking MFC Compiled CryptoWall Malware
    Unpacking MFC Compiled CryptoWall Malware Introduction First and foremost, this article does not intend to analyze what CryptoWall malw...

Visitors to this blog

Thursday, October 23, 2014

Upatre: .ENC File Extension

Posted on Thursday, October 23, 2014 by bernadette | No comments
Cybercriminals uses different techniques to pass through different kinds of network intrusion defenses the users have in their system to avoid malwares. This time criminals have found a new way to deceive users and be able steal important information by encrypting the file and making it unexecutable with a file extension of either “.ENC” or “.EXE”. These files are known to be downloaded by Upatre malwares.

Upatre malwares sizes are ranging from 5KB-10KB only. This malware size is noticeably small compared to other malwares since its main role is to just download “.enc”  or “.exe” files, decompress it then executes it. In order to evade malware detection, downloaded files magic bytes are ZZP and without the downloader the downloaded files are completely un-executable.


Sample of downloaded file

The Downloader
cef76fa7b4b30f76c7b6d2eefa30d944

It will first check if the malware is running with its desired filename from %TEMP% folder. If not it will create a copy of itself with its desired filename then execute it using ShellExecuteW.

Check if the existing filename is budha.exe

Create and Execute budha.exe

It will connect to the following sites to download another malware which is the encrypted one (“.enc” or “.exe” files).
  • dcmsservices.com/images/stories/slides/pdf.enc
  • electriciansdublinireland.com/wp-content/uploads/2014/01/pdf.enc
  • freebiegalore.com/facelift/pdf.exe
  • freebiesvaults.info/freebies/nucleus/images/pdf.exe


This file is also the one responsible in decrypting and decompressing the downloaded file. In the above memory dump at offset 60, the first four bytes are the decryption keys using XOR operand. But before decrypting the downloaded files it will first check if the magic bytes of the downloaded file are ZZP\0. Decrypted files are in a compressed form and are needed to decompress using RTLDecompressBuffer


Magic Bytes checking

Decryption and Decompression routine


Copy of decrypted file

Note: ZZP/0 is not included in bytes to be decrypt.

If the above check fails, it will skip the decryption part and proceed on checking the MZ header. It will create a copy of decompressed or a valid win32 PE downloaded file in %TEMP% folder and then execute it.


MZ header checking and creating a copy of downloaded file

The Downloaded File

The downloaded file contains encrypted file in resource section.

Encrypted resource

Decrypted resource

It parses resource section through the FindResource, LoadResource and LockResource APIs instead of LoadBitmap so that it can copy its data to another application.

This malware is simply the loader of the encrypted Win32 file in Resource section. It uses process hollowing technique to load the said file but instead of loading legitimate process, it creates another process of the downloaded file in a suspended state.




Then the malware will unmap the original code from memory in the host process using ZwUnmapViewOfSection API, and use VirtualAllocEx to allocate memory for the new code.


The malware will write its new code into the hollow host process using WriteProcessMemory. The data to be written into the hollow host process is from resource section of the downloaded file (0x40555A). Then the malware will simply resume the suspended process using ResumeThread.



The hallowed process contains an encrypted chunk of code where in these codes are responsible for calling the functions in creating a copy of itself.


It will create a folder in %APPDATA% with a random folder name, first character is always in capital letters. This folder contains a copy of this malware also with a random filename.

Code snippet in generating random folder and malware name

Sample folder and malware name

Then this malware will execute the created copy of itself using CreateProcessW.


It will enumerate all of the running processes and check the SID length of each process. In this case if the SID length is 0x1c the malware will create thread that run into the virtual address space of this process through CreateRemoteThread.











Read More
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)
volute-glacial
volute-glacial
volute-glacial
volute-glacial
Copyright © Anti-Malware Laboratory | Powered by Blogger
Design by Fabthemes | Blogger Template by NewBloggerThemes.com