Splunk Enterprise for InfoSec Hands-On

58
Copyright © 2016 Splunk Inc. Splunk Enterprise for Information Security Hands-On Long Beach | December 1, 2016 Presenters: Beau Morgan & Mark Bonsack

Transcript of Splunk Enterprise for InfoSec Hands-On

Page 1: Splunk Enterprise for InfoSec Hands-On

Copyright©2016SplunkInc.

SplunkEnterpriseforInformationSecurity

Hands-OnLongBeach|December1,2016

Presenters:BeauMorgan&MarkBonsack

Page 2: Splunk Enterprise for InfoSec Hands-On

2

SafeHarborStatementDuringthecourseofthispresentation,wemaymakeforward-lookingstatementsregardingfutureeventsortheexpectedperformanceofthecompany.Wecautionyouthatsuchstatementsreflectourcurrentexpectations and estimates basedonfactorscurrentlyknowntousandthatactualeventsorresultscoulddiffermaterially.Forimportantfactorsthatmaycauseactualresultstodifferfromthosecontainedinourforward-lookingstatements,pleasereviewourfilings withtheSEC. Theforward-lookingstatementsmadeinthispresentationarebeingmadeasofthetimeanddateofitslivepresentation. If reviewedafter itslivepresentation, thispresentationmaynotcontaincurrentoraccurateinformation. Wedonotassumeanyobligationtoupdateanyforward-lookingstatementswe may make. Inaddition,anyinformationaboutour roadmapoutlinesourgeneralproductdirectionandissubjecttochangeatanytimewithoutnotice. It isforinformationalpurposesonlyandshallnot beincorporatedintoanycontractorothercommitment. Splunkundertakesnoobligationeithertodevelopthefeaturesorfunctionalitydescribed ortoincludeanysuchfeatureorfunctionalityinafuturerelease.

Page 3: Splunk Enterprise for InfoSec Hands-On

3

A-B – 01C-D– 02E-F– 03G-H– 04I-K– 05

L-M– 06N-P– 07Q-S– 08T-V– 09W-Z– 10

https://od-sl-longbeach-sec-XX.splunkoxygen.comUsername:splunklive Password:security

Hands-On:What’sYourFirstInitial?

Page 4: Splunk Enterprise for InfoSec Hands-On

4

Agenda

Intro

WebAttacks

LateralMovement

DNSExfiltration

Wrap-up/Q&A

Page 5: Splunk Enterprise for InfoSec Hands-On

Copyright©2016SplunkInc.

Intro

Page 6: Splunk Enterprise for InfoSec Hands-On

Machinedatacontainsadefinitiverecordofallinteractions

Splunkisaveryeffectiveplatformtocollect,store,andanalyzeallofthatdata

Human Machine

Machine Machine

Page 7: Splunk Enterprise for InfoSec Hands-On

SplunkSolutions>EasytoAdoptAcrossDataSources,UseCases&ConsumptionModels

PlatformforOperationalIntelligence

RichEcosystemofApps&Add-Ons

SplunkPremiumSolutions

MainframeData

RelationalDatabasesMobileForwarders Syslog/TCP IoT

DevicesNetworkWireData Hadoop

Page 8: Splunk Enterprise for InfoSec Hands-On

SplunkPositionedasa LeaderinGartner2016MagicQuadrantforSecurityInformationandEventManagement*

*Gartner,Inc.,2016MagicQuadrantforSecurityInformationandEventManagement,andCriticalCapabilitiesforSecurityInformationandEventManagement,OliverRochford,KellyM.Kavanagh,TobyBussa.10August2016ThisgraphicwaspublishedbyGartner,Inc.aspartofalargerresearchdocumentandshouldbeevaluatedinthecontextoftheentiredocument.TheGartnerdocumentisavailableuponrequestfromSplunk.Gartnerdoesnotendorseanyvendor,productorservicedepictedinitsresearchpublications,anddoesnotadvisetechnologyuserstoselectonlythosevendorswith thehighestratingsorotherdesignation.GartnerresearchpublicationsconsistoftheopinionsofGartner'sresearchorganizationandshouldnotbeconstruedasstatementsoffact.Gartnerdisclaimsallwarranties,expressedorimplied, withrespecttothisresearch,includinganywarrantiesofmerchantabilityorfitnessforaparticularpurpose.

Ø Fouryearsinarowasaleader

Ø FurthestoverallinCompletenessofVision

Ø Splunkalsoscoreshighestin2016CriticalCapabilitiesforSIEMreportinallthreeusecases

Page 9: Splunk Enterprise for InfoSec Hands-On

9

GartnerCriticalCapabilitiesforSIEM

9

