a worm in the apple

57
A Worm in the Apple Exploration of Mac malware Wes Widner @kai5263499 [email protected]

Upload: wes-widner

Post on 15-Apr-2017

34 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: A worm in the apple

A Worm in the AppleExploration of Mac malware

Wes Widner@[email protected]

Page 2: A worm in the apple

Introduction

Information security engineer by day, malware researcher by night

Also father of 4, so nights tend to be pretty short

Previous talks have been about malware pipelines in general

Page 3: A worm in the apple

Macs are secure, right?

Page 4: A worm in the apple

Before 2012

Page 5: A worm in the apple

After 2012

Page 6: A worm in the apple

Flashback

Actually it started in September 2011

Got its name by offering a Flash upgrade

Poor English and other errors gave it away

In February 2012 it changed tactics

Took advantage of an unpatched Java vulnerability

Apple still argues it was Sun’s fault

Claimed 600k (~1%) according to Dr Web

Generated revenue (~$14k) through click fraud

Contained advanced features that weren’t used

Self-encrypting

Page 7: A worm in the apple
Page 8: A worm in the apple
Page 9: A worm in the apple

Flashback part 2

~20k infections as recently as 2014

Tracked by Intego sinkhole

No big deal

In reality Apple spent the rest of the year cleaning up the mess

Apple suddenly found themselves playing catch up

Page 10: A worm in the apple

But that was a fluke, right?

Page 11: A worm in the apple

Apple and many experts still don’t recommend using protection

Infections are rare

Apple is taking care of it

Page 12: A worm in the apple

Perhaps some history will help

Page 13: A worm in the apple

Mac malware history1982 Prehistory: Elk Cloner

1987 nVIR

1988 HyperCard

1990 MDEF

1991 German folk tunes

1995 Word macro viruses

1996 Laroux – viruses for Excel

1996 AutoStart 9805 and Sevendust

2004 MW2004 / Renepo, aka Opener / Renepo and Amphimix

2005 Cowhand

Page 14: A worm in the apple

2006 Exploit.OSX.Safari, aka OSX.Exploit.Metadata / Leap, aka Oompa Loompa, the first virus for Mac OS X / Inqtana / OSX.Exploit.Launchd / Macarena

2007 RSPlug, aka DNSChanger, aka Jahlav, aka Puper / OpenOffice BadBunny and RSPlug financial malware

2008 MacSweeper, aka Immunizator / AsTHT, aka Hovdy, aka AplS.Saprilt / PokerStealer, aka Corpref / Lamzev, aka Malev / Scareware, backdoors and Jahlav

2009 iServices, aka iWorkServices, aka Krowi / Tored

2010 HellRTS, aka Pinhead, aka Hellraiser / OpinionSpy, aka Premier Opinion, aka Spynion / Koobface, aka Boonana

Page 15: A worm in the apple

2011 BlackHole RAT, aka MusMinim, aka DarkHole / MacDefender, aka MacSecurity, aka MacProtector, aka MacGuard, aka MacShield, aka Defma / QHost, also HostMod-A / Revir, aka Imuler, aka Muxler / Flashback, aka Flashfake / DevilRobber, aka Miner-D / FinFisher

2012 FileSteal, Hackback, KitM / Tibet, aka MacControl, aka MaControl, aka MacKontrol / Sabpab, aka Sabpub, aka Mdropper, aka Lamadai, aka Olyx / FkCodec/Codec-M / Maljava / GetShell, aka SET.gen, aka ShellCode, aka MetaData, aka TESrel / Crisis, aka Morcut, aka DaVinci / NetWeird, aka Wirenet / Jacksbot / Dockster / SMSSend

2013 Pintsized / CallMe / Minesteal / KitM / Janicab / ClickAgent / Leverage / Icefog

2014 LaoShu / CoinThief / XSLCmd / iWorm / Ventir / WireLurker, aka Machook / DMA “evil maid” attacks

Page 16: A worm in the apple

2015 Lamadai / Kitm / Hackback / LaoShu / Appetite, trojan targeting government organizations / Imuler / Coin Thief / Suspend-resume rootkit

2016 KeRanger, first ransomware / Mokes / Keydnap / USB attack

Page 17: A worm in the apple
Page 18: A worm in the apple
Page 19: A worm in the apple
Page 20: A worm in the apple
Page 21: A worm in the apple
Page 22: A worm in the apple
Page 23: A worm in the apple

Apple still actively fights with vendors

iOS is a heavily walled garden

OSX is becoming a walled garden

Page 24: A worm in the apple
Page 25: A worm in the apple
Page 26: A worm in the apple
Page 27: A worm in the apple
Page 28: A worm in the apple
Page 29: A worm in the apple
Page 30: A worm in the apple
Page 31: A worm in the apple
Page 32: A worm in the apple
Page 33: A worm in the apple

The Apple fights back

Page 34: A worm in the apple
Page 35: A worm in the apple
Page 36: A worm in the apple
Page 37: A worm in the apple

iDroid

Page 38: A worm in the apple
Page 39: A worm in the apple
Page 40: A worm in the apple

2009 XProtect / File Quarantine

2011 Sandboxing

2012 Gatekeeper

2015 System Integrity Protection

2016 XProtect + Yara

Page 41: A worm in the apple
Page 42: A worm in the apple

Firewall

OSX comes with one one but two firewalls

Application level firewall (alf)

Packet Filter (pf)

Page 43: A worm in the apple

Little Snitch

Page 44: A worm in the apple

Icefloor - open source GUI pf manager

Page 45: A worm in the apple

Software installation

Archives everywhere

Application bundles

DMG

What magic bytes?

FileVault encryption

PKGs

the self-executables of the OSX world

Natively compressed in xar format

Can specify sandbox rules

App Store

Signed and sandboxed

Page 46: A worm in the apple

Code signing

XNU

Hybrid

BSD

POSIX interface

Mandatory Access Control Framework

Mach

Microkernel developed at Carnegie MellonFor parallel computing

Released in 1985

Provides the basis for some interesting OSX rootkits

Huxley the Platapus

Page 47: A worm in the apple

MachO

Similar to ELF

Biggest difference is native code-signing support

Same magic bytes (0xCAFEBABE) as Java class files

IPC ports

Not network ports

Unix ports but in kernel land

Resource forks

Page 48: A worm in the apple
Page 49: A worm in the apple
Page 50: A worm in the apple

Little Flocker

Page 51: A worm in the apple

Boot - in the beginning

UEFI

FAT boot partition

Firmware passwords

Pystar and Rebel EFI

Copyrighted bootloader

Physical attacks

Firewire DMA

Evil USB

kext - Kernel extensions

dyld

Preloaded libraries in

Mac interposes its own malloc function

launchd

.plist

Page 52: A worm in the apple
Page 53: A worm in the apple
Page 54: A worm in the apple
Page 55: A worm in the apple
Page 56: A worm in the apple

Books worth getting

Page 57: A worm in the apple

Thanks for attending!

Mac malware feed: http://ow.ly/O1WM303qAkV

Mac infosec homebrew tap: http://ow.ly/c1LZ303pKwa

OSX Security Awesome: http://ow.ly/uWEj303pKuf

These slides: http://ow.ly/DpNQ305KfPd