beware of the ninjas - imf-conference.org · appleworm/lazarus • net user • ipconfig /all •...

31
08/05/18 1 Beware of the Ninjas Felix Leder <[email protected]> In a Nutshell Make the Internet a safer place Symantec Commercial Org High quality products Malware Analysis Systems Huuuuge lot of data Patents The Honeynet Project Non-Profit Org Open Source Cuckoo Sandbox (2010) Sharing what we can Public training Copyright © 2015 Symantec Corporation 2

Upload: buinhan

Post on 08-Nov-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

1

BewareoftheNinjas

FelixLeder<[email protected]>

InaNutshell–MaketheInternetasaferplace

•  Symantec

–  CommercialOrg

–  Highqualityproducts

–  MalwareAnalysisSystems

–  Huuuugelotofdata

–  Patents

•  TheHoneynetProject

–  Non-ProfitOrg

–  OpenSource

–  CuckooSandbox(2010)

–  Sharingwhatwecan

–  Publictraining

Copyright©2015SymantecCorporation

2

Page 2: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

2

Defender’sView

OldSchool-Prevention

IaskmyselfIFIwillgetbreached.

WhatcanIdotoPREVENTbreaches?

NewSchool-Detection

IaskmyselfWHENIwillgetbreached

WhatcanIdotoDETECTbreaches?

WhatwillIdoinsuchanevent?(DFIRaware)

Copyright©2015SymantecCorporation

3

Attacker’sView

OldSchool–MaliciousSoftware

Mission:Doeverythingtostayundetected

Tactics:

•  Obfuscation

•  Anti-securitytools

NewSchool-Ninja

Mission:Hideaslongaspossible

Tactics:

•  Hideinthenoise

•  Stayoutsidemonitoringdomains

•  Leaveminimaltraces

Copyright©2015SymantecCorporation

4

Softwaredoesnotbreachorganizations–Peopledo

Page 3: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

3

Sometry…

Copyright©2015SymantecCorporation

5

http://www.chinadaily.com.cn/china/2015-04/11/content_20411580.htm#Content

Somedoitbetter

Copyright©2015SymantecCorporation

6

https://www.pinterest.ie/pin/272467846179842314/

Page 4: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

4

Somearealmostimpossibletospot

Copyright©2015SymantecCorporation

7

https://www.pinterest.ie/pin/298996862741834388/

SecurityToolAwareness

Copyright©2015SymantecCorporation 8

Ninjasadjust

Page 5: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

5

Gozi:UserInteractiontotheNextLevel

•  PayloadencryptedwithRANDOMKEY

•  Nobodyknowsrandomkey(notevenmalwareitself)

•  Idea:Bruteforcekeybasedonmousemove

•  Eventuallyarealuserdecryptsthepayload

Copyright©2015SymantecCorporation

9

Decrypt(?)

EncryptedPayload

Key:5ýKey:1ýKey:6ýKey:9ýKey:7þ

AItothemax-GhostUser

Copyright©2015SymantecCorporation

10

Page 6: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

6

Leavenotrace

Duqu–2010-2011

Copyright©2015SymantecCorporation

12

Page 7: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

7

Example:Duqu2.0

•  Infection:–  Documents/spearphishing

–  Privilegeescalation

–  Pass-the-hash

•  NoPersistenceonhost

–  Taskscheduler

–  Remoteexecution

•  InMemoryonly(evadingforensics)

•  Three0-daysused

•  InternalC2forwarding

•  Traffichidinginpictures

•  Changingencryption

DomainController

Hide

Copyright©2015SymantecCorporation 14

Lookingattheninjainthehost

Page 8: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

8

LetWindowsdothedirtywork

•  IfWindows/Microsoftistrusted,letitdothedirtywork

Copyright©2015SymantecCorporation

15

Fetchhttp://evil.com/malw.exe

andthenEXECUTEit

OK!

BackgroundIntelligentTransferService/BITS

Copyright©2015SymantecCorporation

16

Page 9: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

9

Gowherethere’snomonitoring-WMI

• WindowsManagementInstrumentation

•  NosuspiciousAPIs;justaskWindows

Copyright©2015SymantecCorporation

17

Win32_NetworkAdapterConfiguration

Bluwimps-PersistencethroughWMI

Copyright©2015SymantecCorporation

18

Page 10: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

10

Poweliks-filelessintheregistry

•  FolderopenedinFileopendialog/explorer…

Copyright©2015SymantecCorporation

19

Livingofftheland–InformationGathering

•  Manyattackgroupsusecommonsystemtoolsduringtheirattacks

•  systeminfo

•  netview

•  netview/domain

•  tasklist/v

•  gpresult/z

•  arp-a

•  netshare

•  netuse

•  netuseradministrator

•  netuser/domain

