A Bug or Malware? Catastrophic consequences either way. Ben - - PowerPoint PPT Presentation

a bug or malware catastrophic consequences either way
SMART_READER_LITE
LIVE PREVIEW

A Bug or Malware? Catastrophic consequences either way. Ben - - PowerPoint PPT Presentation

A Bug or Malware? Catastrophic consequences either way. Ben Holland, Suresh Kothari Iowa State University but not necessarily in that order ;) DARPAs APAC


slide-1
SLIDE 1

A ¡Bug ¡or ¡Malware? ¡ ¡ Catastrophic ¡consequences ¡either ¡way.

Ben ¡Holland, ¡Suresh ¡Kothari ¡ Iowa ¡State ¡University ¡

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

…but ¡not ¡necessarily ¡in ¡that ¡order ¡;) ¡

slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10

DARPA’s ¡APAC ¡Program

  • Automated ¡Program ¡Analysis ¡For ¡Cybersecurity ¡(APAC) ¡
  • Scenario: ¡Hardened ¡devices, ¡internal ¡app ¡store, ¡untrusted ¡

contractors, ¡expert ¡adversaries ¡

  • Focused ¡on ¡Android ¡
slide-11
SLIDE 11

DARPA’s ¡APAC ¡Program

  • Automated ¡Program ¡Analysis ¡For ¡Cybersecurity ¡(APAC) ¡
  • Scenario: ¡Hardened ¡devices, ¡internal ¡app ¡store, ¡untrusted ¡

contractors, ¡expert ¡adversaries ¡

  • Focused ¡on ¡Android ¡

Need ¡precision ¡tools ¡to ¡detected ¡novel ¡and ¡ sophis*cated ¡malware ¡in ¡advance! ¡

slide-12
SLIDE 12

What ¡have ¡we ¡learned?

slide-13
SLIDE 13

What ¡to ¡expect ¡in ¡this ¡talk…

  • This ¡talk ¡does ¡not ¡have ¡all ¡the ¡answers… ¡
  • Step ¡back ¡and ¡ask ¡some ¡fundamental ¡quesMons ¡
  • Let’s ¡start ¡a ¡discussion ¡
slide-14
SLIDE 14

Ice ¡Breaker: ¡Do ¡you ¡agree?

  • AnMvirus ¡protects ¡us ¡from ¡modern ¡malware. ¡
  • AnMvirus ¡protects ¡us ¡from ¡yesterday’s ¡threats. ¡
  • AnMvirus ¡protects ¡us ¡from ¡last ¡year’s ¡threats. ¡
  • AnMvirus ¡is ¡totally ¡worthless. ¡
slide-15
SLIDE 15

Exercise: ¡Refactoring ¡CVE-­‑2012-­‑4681

  • “Allows ¡remote ¡aRackers ¡to ¡execute ¡arbitrary ¡code ¡via ¡a ¡craSed ¡

applet ¡that ¡bypasses ¡SecurityManager ¡restricMons…” ¡

  • CVE ¡Created ¡August ¡27th ¡2012 ¡(~2 ¡years ¡ago…) ¡
  • github.com/benjholla/CVE-­‑2012-­‑4681-­‑Armoring ¡

¡

¡Sample ¡Notes ¡Score ¡(posi*ve ¡detec*ons)

¡Original ¡Sample ¡hRp://pasMe.org/4594319 ¡ ¡30/55 ¡Technique ¡A ¡Changed ¡Class/Method ¡names ¡28/55 ¡Techniques ¡A ¡and ¡B ¡Obfuscate ¡strings ¡16/55 ¡Techniques ¡A-­‑C ¡Change ¡Control ¡Flow ¡16/55 ¡Techniques ¡A-­‑D ¡ReflecMve ¡invocaMons ¡(on ¡sensiMve ¡APIs) ¡3/55 ¡Techniques ¡A-­‑E ¡Simple ¡XOR ¡Packer ¡0/55

slide-16
SLIDE 16

Let’s ¡define ¡malware

  • Bad ¡(malicious) ¡soSware ¡
  • Examples: ¡Viruses, ¡Worms, ¡Trojan ¡

Horses, ¡Rootkits, ¡Backdoors, ¡ Adware, ¡Spyware, ¡Keyloggers, ¡ Dialers, ¡Ransomware… ¡

slide-17
SLIDE 17

Let’s ¡define ¡a ¡“bug”

  • UnintenMonal ¡error, ¡flaw, ¡failure, ¡

