nico yturriaga september 27, 2014. why necurs? infected 80,000+ during december 2012 tagged as...

41
Nico Yturriaga September 27, 2014

Upload: arleen-pierce

Post on 13-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Nico Yturriaga

September 27, 2014

Page 2: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Why Necurs? Infected 80,000+ during December 2012

Tagged as “Rootkit for Hire”

In the wild

Page 3: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

What is a Rootkit?

Stealthy type of software

Activated at boot up

Removal can be complicated or practically impossible

Page 4: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Necurs is...

Obfuscated / Encrypted

Protective to itself and components

Able to Prevent AV Installation

Page 5: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Basic Flow

Malicious URL / Spam

Dropper Downloads

Necurs

Necurs Protects its Registry, Files

and Processes

Dropper Downloads

Zeus

Necurs Adds Zeus to its Protection

Page 6: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The Components

The Dropper (Executable .exe)Infection Symptoms, The Executable,

Rootkit Installation

The Rootkit (Driver .sys)The Driver, Access Denial, AV and

Application Blocking

Page 7: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Infected by Necurs?The Dropper

Windows Platform (32 bit / 64 bit)

Query ‘Syshost32’ Service.

Page 8: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Query ‘Syshost32’ Service

The Dropper - Symptoms

Page 9: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Infected by Necurs?The Dropper

Windows Platform (32 bit / 64 bit)

Query ‘Syshost32’ Service.

‘Syshost.exe’ in Device Manager

Page 10: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

‘Syshost.exe’ in Device Manager

The Dropper - Symptoms

The Dropper Executable

Page 11: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Infected by Necurs?The Dropper

Windows Platform (32 bit / 64 bit)

Query ‘Syshost32’ Service.

‘Syshost.exe’ in Device Manager

Parse “HKLM\ System\

CurrentControlSet\ Services”

Page 12: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Parse “HKLM\System\CurrentControlSet\ Services”

The Dropper - Symptoms

Page 13: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Infected by Necurs?The Dropper

Windows Platform (32 bit / 64 bit)

Query ‘Syshost32’ Service.

‘Syshost.exe’ in Device Manager

Parse “HKLM\ System\

CurrentControlSet\ Services”

Verify Driver File Access Denial

Page 14: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Verify Driver File Access

Denial

The Dropper - Symptoms

16 characters length of driver file name [a-f, 0-9]

Page 15: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Infected by Necurs?The Dropper

Windows Platform (32 bit / 64 bit)

Query ‘Syshost32’ Service.

‘Syshost.exe’ in Device Manager

Parse “HKLM\ System\

CurrentControlSet\ Services”

Verify Driver File Access Denial

Page 16: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The ExecutableThe Dropper

Sample was obtained June 2014.

MD5 : 917406e5d63a4538e7a4e28f5dd13bef

Obfuscated and will eventually decrypt a new

file : 39db776b96383b491362d7f003a1ffd0

Page 17: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Rootkit InstallationThe Dropper

Decrypted Executable Administrator?

Exploit vulnerability

CVE-2010-4398

NO

Page 18: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Privilege EscalationThe Dropper

Vulnerability listed as CVE-2010-4398

allows local users to gain admin

privileges

bypass the User Account Control

(UAC)

Page 19: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Rootkit InstallationThe Dropper

Decrypted Executable Administrator?

Exploit vulnerability

CVE-2010-4398

NO

Download Rootkit

Page 20: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Rootkit DownloadThe Dropper

Manipulate Windows Firewall by

netsh.exe

Decrypt a List of IP addresses

Page 21: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Rootkit InstallationThe Dropper

Decrypted Executable Administrator?

Exploit vulnerability

CVE-2010-4398

NO

Download Rootkit

Install RootkitKERNEL MODE

Page 22: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Rootkit InstallationThe Dropper

Create System file

Page 23: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Rootkit InstallationThe Dropper

Load Rootkit as a Service

Page 24: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The Driver

The Rootkit

MD5 : eaa43802c3801389911b6ad35c0ee71

Sample was Downloaded June 2014

Obfuscated and will eventually decrypt a new file : 787328fa36df1ce151eebf44fe07c0a6

