NTXISSACSC4 - The Art of Evading Anti-Virus

28
@NTXISSA #NTXISSACSC4 The Art of Evading Antivirus Quentin Rhoads-Herrera Security Analyst State Farm 9/28/2016

Transcript of NTXISSACSC4 - The Art of Evading Anti-Virus

Page 1: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

TheArtofEvadingAntivirus

QuentinRhoads-HerreraSecurityAnalyst

StateFarm9/28/2016

Page 2: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Background

• Workedinthefollowingroles:• Systemadministrator• Developer(.net /mobile)• Regulatory/complianceanalyst• SecurityAnalyst

• PentestingHobbyistJ

NTXISSACyberSecurityConference– October7-8,2016 2

Page 3: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

TheProblem

• Pen-testersarecaughtbyantivirusprograms.• AntivirusprogramscatchstockMetasploitpayloads.• Maliciousmalwarecreatorshavealreadysolvedthisproblem.

NTXISSACyberSecurityConference– October7-8,2106 3

Page 4: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

HowAntivirusWorks

• Signature-baseddetection• Heuristic-baseddetection• Behavioral-baseddetection• Sandboxdetection• Dataminingtechniques

NTXISSACyberSecurityConference– October7-8,2106 4

Page 5: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

IsAntivirusDead?

• In2014theseniorvicepresidentofSymantecBrianDyedeclaredtotheWallStreetJournalthatantivirus“isdead.”– BrianDye,SeniorVicePresident,Symantec

Source:http://online.wsj.com/news/article_email/SB10001424052702303417104579542140235850578-lMyQjAxMTA0MDAwNTEwNDUyWj

NTXISSACyberSecurityConference– October7-8,2106 5

Page 6: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

IsAntivirusDead?

• “Relyingsolelyonantivirusisadeadend-andithasbeenforatleast8yearsnow.Butthat’slikesayingthataspirinisdeadbecauseit’snotthecureforcancer,AIDS,andallofhumanity'sotherillnesses.”–BogdanDomitru,ChiefTechnologyOfficer,Bitdefender

Source:http://securitywatch.pcmag.com/security/

NTXISSACyberSecurityConference– October7-8,2106 6

Page 7: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

EvadingAntivirusWays

• Changingthesignature• Encode(ALOT)• Encrypt• Leverageyourownexecutable,oronethatisalreadytrustedbyWindows(notepad.exe)• Veil-Framework

NTXISSACyberSecurityConference– October7-8,2106 7

Page 8: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

TheVeil-Framework

NTXISSACyberSecurityConference– October7-8,2106 8

Page 9: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

HDMoore

• “Thestrongestcaseforinformationdisclosureiswhenthebenefitofreleasingtheinformationoutweighsthepossiblerisks.Inthiscase,likemanyothers,thebadguysalreadywon.”– HDMoore

Source:https://community.rapid7.com/community/metasploit/blog/2009/02/23/the-best-defense-is-information

NTXISSACyberSecurityConference– October7-8,2106 9

Page 10: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

CheckingyourPayloads

• Virustotal isawebsitethatallowsyoutocheckhowsuccessfulyourpayloadiswhenevadingantiviruses.

• AntivirusvendorsreceiveinformationaboutwhatwasuploadedtoVirustotal.

NTXISSACyberSecurityConference– October7-8,2106 10

Page 11: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Virustotal

NTXISSACyberSecurityConference– October7-8,2106 11

Source:https://www.virustotal.com/

Page 12: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Meterpreter isCaught

NTXISSACyberSecurityConference– October7-8,2106 12

Page 13: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

EncodedMeterpreter

NTXISSACyberSecurityConference– October7-8,2106 13

Page 14: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

TheVeilWay

• TheVeilhashcheckmethod!!!(Reallyslick)• Recommendedtocheckthehashwhichislocatedat/veil/output/hashesthroughtheAPIonvirustotal insteadofsubmittingfiles.• checkvt willspawnallhashesandcheckviaAPIwithVirustotal.

NTXISSACyberSecurityConference– October7-8,2106 14

Page 15: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Demo

NTXISSACyberSecurityConference– October7-8,2106 15

Page 16: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

WhenitisCaught

NTXISSACyberSecurityConference– October7-8,2106 16

Page 17: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Veil-Evasion

• IntegratedwithMetasploit• Leveragesencryption(AESencryptedshellcode)• Canleverageyourownpayloads• Usesnon-standardlanguagesforWindowsbinaries• Canintegrateintoyourownproject

NTXISSACyberSecurityConference– October7-8,2106 17

Page 18: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

LanguagesUsed

• Python• Perl• PowerShell• C• C#• Go• Ruby

NTXISSACyberSecurityConference– October7-8,2106 18

Page 19: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Shellcodes

• VoidPointercasting:• Notaguaranteethatyourshellcodewilldropintoexecutablememory.

• VirtualAlloc:• Allocatesmemory(shellcodesize)• Determinespermissionsneeded

• HeapAlloc:• Manuallydropshellcode

NTXISSACyberSecurityConference– October7-8,2106 19

Page 20: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

DEMO

NTXISSACyberSecurityConference– October7-8,2106 20

Page 21: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Veil-Ordnance

• Generatesshellcodethatcanbecopiedintoyourpayload.• Createdduetoshellcodebeing“broken”whenleveragingmsfvenom makinganon-workingpayload.

NTXISSACyberSecurityConference– October7-8,2106 21

Page 22: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Veil-Ordnance

NTXISSACyberSecurityConference– October7-8,2106 22

Page 23: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Veil-Catapult

• PayloadDeliverytool• Payloads:• PowerShell• BarebonesPython• Sethc backdoor

• CanautospawntheMetasploithandlerscript.

NTXISSACyberSecurityConference– October7-8,2106 23

Page 24: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

DEMO

NTXISSACyberSecurityConference– October7-8,2106 24

Page 25: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

HowtoStopVeil

• APIScanners(AmbushIPS)• PredictableBehaviors• EnhancedMitigationExperienceToolkit(EMET)

NTXISSACyberSecurityConference– October7-8,2106 25

Page 26: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

OtherAVEvadingTools

• Hyperion:Thisisusedtoencryptthebinary

• peCloak:Automatedtoolthatattemptsmultipletrickstoevadeantiviruses

NTXISSACyberSecurityConference– October7-8,2106 26

Page 27: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4

Q&A

NTXISSACyberSecurityConference– October7-8,2106 27

Page 28: NTXISSACSC4 - The Art of Evading Anti-Virus

@NTXISSA#NTXISSACSC4@NTXISSA#NTXISSACSC4

The Collin College Engineering DepartmentCollin College StudentChapteroftheNorthTexasISSA

NorthTexasISSA(InformationSystemsSecurityAssociation)

NTXISSACyberSecurityConference– October7-8,2016 28

Thankyou