fault ¡

  • Examples: ¡Rounding ¡errors, ¡null ¡

pointers, ¡infinite ¡loops, ¡stack ¡

  • verflows, ¡race ¡condiMons, ¡memory ¡

leaks, ¡business ¡logic ¡flaws… ¡

  • Is ¡a ¡soSware ¡bug ¡malware? ¡
  • What ¡if ¡I ¡added ¡the ¡bug ¡intenMonally? ¡
slide-18
SLIDE 18

A ¡bug ¡or ¡malware?

  • Context: ¡Found ¡in ¡a ¡CVS ¡commit ¡to ¡the ¡Linux ¡Kernel ¡source ¡

¡

Hint: ¡This ¡never ¡executes… ¡ "=" ¡vs. ¡"==“ ¡is ¡a ¡subtle ¡yet ¡important ¡difference! ¡ Would ¡grant ¡root ¡privilege ¡to ¡any ¡user ¡that ¡knew ¡ how ¡to ¡trigger ¡this ¡condiMon. ¡

slide-19
SLIDE 19

Malware: ¡Linux ¡Backdoor ¡AVempt ¡(2003)

  • hRps://freedom-­‑to-­‑Mnker.com/blog/felten/the-­‑linux-­‑backdoor-­‑

aRempt-­‑of-­‑2003/ ¡

¡

Hint: ¡This ¡never ¡executes… ¡ "=" ¡vs. ¡"==“ ¡is ¡a ¡subtle ¡yet ¡important ¡difference! ¡ Would ¡grant ¡root ¡privilege ¡to ¡any ¡user ¡that ¡knew ¡ how ¡to ¡trigger ¡this ¡condiMon. ¡

slide-20
SLIDE 20

A ¡bug ¡or ¡malware?

slide-21
SLIDE 21

Always ¡goto ¡fail ¡

A ¡bug ¡or ¡malware?

Never ¡does ¡the ¡check ¡to ¡ verify ¡server ¡authenMcity… ¡

slide-22
SLIDE 22

Always ¡goto ¡fail ¡ Never ¡does ¡the ¡check ¡to ¡ verify ¡server ¡authenMcity… ¡

Bug?: ¡Apple ¡SSL ¡CVE-­‑2014-­‑1266

  • Should ¡have ¡been ¡

caught ¡by ¡automated ¡ tools ¡

  • Survived ¡almost ¡a ¡

year ¡

  • Affected ¡OSX ¡and ¡iOS ¡
slide-23
SLIDE 23

A ¡bug ¡or ¡malware?

Hint: ¡More ¡SSL ¡fun… ¡

slide-24
SLIDE 24

Bug ¡(I ¡hope): ¡Heartbleed

  • Much ¡less ¡obvious ¡
  • Survived ¡several ¡

code ¡audits ¡

  • Live ¡for ¡~2 ¡years ¡

"Catastrophic" ¡is ¡the ¡right ¡

  • word. ¡On ¡the ¡scale ¡of ¡1 ¡to ¡10, ¡

this ¡is ¡an ¡11. ¡ ¡-­‑Bruce ¡Schneier ¡ Reads ¡too ¡much ¡data! ¡ Heartbeat ¡message ¡size ¡ controlled ¡by ¡the ¡aRacker… ¡ Response ¡size ¡also ¡controlled ¡ by ¡the ¡aRacker… ¡

slide-25
SLIDE 25

A ¡bug ¡or ¡malware?

… ¡ Hint… ¡ Missing ¡some ¡input ¡validaMon ¡checks… ¡ Fix ¡adds: ¡ ¡

slide-26
SLIDE 26
  • Bug ¡is ¡the ¡due ¡to ¡the ¡absence ¡of ¡code ¡(validaMon ¡checks) ¡
  • Present ¡for ¡25 ¡years!? ¡
  • Even ¡more ¡complicated ¡to ¡find ¡
  • SMll ¡learning ¡the ¡extent ¡of ¡this ¡bug ¡

Bug ¡(probably): ¡Shellshock ¡CVE-­‑2014-­‑6271/7169

slide-27
SLIDE 27

Bug ¡(probably): ¡Shellshock ¡CVE-­‑2014-­‑6271/7169

slide-28
SLIDE 28

A ¡bug ¡or ¡malware?

slide-29
SLIDE 29