*Gartner,Inc.,2016MagicQuadrantforSecurityInformationandEventManagement,andCriticalCapabilitiesforSecurityInformationandEventManagement,OliverRochford,KellyM.Kavanagh,TobyBussa.10August2016ThisgraphicwaspublishedbyGartner,Inc.aspartofalargerresearchdocumentandshouldbeevaluatedinthecontextoftheentiredocument.TheGartnerdocumentisavailableuponrequestfromSplunk.Gartnerdoesnotendorseanyvendor,productorservicedepictedinitsresearchpublications,anddoesnotadvisetechnologyuserstoselectonlythosevendorswith thehighestratingsorotherdesignation.GartnerresearchpublicationsconsistoftheopinionsofGartner'sresearchorganizationandshouldnotbeconstruedasstatementsoffact.Gartnerdisclaimsallwarranties,expressedorimplied, withrespecttothisresearch,includinganywarrantiesofmerchantabilityorfitnessforaparticularpurpose.

1.BasicSecurityMonitoring 2.AdvancedThreatDetection 3.Forensics&IncidentResponse

Page 10: Splunk Enterprise for InfoSec Hands-On

Copyright©2016SplunkInc.

WebAttacks

Page 11: Splunk Enterprise for InfoSec Hands-On

11

OWASP2013Top10[10]Unvalidated redirectsandforwards[9]Usingcomponentswithknownvulnerabilities[8]Cross-siterequestforgery[7]Missingfunctionlevelaccesscontrol[6]Sensitivedataexposure[5]Securitymisconfiguration[4]Insecuredirectobjectreference[3]Cross-sitescripting(XSS)[2]Brokenauthenticationandsessionmanagement

Page 12: Splunk Enterprise for InfoSec Hands-On

12

[1]InjectionSQLinjectionCodeinjectionOScommandingLDAPinjectionXMLinjectionXPath injectionSSIinjectionIMAP/SMTPinjectionBufferoverflow

WhydidIgetbreached?

SQLi hasbeenaroundavery,verylongtime…

Page 13: Splunk Enterprise for InfoSec Hands-On

13

Source:ImpervaWebAttacksReport,2015

Page 14: Splunk Enterprise for InfoSec Hands-On

14

TalkTalk:PII/financialdatafor4McustomersVTech:PIIfor5Madults+kids

Page 15: Splunk Enterprise for InfoSec Hands-On

15

…andsofarthisyear…45

Page 16: Splunk Enterprise for InfoSec Hands-On

16

LittleBobbyTables

Page 17: Splunk Enterprise for InfoSec Hands-On

17

WhyDidBobby’sSchoolLoseTheirRecords?

$sql = "INSERT INTO Students (Name) VALUES ('" . $studentName . "');";

execute_sql($sql);

$studentName

1

2

Page 18: Splunk Enterprise for InfoSec Hands-On

18

INSERT INTO Students (Name) VALUES ('John');

WhyDidBobby’sSchoolLoseTheirRecords?

John

$studentName

Page 19: Splunk Enterprise for InfoSec Hands-On

19

WhyDidBobby’sSchoolLoseTheirRecords?

Robert'); DROP TABLE Students;--

INSERT INTO Students (Name) VALUES ('Robert'); DROP TABLE Students;--');

Page 20: Splunk Enterprise for InfoSec Hands-On

20

SpeedCameraTicketAvoidance

Page 21: Splunk Enterprise for InfoSec Hands-On

Let’sgethands-on!

Page 22: Splunk Enterprise for InfoSec Hands-On

22

A-B – 01C-D– 02E-F– 03G-H– 04I-K– 05

L-M– 06N-P– 07Q-S– 08T-V– 09W-Z– 10

https://od-sl-longbeach-sec-XX.splunkoxygen.comUsername:splunklive Password:security

Hands-On:What’sYourFirstInitial?

Page 23: Splunk Enterprise for InfoSec Hands-On

23

ALittleAboutOurEnvironmentOurlearningenvironmentconsistsof ~5.5Mevents,fromrealenvironments,butsanitized:

• WindowsSecurityevents• Apachewebaccesslogs• BroDNS&HTTP• PaloAltotrafficlogs• Someothervariousbits

Page 24: Splunk Enterprise for InfoSec Hands-On

24

OR

AreYouaNewbieorNinja?

Page 25: Splunk Enterprise for InfoSec Hands-On

Let’sgethands-on!

WebAttacks

Page 26: Splunk Enterprise for InfoSec Hands-On

26

https://splunkbase.splunk.com/app/1528/

SearchforpossibleSQLinjectioninyourevents:ü looksforpatternsinURIqueryfieldtoseeif

anyonehasinjectedthemwithSQLstatements

ü usestandarddeviationsthatare2.5timesgreaterthantheaveragelengthofyourURIqueryfield