16 characters file name [0-9, a-f] “.sys” extension

Page 25: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The Driver

The Rootkit

Registry Entry at “\REGISTRY\MACHINE\ SYSTEM\CurrentControlSet\Services”

Load Boot Device Drivers

Page 26: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The Driver

The Rootkit

Registry Entry at “\REGISTRY\MACHINE\ SYSTEM\CurrentControlSet\Services”

Load Boot Device Drivers

SERVICE_BOOT_START

Page 27: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The Driver

The Rootkit

“\REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder”

Load Boot Device Drivers

ServiceGroupOrder List

Page 28: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

The Driver

The Rootkit

Registry Entry at “\REGISTRY\MACHINE\ SYSTEM\CurrentControlSet\Services”

Able to load in Safe Mode

Load before other Drivers

Load Boot Device Drivers

ServiceGroupOrder List

Check Tag Number

Page 29: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Driver – Dropper Communication

The Rootkit

Create device object "NtSecureSys" and a Symbolic link "\??\NtSecureSys"o 0x22000C – Request Rootkit File Patho 0x220010 – Request Rootkit Registry Patho 0x220018 – Update the rootkit driver file by a

supplied buffero 0x22001C – Uninstall the Rootkito 0x22002C – terminate a process using a

supplied process name

Page 30: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Access Denial

The Rootkit

Registry - CmRegisterCallback API

Page 31: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Access Denial

The Rootkit

Registry CallBack FlowAccess

Registry

Rootkit Thread?

Set / Del Rootkit Key?

Deny Access

Grant Access

YES YES

YES Services.exe / Rootkit?

YES

NONO

Open Rootkit

Key?

Page 32: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Access Denial

The Rootkit

File Access - Filesystem

Page 33: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Access DenialThe Rootkit

FileSystem Filter Flow

Deny Access

Grant Access

File Access

Filter File Access Type

Remove from File Objects

Close File Access?

Component?

Write / Set File Access?

Check Database

Rootkit / Registered?

Open / Other File Access?

NO

NO

YES

YES

YES

YES

YES

Page 34: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Access Denial

The Rootkit

Process / Thread API ObRegisterCallbacks NtOpenProcess, NtOpenThread [SSDT]

Page 35: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Access DenialThe Rootkit

Process / Thread Call Back

NO

NOYES

YES

Open Process / Thread

Thread?

Get Thread Owner Process

Target Rootkit

Process?

Own Process?

Svchost / Lsass?

Proceed Normally

DisAllow Operation

Limit Operations

YES

NO

NO

YES

Page 36: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Application Blocking

The Rootkit

Black and White Listing Capabilities Values at “\REGISTRY\MACHINE\SYSTEM\

CurrentControlSet\Services”

Parse Registry Values “ImagePath”

Parse PE files at System32 and

System32\Drivers

Version Info and File Name?

Compute MD5 Hash

Store at DB1 / DB6

Store at DB2 / DB5

Not Blacklisted / To White list

Continue Parsing

BlacklistedCompute File Name FMV –

1 Hash

Page 37: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Application Blocking

The Rootkit

API PsSetLoadImageNotifyRoutine

Application Loaded in Memory

Black / White?

Modify Entry Code of Application in Memory

END

Black

Page 38: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Application Blocking

The Rootkit

Page 39: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

GameOver Zeus

Resurrected as of July 2014

Used to install CryptoLocker ransomware.

Blamed for more than $100 million theft from banks, businesses and consumers worldwide.

Page 40: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

Removal Tips

Use a Boot CD e.g. [Hiren’s]

Demonstration

Page 41: Nico Yturriaga September 27, 2014. Why Necurs?  Infected 80,000+ during December 2012  Tagged as “Rootkit for Hire”  In the wild

References

http://stopmalvertising.com/rootkits/analysis-of-zeus-gameover-with-necurs.html

http://www.f-secure.com/weblog/archives/00002717.html

http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-4398

http://www.infosecurity-magazine.com/view/29806/necurs-rootkit-not-new-but-spreading-fast-warns-microsoft

krebsonsecurity.com/tag/gameover-zeus/MSDNPeter Ferrie http://pferrie.host22.com/papers/