Malware: ¡VM ¡escape ¡using ¡bit ¡flips

  • Govindavajhala, ¡S.; ¡Appel, ¡AW., ¡"Using ¡memory ¡errors ¡to ¡aRack ¡a ¡virtual ¡machine," ¡ ¡Proceedings ¡ ¡
  • f ¡IEEE ¡Symposium ¡on ¡Security ¡and ¡Privacy, ¡pp.154-­‑165, ¡May ¡2003. ¡

Wait ¡for ¡a ¡bit ¡flip ¡to ¡obtain ¡two ¡pointers ¡of ¡incompaMble ¡types ¡that ¡ ¡ point ¡to ¡the ¡same ¡locaMon ¡to ¡circumvent ¡the ¡type ¡system ¡and ¡execute ¡ ¡ arbitrary ¡code ¡in ¡the ¡program ¡address ¡space. ¡

slide-30
SLIDE 30

So ¡what’s ¡your ¡point?

  • Both ¡bugs ¡and ¡malware ¡have ¡catastrophic ¡consequences ¡
  • Some ¡bugs ¡are ¡indisMnguishable ¡from ¡malware ¡
  • Plausible ¡deniability, ¡malicious ¡intent ¡cannot ¡be ¡determined ¡from ¡code ¡
  • Some ¡issues ¡can ¡be ¡found ¡automaMcally, ¡but ¡not ¡all ¡
  • Novel ¡aRacks ¡can ¡be ¡extremely ¡hard ¡to ¡detect ¡

AnMvirus ¡ looking ¡for ¡malice ¡ Program ¡Analysis ¡ looking ¡for ¡bugs… ¡ Next ¡Mme ¡you ¡own ¡a ¡box ¡ try ¡dropping ¡a ¡program ¡ with ¡an ¡exploitable ¡“bug” ¡

Are ¡we ¡doing ¡ourselves ¡a ¡ disservice ¡by ¡labeling ¡these ¡ as ¡separate ¡problems? ¡ ¡

slide-31
SLIDE 31

So ¡what ¡can ¡we ¡do ¡about ¡it?

  • Growing ¡infrastructure ¡
  • Complexity ¡of ¡systems ¡keeps ¡increasing ¡
  • Manual ¡work ¡is ¡expensive ¡
  • Cost ¡of ¡soSware ¡is ¡increasing ¡while ¡hardware ¡costs ¡decrease ¡
  • We ¡obviously ¡can’t ¡automate ¡it ¡all ¡
  • Malware ¡is ¡a ¡cat ¡and ¡mouse ¡game ¡
  • Tricky ¡bugs ¡are ¡tricky… ¡

Need ¡a ¡process ¡to ¡increase ¡human ¡producMvity… ¡

slide-32
SLIDE 32

OODA ¡and ¡You

  • “Security ¡is ¡a ¡process, ¡not ¡a ¡product” ¡– ¡Bruce ¡Schneier ¡
slide-33
SLIDE 33

OODA ¡and ¡You

“...IA ¡> ¡AI, ¡that ¡is, ¡that ¡intelligence ¡amplifying ¡ systems ¡can, ¡at ¡any ¡given ¡level ¡of ¡available ¡ systems ¡technology, ¡beat ¡AI ¡systems. ¡That ¡is, ¡ a ¡machine ¡and ¡a ¡mind ¡can ¡beat ¡a ¡mind-­‑ imitaMng ¡machine ¡working ¡by ¡itself.” ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ – ¡Fred ¡Brooks ¡

You ¡ Opponent ¡

Our ¡opponent ¡

  • Time ¡
  • EvoluMon ¡of ¡malware ¡
slide-34
SLIDE 34

Speeding ¡through ¡OODA ¡with ¡Atlas

¡ ¡ 2-­‑way ¡Source ¡Correspondence ¡ Program ¡DeclaraMons, ¡Control ¡Flow, ¡and ¡Data ¡Flow ¡ Queryable ¡Graph ¡Database ¡

slide-35
SLIDE 35

Speeding ¡through ¡OODA ¡with ¡Atlas

¡ ¡

SoSware ¡ Analyst ¡ Evidence ¡ Accept ¡or ¡ Reject ¡ Analysis ¡ Query ¡ Analysis ¡ Result ¡ Android ¡ App ¡ Atlas ¡ SoSware ¡ Security ¡ Toolbox ¡

slide-36
SLIDE 36

What ¡about ¡binaries?

  • Approach ¡is ¡similar ¡for ¡binary ¡analysis ¡
  • Binary ¡-­‑> ¡Intermediate ¡Language ¡-­‑> ¡Program ¡Graph ¡