Macrosused• sqlinjection_pattern(sourcetype,uri queryfield)• sqlinjection_stats(sourcetype,uri queryfield)

Page 27: Splunk Enterprise for InfoSec Hands-On

27

`sqlinjection_rex`isasearchmacro.Itcontains:

(?<injection>(?i)select.*?from|union.*?select|\'$|delete.*?from|update.*?set|alter.*?table|([\%27|\'](%20)*=(%20)*[\%27|\'])|\w*[%27|\']or)

Whichmeans:Inthestringwearegiven,lookforANY ofthefollowingmatchesandputthatintothe“injection”field.AnythingcontainingSELECTfollowedbyFROMAnythingcontainingUNIONfollowedbySELECTAnythingwitha‘attheendAnythingcontainingDELETEfollowedbyFROMAnythingcontainingUPDATEfollowedbySETAnythingcontainingALTERfollowedbyTABLEA%27ORa‘andthena%20andanyamountofcharactersthena%20andthena%27ORa‘

Note:%27isencoded“’”and%20isencoded<space>Anyamountofwordcharactersfollowedbya%27ORa‘andthen“or”

RegularExpressionsFTW

Page 28: Splunk Enterprise for InfoSec Hands-On

28

Bonus:TryouttheSQLInjectionSearch app!

Page 29: Splunk Enterprise for InfoSec Hands-On

29

Summary:WebAttacks/SQLInjectionSQLinjectionprovideattackerswitheasyaccesstodataDetectingadvancedSQLinjectionishard– useanapp!UnderstandwhereSQLi ishappeningonyournetworkandputastoptoitAugmentyourWAFwithenterprise-wideSplunksearches

Page 30: Splunk Enterprise for InfoSec Hands-On

Copyright©2016SplunkInc.

LateralMovement

Page 31: Splunk Enterprise for InfoSec Hands-On

31

PokingAround

Anattackerhacksanon-privilegedusersystem.

Sowhat?

Page 32: Splunk Enterprise for InfoSec Hands-On

32

LateralMovement

LateralMovementistheexpansionofsystemscontrolled,anddataaccessed.

Page 33: Splunk Enterprise for InfoSec Hands-On

33

MostFamousLateralMovementAttack?(excludingpasswordre-use)

PasstheHash!

Page 34: Splunk Enterprise for InfoSec Hands-On

34

ThisandothertechniquesusedindestructiveSands breach…

…andatSony,too.

Page 35: Splunk Enterprise for InfoSec Hands-On

35

DetectingLegacyPtHLookforWindowsEvents:EventID:4624or4625Logontype:3Auth package:NTLMUseraccountisnotadomainlogon,orAnonymousLogon

…thisistriviallyeasyinSplunk

Page 36: Splunk Enterprise for InfoSec Hands-On

Let’sgethands-on!

LateralMovement:Legacy

Page 37: Splunk Enterprise for InfoSec Hands-On

37

ThenItGotHarderPasstheHashtoolshaveimprovedTrackingofjitter,othermetricsSolet’sdetectlateralmovementdifferently

Page 38: Splunk Enterprise for InfoSec Hands-On

38

NetworkTrafficProvidesSourceofTruthIusuallytalkto10hostsThenonedayItalkto10,000hostsALARM!

Page 39: Splunk Enterprise for InfoSec Hands-On

Let’sgethands-on!

LateralMovement:NetworkTraffic

Page 40: Splunk Enterprise for InfoSec Hands-On

40

iz sohard…uhazmagic?

Page 41: Splunk Enterprise for InfoSec Hands-On

41

izsohard…uhazmagic?Comesee…

atthedemobooths

UBA

Page 42: Splunk Enterprise for InfoSec Hands-On

42

Summary:LateralMovementAttackersuccessdefinesscopeofabreachHighdifficulty,highimportanceWorthdoinginSplunkEasywithUBA

Page 43: Splunk Enterprise for InfoSec Hands-On

Copyright©2016SplunkInc.

DNSExfiltration

Page 44: Splunk Enterprise for InfoSec Hands-On

44

domain=corp;user=dave;password=12345

encrypt

DNSQuery:ZG9tYWluPWNvcnA7dXNlcj1kYXZlO3Bhc3N3b3JkPTEyMzQ1DQoNCg==.attack.com

ZG9tYWluPWNvcnA7dXNlcj1kYXZlO3Bhc3N3b3JkPTEyMzQ1DQoNCg==

Page 45: Splunk Enterprise for InfoSec Hands-On

45

DNSexfil tendstobeoverlookedwithinanoceanofDNSdata.

Let’sfixthat!

DNSExfiltration

Page 46: Splunk Enterprise for InfoSec Hands-On

46

FrameworkPOS:acard-stealingprogramthatexfiltrates datafromthetarget’snetworkbytransmittingitasdomainnamesystem(DNS)traffic

Butthebigdifferenceisthewayhowstolendataisexfiltrated:themalwareusedDNSrequests!https://blog.gdatasoftware.com/2014/10/23942-new-frameworkpos-

variant-exfiltrates-data-via-dns-requests

“”

…feworganizationsactuallykeepdetailedlogsorrecordsof theDNStraffictraversingtheirnetworks—makingitanidealwaytosiphondatafromahackednetwork.

http://krebsonsecurity.com/2015/05/deconstructing-the-2014-sally-beauty-breach/#more-30872

“”

DNSExfiltration

Page 47: Splunk Enterprise for InfoSec Hands-On

47

https://splunkbase.splunk.com/app/2734/

DNSexfil detection– tricksofthetradeü parseURLs&complicatedTLDs(TopLevelDomain)ü calculateShannonEntropy

Listofprovidedlookups• ut_parse_simple(url)• ut_parse(url,list)orut_parse_extended(url,list)• ut_shannon(word)• ut_countset(word,set)• ut_suites(word,sets)• ut_meaning(word)• ut_bayesian(word)• ut_levenshtein(word1,word2)

Page 48: Splunk Enterprise for InfoSec Hands-On

48

Examples• Thedomainaaaaa.com hasaShannonEntropyscoreof1.8 (verylow)• Thedomaingoogle.com hasaShannonEntropyscoreof2.6 (ratherlow)• A00wlkj—(-a.aslkn-C.a.2.sk.esasdfasf1111)-890209uC.4.com hasaShannon

Entropyscoreof3 (ratherhigh)

Layman’sdefinition:ascorereflectingtherandomness ormeasureofuncertainty ofastring

ShannonEntropy

Page 49: Splunk Enterprise for InfoSec Hands-On

49

DetectingDataExfiltration

index=brosourcetype=bro_dns|`ut_parse(query)`|`ut_shannon(ut_subdomain)`|eval sublen =length(ut_subdomain)|tableut_domain ut_subdomainut_shannon sublen

TIPSq LeverageourBroDNSdataq CalculateShannonEntropyscoresq Calculatesubdomainlengthq DisplayDetails

Page 50: Splunk Enterprise for InfoSec Hands-On

Let’sgethands-on!

LateralMovement:DNSExfiltration

Page 51: Splunk Enterprise for InfoSec Hands-On

51

DetectingDataExfiltration

…|statscountavg(ut_shannon)asavg_shaavg(sublen)asavg_sublenstdev(sublen)asstdev_sublenbyut_domain|searchavg_sha>3avg_sublen>20stdev_sublen<2

TIPSq LeverageourBroDNSdataq CalculateShannonEntropyscoresq Calculatesubdomainlengthq Displaycount,scores,lengths,

deviations

Page 52: Splunk Enterprise for InfoSec Hands-On

52

DetectingDataExfiltrationRESULTS• Exfiltrating datarequiresmanyDNSrequests– lookforhighcounts• DNSexfiltrationtomooo.com and chickenkiller.com

Page 53: Splunk Enterprise for InfoSec Hands-On

53

Summary:DNSExfiltrationExfiltrationbyDNSandICMPisaverycommontechniqueManyorganizationsdonotanalyzeDNSactivity– donotbelikethem!NoDNSlogs?NoSplunk Stream?LookatFWbytecounts

Page 54: Splunk Enterprise for InfoSec Hands-On

Copyright©2016SplunkInc.

Wrap-up/Q&A

Page 55: Splunk Enterprise for InfoSec Hands-On

55

SummaryMultiplephasestomodernattacksDeploydetectionacrossallphasesAlsoconsideradaptiveresponse!Stayabreastofmodernadvancements

Today’scontent(PDF):

https://splunk.box.com/v/SplunkLive-Security-Handout

Page 56: Splunk Enterprise for InfoSec Hands-On

56

AnalyticsDrivenSecurityhttps://www.splunk.com/en_us/solutions/solution-areas/security-and-fraud/security-investigation.html

Page 57: Splunk Enterprise for InfoSec Hands-On

• 5,000+ITandBusinessProfessionals• 175+Sessions• 80+CustomerSpeakers

PLUSSplunk University• Threedays:Sept23-25,2017• GetSplunk CertifiedforFREE!• GetCPEcreditsforCISSP,CAP,SSCP

SEPT25-28,2017WalterE.WashingtonConventionCenterWashington,D.C.CONF.SPLUNK.COM

The8th AnnualSplunkWorldwideUsers’Conference

Page 58: Splunk Enterprise for InfoSec Hands-On

ThankYou