•  netuseradministrator/domain

•  tasklist/fi

WATERBUG/TURLA

•  hostname

•  whoami

•  ver

•  ipconfig-all

•  pingwww.google.com

•  queryuser

•  netuser

•  netview

•  netview/domain

•  tasklist/svc

•  netstat-ano|find\TCP\

•  msdtc[IP][port]

APPLEWORM/LAZARUS

•  netuser

•  ipconfig/all

•  netstart

•  systeminfo

•  gpresult

BILLBUG

Page 11: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

11

Dual-UseTools:Petya

Petyausesdual-usetools

•  ThreatisDLLexecutedbyrundll32.exe

•  UsesrecompiledversionofLSADumpMimikatztogetpasswords

•  UsesPsExectopropagate

–  \\[server_name]\admin$\perfc.dat

–  psexecrundll32.exec:\windows\perfc.dat#1<rand>

•  UsesWMItopropagateifPsExecfails

–  wmic.exe/node:[IPAddress]/user:[USERNAME]/password:[PASSWORD]processcallcreate“%System%\rundll32.exe\“%Windows%\perfc.dat\"#160”

•  ScheduledtasktorestartintothemaliciousMBRpayload

–  schtasks/RU"SYSTEM"/Create/SConce/TN""/TR“%system%\shutdown14:42.exe/r/f"/ST

•  Deleteslogfilestohidetraces

–  wevtutilclSetup&wevtutilclSystem&…&fsutilusndeletejournal/D%C:

Page 12: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

12

NotjustWindows

Copyright©2015SymantecCorporation

23

•  HiddenLotusonOSXusingshellcommands

Clean Malicious

ForensicsandIncidentManagement

•  BackgroundIntelligenceTransferService

•  WindowsManagementInstrumentation

•  Dualusetools

è Notnecessarilyfilesondisk

è (alotof)Activitiesstarted

è Knowyourenvironmentàspotanomalies

•  Powershellonsecretariescomputer?

•  WindowsdownloadingupdatesfromRussia,China,orSweden?

•  HRdepartmentinvokingnet view /domaincommands

Copyright©2015SymantecCorporation

24

Page 13: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

13

HidebehindtheClouds

Copyright©2015SymantecCorporation 25

ShortHistoryofMalwareC2

Copyright©2015SymantecCorporation

Page 14: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

14

TwitterBotnetasexample

•  Prevention:BlockTwitter?

•  IncidentResponse:RetrospectiveTwittertrafficanalysis?

–  Signal2noiseratiolow

–  TLS–blindspots?

•  Endpointmonitoring?

•  Encryptedtrafficmgmt.?

•  NSSKeyLogFile?

Copyright©2015SymantecCorporation

27

InceptionFramework

•  Targetedattack(mostlyRussiantargets)

•  Exfiltrateto Cloudprovider

Copyright©2015SymantecCorporation

28

Page 15: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

15

FakeUpdatescampaigns

•  Useofglobalcloudservices

Copyright©2015SymantecCorporation

29

Canyouruleoutthecloud?

Copyright©2015SymantecCorporation

30

HTTPS/TLS

Page 16: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

16

Directcloudtransfers

Findthebreach

•  Whatwentwhereandwhen?

•  Whatwassharedwithwhom?

•  Whattypeoffilesweretransferred?(docsw/act.content,exe,…)

•  Whatwasmodifiedbywhom?

•  Tracedeletedfiles?

•  Scale:1000usersw/1000fileoperationsperday

Copyright©2015SymantecCorporation

31

Cloudforensics

Copyright©2015SymantecCorporation

32

Page 17: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

17

ReadyforCloudIR?

•  Canyoulookintoencryptedtraffic?(post-breach)

•  OverviewoveractivitiesinyourCloudservices?(spotbreaches)

– Whatactionswouldbesuspicious?

–  Differentusergroups/differentbehaviors?

•  ProceduresforIR?(post-breach)

Copyright©2015SymantecCorporation

33

RunningyourownCloudservice

Copyright©2015SymantecCorporation 34

Page 18: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

18

Copyright©2015SymantecCorporation

35

DoNOTask:“IfIwillgetbreached?”

Copyright©2015SymantecCorporation

36

Page 19: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

19

DoNOTask:“IfIwillgetbreached?”

Copyright©2015SymantecCorporation

37

and

CloudPets

•  SendmessagestoPet

•  Petcanrecordmessagesandsendback

•  MongoDBwithallaccountspubliclyaccessibleonInternet

–  Useraccounts

–  Messages

Copyright©2015SymantecCorporation

38

https://www.troyhunt.com/data-from-connected-cloudpets-teddy-bears-leaked-and-ransomed-exposing-kids-voice-messages/

Page 20: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

20

CloudPets