¡

  • Demo: ¡Analysis ¡of ¡Stels ¡malware ¡
  • Download ¡and ¡execute ¡files ¡
  • Steal ¡contacts ¡lists ¡
  • Report ¡system ¡informaMon ¡
  • Make ¡phone ¡calls ¡
  • Send ¡SMS ¡messages ¡(to ¡premium ¡numbers) ¡
  • Monitor ¡and ¡record ¡and ¡hide ¡SMS ¡messages ¡
  • Show ¡noMficaMons ¡
  • Uninstall ¡apps ¡

¡

Source: ¡ ¡hRp://www.secureworks.com/cyber-­‑threat-­‑intelligence/threats/stels-­‑android-­‑trojan-­‑malware-­‑analysis/ ¡

¡

slide-37
SLIDE 37

SpellWrecker

  • Consider ¡a ¡spell ¡checker. ¡ ¡Invert ¡its ¡logic ¡and ¡what ¡do ¡you ¡get? ¡
  • How ¡do ¡we ¡semanMcally ¡detect ¡the ¡bad ¡one? ¡
  • github.com/benjholla/spellwrecker ¡

¡

“SomeMmes ¡you ¡have ¡to ¡demo ¡a ¡threat ¡to ¡spark ¡a ¡soluMon” ¡-­‑ ¡Barnaby ¡Jack ¡ ¡

slide-38
SLIDE 38

SpellWrecker

  • Consider ¡a ¡spell ¡checker. ¡ ¡Invert ¡its ¡logic ¡and ¡what ¡do ¡you ¡get? ¡
  • How ¡do ¡we ¡semanMcally ¡detect ¡the ¡bad ¡one? ¡
  • github.com/benjholla/spellwrecker ¡

¡

slide-39
SLIDE 39

Hypothebcal ¡Malware

  • Cars ¡are ¡becoming ¡drive-­‑by-­‑wire ¡
  • Electronic ¡Stability ¡Controls ¡(ESC) ¡are ¡being ¡added ¡to ¡SUVs ¡for ¡rollover ¡prevenMon ¡

¡

  • Invert ¡logic ¡on ¡roll ¡over ¡prevenMon ¡systems ¡
  • Plenty ¡of ¡evil ¡ways ¡to ¡implement ¡it, ¡e.g. ¡greedy ¡algorithms ¡
  • J. ¡Bang-­‑Jensen, ¡G. ¡GuMn, ¡and ¡A. ¡Yeo, ¡“When ¡the ¡greedy ¡algorithm ¡fails,” ¡Discrete ¡OpMmizaMons, ¡
  • vol. ¡1, ¡no. ¡2, ¡pp. ¡121–127, ¡Nov. ¡2004. ¡
  • LegiMmate ¡bugs ¡are ¡hard ¡enough, ¡how ¡can ¡we ¡hope ¡to ¡find ¡illegiMmate ¡bugs? ¡
slide-40
SLIDE 40

Quesbons?

  • Thanks! ¡
  • Try ¡Atlas: ¡hRp://www.ensoScorp.com/atlas/ ¡
  • Complimentary ¡academic ¡licenses ¡
  • Request ¡a ¡trial ¡
slide-41
SLIDE 41

What ¡properMes ¡would ¡ideal ¡malware ¡have? ¡

  • OperaMonal ¡goals ¡
  • EffecMve, ¡adaptable ¡
  • Maintaining ¡ownership ¡
  • Cross ¡playorm, ¡cross ¡architecture ¡
  • Persistence ¡(survival, ¡removal, ¡updatable) ¡
  • DetecMon ¡avoidance ¡
  • Resistant ¡to ¡staMc/dynamic ¡analysis ¡(intractable ¡analysis ¡problems) ¡
  • Difficult ¡to ¡characterize ¡
  • Small ¡footprint ¡(low ¡resource ¡consumpMon, ¡minimal ¡impact) ¡
  • Blends ¡well ¡with ¡legiMmate ¡funcMonality ¡
  • DetecMon ¡miMgaMon ¡
  • Plausible ¡deniability ¡
  • Kerckhoffs's ¡principle ¡(ex: ¡untraceable ¡transacMons) ¡
  • General ¡SoSware ¡Design ¡Issues ¡
  • Maintainable, ¡deployable, ¡scalable, ¡etc. ¡