•  SendmessagestoPet

•  Petcanrecordmessagesandsendback

•  MongoDBwithallaccountspubliclyaccessibleonInternet

–  Useraccounts

–  Messages

Copyright©2015SymantecCorporation

39

https://www.troyhunt.com/data-from-connected-cloudpets-teddy-bears-leaked-and-ransomed-exposing-kids-voice-messages/

BecomingmoreIntimate

Copyright©2015SymantecCorporation

40

Page 21: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

21

BecomingmoreIntimate

Copyright©2015SymantecCorporation

41

Andmoreintimate…

Copyright©2015SymantecCorporation

42

Page 22: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

22

Andmoreintimate…

Copyright©2015SymantecCorporation

43

Ithappenseveryday…

Copyright©2015SymantecCorporation

44

https://cloudpets-prod.s3.am

azonaw

s.com/9...51.wav

Page 23: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

23

Incidentprocess

Copyright©2015SymantecCorporation

45

Onprem

Clouduse

Cloudserviceoperation

Onpremise

Clouduse

CloudOp

AvailabilityoftoolsComplexity

Clearboundariesèshortendiscovery

Define“Normality”

•  Yes,policiesareapain

• Whatisnormal?Whatisknowtobeoutsidethenorm?

Learn“Normality”

•  Everycloudappisdifferent

•  Standardbehaviorcanbelearned

Copyright©2015SymantecCorporation

46

Page 24: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

24

Example:VirtualPrivateCloud

Copyright©2015SymantecCorporation

47

VPC

Example:Containers

Copyright©2015SymantecCorporation

48

https://wallhere.com/en/wallpaper/600531

Page 25: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

25

Example:Container&Microservices

Copyright©2015SymantecCorporation

49

Orca

Gray

Humpback

Blue

Shark

Fin

Minke

Example:Microserviceworkflows

Copyright©2015SymantecCorporation

50

Orca

Gray

Humpback

Blue

Shark

Fin

Minke

Page 26: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

26

SecureVMintheCloud(likeon-premise)

Copyright©2015SymantecCorporation

51

HostIDS Whitelist EDR

Themoreyouknow,thefasteryoureact

Copyright©2015SymantecCorporation

52

Page 27: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

27

AntiForensics

Copyright©2015SymantecCorporation 53

Smokeloadera.k.a.Dofoil

•  ExtendableTrojanKit

•  Ring3-rootkit(32-bit)

–  Hideprocesses

–  Hideregistry

–  Hidefiles

•  Killsecuritytools

•  Injectintoexplorer.exe

Copyright©2015SymantecCorporation

54

Process

BenignCode

Data

MaliciousCode

Page 28: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

28

NotjustWindows

Copyright©2015SymantecCorporation

55

•  HiddenLotusonOSXwithanti-forensics

Clean Malicious

Getyourfactsstraight

J

Page 29: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

29

http://westernriverimages.photoshelter.com/image/I0000.gezYGWvQX4

CyberwarIranianattackonBowmandam,2013

http://www.wsj.com/articles/iranian-hackers-infiltrated-new-york-dam-in-2013-1450662559

http://westernriverimages.photoshelter.com/image/I0000.gezYGWvQX4

CyberwarIranianattackonBowmandam,2013

http://www.wsj.com/articles/iranian-hackers-infiltrated-new-york-dam-in-2013-1450662559

Page 30: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

30

Summary

Copyright©2015SymantecCorporation 59

Summary

•  Attackerswillalwaysadjust–Ninjashideinthenoise

•  Attackerswillalwaysusesystemsinunusualways

•  Log&recordthehe**outofyoursystems

–  Systemlogs(remote)

–  EDR

–  Networklogs(thinkencryptedtraffic)

•  Define/learnwhatis“normal”

–  Users

–  Systems

–  Architecture

•  BethefirsttonoticeàSetupalerting

Copyright©2015SymantecCorporation

60

Page 31: Beware of the Ninjas - imf-conference.org · APPLEWORM/LAZARUS • net user • ipconfig /all • net start • systeminfo • gpresult BILLBUG 08/05/18 11 Dual-Use Tools: Petya Petya

08/05/18

31

Thankyou!

Copyright©2015SymantecCorporation.Allrightsreserved.SymantecandtheSymantecLogoaretrademarksorregisteredtrademarksofSymantecCorporationoritsaffiliatesintheU.S.andothercountries.Othernamesmaybetrademarksoftheirrespectiveowners.

Thisdocumentisprovidedforinformationalpurposesonlyandisnotintendedasadvertising.Allwarrantiesrelatingtotheinformationinthisdocument,eitherexpressorimplied,aredisclaimedtothemaximumextentallowedbylaw.Theinformationinthisdocumentissubjecttochangewithoutnotice.

[email protected]