Security Applica.ons of GPUs So.ris Ioannidis Founda.on - - PowerPoint PPT Presentation

security applica ons of gpus
SMART_READER_LITE
LIVE PREVIEW

Security Applica.ons of GPUs So.ris Ioannidis Founda.on - - PowerPoint PPT Presentation

Security Applica.ons of GPUs So.ris Ioannidis Founda.on for Research and Technology Hellas (FORTH) Outline Background and mo-va-on GPU-based,


slide-1
SLIDE 1

Security ¡Applica.ons ¡of ¡GPUs ¡

So.ris ¡Ioannidis ¡ Founda.on ¡for ¡Research ¡and ¡ Technology ¡– ¡Hellas ¡(FORTH) ¡

slide-2
SLIDE 2

Outline ¡

  • Background ¡and ¡mo-va-on ¡
  • GPU-­‑based, ¡signature-­‑based ¡malware ¡detec.on ¡

– Network ¡intrusion ¡detec.on/preven.on ¡ – Virus ¡scanning ¡

  • GPU-­‑assisted ¡malware ¡

– Code-­‑armoring ¡techniques ¡ – Keylogger ¡

  • GPU ¡as ¡a ¡secure ¡crypto-­‑processor ¡
  • Conclusions ¡

2 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-3
SLIDE 3

GPU ¡= ¡Graphics ¡Processing ¡Unit ¡

  • The ¡heart ¡of ¡graphics ¡cards ¡
  • Mainly ¡used ¡for ¡real-­‑.me ¡3D ¡game ¡rendering ¡

– Massively ¡parallel ¡processing ¡capacity ¡

3 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-4
SLIDE 4

Why ¡GPU? ¡

  • General-­‑purpose ¡compu.ng ¡

– Flexible ¡and ¡programmable ¡ – Portability ¡

  • Powerful, ¡ubiquitous, ¡affordable ¡

– Dominant ¡co-­‑processor ¡ – Constant ¡innova.on ¡ – Inexpensive ¡and ¡always-­‑present ¡

  • Data-­‑parallel ¡model ¡

4 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-5
SLIDE 5

CPU ¡vs. ¡GPU ¡

CPU ¡ GPU ¡

Xeon X5550:

4 cores 731M transistors

GTX480:

480 cores 3,200M transistors

5 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-6
SLIDE 6

Single ¡Instruc.on, ¡Mul.ple ¡Threads ¡

  • Example: ¡vector ¡addi.on ¡

6 ¡

void vecadd( int *A, int *B, int *C, int N) { int i; //iterate over N elements for (i=0; i<N; ++i) C[i] = A[i] + B[i]; }

  • vecadd(A, B, C, N);
  • CPU ¡code ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-7
SLIDE 7

Single ¡Instruc.on, ¡Mul.ple ¡Threads ¡

  • Example: ¡vector ¡addi.on ¡

7 ¡

void vecadd( int *A, int *B, int *C, int N) { int i; //iterate over N elements for (i=0; i<N; ++i) C[i] = A[i] + B[i]; }

  • vecadd(A, B, C, N);
  • CPU ¡code ¡

__global__ void vecadd( int *A, int *B, int *C) { int i = threadIdx.x; C[i] = A[i] + B[i]; }

  • //Launch N threads

vecadd<<<1, N>>>(A, B, C);

  • GPU ¡code ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-8
SLIDE 8

Single ¡Instruc.on, ¡Mul.ple ¡Threads ¡

  • Example: ¡vector ¡addi.on ¡

8 ¡

CPU ¡code ¡ GPU ¡code ¡

void vecadd( int *A, int *B, int *C, int N) { int i; //iterate over N elements for (i=0; i<N; ++i) C[i] = A[i] + B[i]; }

  • vecadd(A, B, C, N);
  • __global__ void vecadd(

int *A, int *B, int *C) { int i = threadIdx.x; C[i] = A[i] + B[i]; }

  • //Launch N threads

vecadd<<<1, N>>>(A, B, C);

  • 24/10/14 ¡

CANS ¡2014 ¡

slide-9
SLIDE 9

Single ¡Instruc.on, ¡Mul.ple ¡Threads ¡

  • Threads ¡within ¡the ¡same ¡warp ¡have ¡to ¡execute ¡

the ¡same ¡instruc.ons ¡

  • Great ¡for ¡regular ¡computa/ons! ¡

SIMT ¡group ¡ (warp) ¡

9 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-10
SLIDE 10

Outline ¡

  • Background ¡and ¡mo.va.on ¡
  • GPU-­‑based, ¡signature-­‑based ¡malware ¡detec-on ¡

– Network ¡intrusion ¡detec-on/preven-on ¡ – Virus ¡scanning ¡

  • GPU-­‑assisted ¡malware ¡

– Code-­‑armoring ¡techniques ¡ – Keylogger ¡

  • GPU ¡as ¡a ¡secure ¡crypto-­‑processor ¡
  • Conclusions ¡

10 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-11
SLIDE 11

Signature-­‑based ¡Detec.on ¡

  • Typically ¡deployed ¡at ¡ingress/egress ¡points ¡

– Inspect ¡all ¡network ¡traffic ¡ – Look ¡for ¡suspicious ¡ac.vi.es ¡ – Alert ¡on ¡malicious ¡ac.ons ¡

10 ¡GbE ¡

Internet ¡ Internal ¡ Network ¡ NIDS ¡

11 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-12
SLIDE 12

Challenges ¡(1) ¡

  • Traffic ¡rates ¡are ¡increasing ¡

– 10 ¡Gbit/s ¡Ethernet ¡speeds ¡are ¡common ¡in ¡metro/ enterprise ¡networks ¡ – More ¡than ¡40 ¡Gbit/s ¡at ¡the ¡core ¡

12 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-13
SLIDE 13

Challenges ¡(2) ¡

  • Ever-­‑increasing ¡need ¡to ¡perform ¡more ¡

complex ¡analysis ¡at ¡higher ¡traffic ¡rates ¡

– Deep ¡packet ¡inspec.on ¡ – Stateful ¡analysis ¡ – 1000s ¡of ¡afack ¡signatures ¡

Stream ¡Demux ¡

Output ¡

TCP ¡Stream ¡ Reassembly ¡ Protocol ¡Analysis ¡ PaNern ¡Matching ¡

13 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-14
SLIDE 14

Designing ¡NIDS ¡and ¡AVs ¡

  • Fast ¡

– Need ¡to ¡handle ¡many ¡Gbit/s ¡ – Scalable ¡

  • The ¡future ¡is ¡many-­‑core ¡
  • Commodity ¡hardware ¡

– Cheap ¡ – Easily ¡programmable ¡

14 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-15
SLIDE 15

Today: ¡fast ¡or ¡commodity ¡

  • Fast ¡“hardware” ¡IDS/IPS ¡

– FPGA/TCAM/ASIC ¡based ¡ – Usually, ¡.ed ¡to ¡a ¡specific ¡ implementa.on ¡ – Throughput: ¡High ¡

  • Commodity ¡“sojware” ¡

NIDS/NIPS ¡and ¡AVs ¡

– Processing ¡by ¡general-­‑ purpose ¡processors ¡ – Throughput: ¡Low ¡

IDS/IPS ¡Sensors ¡ ¡ (10s ¡of ¡Gbps) ¡

¡

IDS/IPS ¡M8000 ¡ (10s ¡of ¡Gbps) ¡

¡

Open-­‑source ¡S/W ¡

¡

~ ¡US$ ¡20,000 ¡-­‑ ¡60,000 ¡ ~ ¡US$ ¡10,000 ¡-­‑ ¡24,000 ¡ ≤ ¡~1 ¡Gbps ¡

15 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-16
SLIDE 16

Typical ¡Signature-­‑based ¡NIDS ¡ Architecture ¡ ¡

¡ ¡

16 ¡

Packet ¡ Acquisition ¡ ¡ ¡ Preprocessing ¡

Decode ¡ Flow ¡management ¡ ¡ Reassembly ¡ Match ¡ Success ¡ Match ¡Failure ¡ (Innocent ¡Flow) ¡

Multi-­‑string ¡ Pattern ¡Matching ¡

Evaluation ¡Failure ¡ (Innocent ¡Flow) ¡ Evaluation ¡ Success ¡

Rule ¡Options ¡ Evaluation ¡ Output ¡

Malicious ¡ Flow ¡

alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS 80 (msg:“possible attack attempt BACKDOOR optix runtime detection"; content:"/whitepages/page_me/

100.html"; pcre:"/body=\x2521\x2521\x2521Optix\s+Pro\s+v\d+\x252E\d+\S+sErver\s+Online \x2521\x2521\x2521/")

Bottlenecks ¡

* ¡PCRE: ¡Perl ¡Compatible ¡Regular ¡Expression ¡ ¡

slide-17
SLIDE 17

Single-­‑threaded ¡NIDS ¡performance ¡

  • Vanilla ¡Snort: ¡0.2 ¡Gbit/s ¡

NIC ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡

17 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-18
SLIDE 18

Problem ¡#1: ¡Scalability ¡

  • Single-­‑threaded ¡NIDS ¡have ¡limited ¡

performance ¡

– Do ¡not ¡scale ¡with ¡the ¡number ¡of ¡CPU ¡cores ¡

18 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-19
SLIDE 19

Mul.-­‑threaded ¡performance ¡

  • Vanilla ¡Snort: ¡0.2 ¡Gbit/s ¡
  • With ¡mul-ple ¡CPU-­‑cores: ¡0.9 ¡Gbit/s ¡

NIC ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡

19 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-20
SLIDE 20

Problem ¡#2: ¡How ¡to ¡split ¡traffic ¡

û Synchroniza.on ¡overheads ¡

¡

û Cache ¡misses ¡ ü Receive-­‑Side ¡Scaling ¡(RSS) ¡

¡

NIC ¡ cores ¡

20 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-21
SLIDE 21

Mul.-­‑queue ¡performance ¡

  • Vanilla ¡Snort: ¡0.2 ¡Gbit/s ¡
  • With ¡mul.ple ¡CPU-­‑cores: ¡0.9 ¡Gbit/s ¡
  • With ¡mul-ple ¡Rx-­‑queues: ¡1.1 ¡Gbit/s ¡

RSS ¡ NIC ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡ Preprocess ¡

21 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-22
SLIDE 22

Problem ¡#3: ¡Pafern ¡matching ¡is ¡the ¡ bofleneck ¡

  • On ¡an ¡Intel ¡Xeon ¡X5520, ¡2.27 ¡GHz, ¡8 ¡MB ¡L3 ¡Cache ¡

– String ¡matching ¡analyzing ¡bandwidth ¡per ¡core: ¡1.1 ¡Gbps ¡ – PCRE ¡ ¡analyzing ¡bandwidth ¡per ¡core: ¡0.52 ¡Gbps ¡

¡

NIC ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡

> ¡75% ¡

22 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-23
SLIDE 23

Offload ¡pafern ¡matching ¡on ¡the ¡GPU ¡

NIC ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡

23 ¡

strings ¡ pcre ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-24
SLIDE 24

Pafern ¡matching ¡on ¡the ¡GPU ¡

¡Both ¡string ¡searching ¡and ¡regular ¡expression ¡ matching ¡can ¡be ¡matched ¡efficiently ¡by ¡combining ¡ the ¡paferns ¡into ¡Determinis/c ¡Finite ¡Automata ¡ (DFA) ¡

24 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-25
SLIDE 25

Pafern ¡matching ¡on ¡the ¡GPU ¡

  • Uniformly ¡one ¡core ¡for ¡each ¡reassembled ¡packet ¡stream ¡

GPU ¡ core ¡ Matches ¡ GPU ¡ core ¡ GPU ¡ core ¡ GPU ¡ core ¡ Packet ¡Buffer ¡ GPU ¡ core ¡ GPU ¡ core ¡

25 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-26
SLIDE 26

Mul.ple ¡data ¡transfers ¡

  • Several ¡data ¡transfers ¡between ¡different ¡devices ¡

¡Are ¡the ¡data ¡transfers ¡worth ¡the ¡computa/onal ¡ gains ¡offered? ¡

CPU ¡(Host) ¡

26 ¡

GPU ¡(Device) ¡

NIC ¡ Device ¡ Global ¡ Memory ¡ PaNern ¡ Matching ¡ kernel ¡

PCIe ¡

Main ¡ Memory ¡ Transfer ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-27
SLIDE 27

Transferring ¡to ¡GPU ¡

  • Small ¡transfer ¡results ¡to ¡PCIe ¡throughput ¡degrada.on ¡

è Many ¡reassembled ¡packets ¡are ¡batched ¡into ¡a ¡single ¡ buffer ¡

CPU-­‑core ¡

Push ¡ Push ¡ Push ¡

GPU ¡

27 ¡

buffering ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-28
SLIDE 28

Pipelining ¡CPU ¡and ¡GPU ¡

  • Double-­‑buffering ¡

– Each ¡CPU ¡core ¡collects ¡new ¡reassembled ¡packets, ¡ while ¡the ¡GPUs ¡process ¡the ¡previous ¡batch ¡ – Effec.vely ¡hides ¡GPU ¡communica.on ¡costs ¡

CPU ¡

Packet ¡buffers ¡

28 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-29
SLIDE 29

Pafern ¡matching ¡on ¡the ¡GPU ¡

¡On ¡an ¡Intel ¡Xeon ¡X5520, ¡2.27 ¡GHz, ¡8 ¡MB ¡L3 ¡Cache ¡

– String ¡matching ¡analyzing ¡bandwidth: ¡1.1 ¡Gbps ¡ – PCRE ¡analyzing ¡bandwidth: ¡0.52 ¡Gbps ¡

¡

NIC ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡

29 ¡

NVIDIA ¡GTX ¡480 ¡GPU ¡

30 ¡Gbps ¡ 8 ¡Gbps ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-30
SLIDE 30

Offloading ¡pafern ¡matching ¡to ¡the ¡GPU ¡

  • Vanilla ¡Snort: ¡

¡ ¡ ¡0.2 ¡Gbit/s ¡

  • With ¡mul.ple ¡CPU-­‑cores: ¡0.9 ¡Gbit/s ¡
  • With ¡mul.ple ¡Rx-­‑queues: ¡1.1 ¡Gbit/s ¡
  • With ¡GPU: ¡

¡ ¡ ¡ ¡5.2 ¡Gbit/s ¡

RSS ¡ NIC ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡ Pafern ¡ matching ¡ Output ¡ Pafern ¡ matching ¡ Output ¡ Preprocess ¡ Preprocess ¡

30 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-31
SLIDE 31

Outline ¡

  • Background ¡and ¡mo.va.on ¡
  • GPU-­‑based ¡Signature ¡Detec-on ¡

– Network ¡intrusion ¡detec.on/preven.on ¡ – Virus ¡matching ¡

  • GPU-­‑assisted ¡Malware ¡

– Code-­‑armoring ¡techniques ¡ – Keylogger ¡

  • GPU ¡as ¡a ¡Secure ¡Crypto-­‑Processor ¡
  • Conclusions ¡

31 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-32
SLIDE 32

An.-­‑Virus ¡Databases ¡

  • Contain ¡thousands ¡of ¡signatures ¡

– ClamAV ¡contains ¡more ¡than ¡60K ¡signatures ¡

32 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-33
SLIDE 33

An.-­‑Virus ¡Databases ¡

  • ClamAV ¡signatures ¡are ¡significant ¡longer ¡than ¡

NIDS ¡

– length ¡varying ¡from ¡4 ¡to ¡392 ¡bytes ¡

> ¡80% ¡ > ¡90% ¡

33 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-34
SLIDE 34

An.-­‑Virus ¡Databases ¡

  • Memory ¡requirements ¡

~14 ¡GB ¡ ~0.8 ¡GB ¡

34 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-35
SLIDE 35

Opportunity: ¡Prefix ¡Filtering ¡

  • Take ¡the ¡first ¡n ¡bytes ¡from ¡each ¡signature ¡

– e.g. ¡

Worm.SQL.Slammer.A:0:*: ¡ 4e65742d576f726d2e57696e33322e536c616d6d65725554

  • Compile ¡all ¡n-­‑bytes ¡sub-­‑signatures ¡into ¡a ¡

single ¡Scanning ¡Trie ¡

  • The ¡Scanning ¡Trie ¡can ¡quickly ¡filter ¡clean ¡data ¡

segments ¡in ¡linear ¡.me. ¡

35 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-36
SLIDE 36

Scanning ¡Trie ¡

  • Variable ¡trie ¡height ¡

36 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-37
SLIDE 37

Longer ¡prefix ¡= ¡Fewer ¡matches ¡

37 ¡

2% ¡ 0.0001% ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-38
SLIDE 38

Longer ¡prefix ¡= ¡More ¡memory ¡

Prefix length

2 3 4 5 6 7 8 9 10 11 12 13 14

Number of states (1000’s)

100 200 300 400

38 ¡

Total ¡Memory ¡(MBs) ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-39
SLIDE 39

Execu.on ¡Time ¡Breakdown ¡

  • CPU ¡.me ¡results ¡in ¡20% ¡of ¡the ¡total ¡execu.on ¡.me, ¡

with ¡a ¡ ¡prefix ¡length ¡equal ¡to ¡14 ¡

39 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-40
SLIDE 40

GPU ¡vs ¡CPU ¡

Ø Up ¡to ¡20 ¡Gbps ¡end-­‑to-­‑end ¡performance ¡

100x ¡ 12x ¡

GPU ¡

40 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-41
SLIDE 41

Summary ¡

  • Both ¡Network ¡Intrusion ¡Detec/on ¡and ¡Virus ¡

Scanning ¡on ¡the ¡GPU ¡are ¡prac-cal ¡and ¡fast! ¡

41 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-42
SLIDE 42

Outline ¡

  • Background ¡and ¡mo.va.on ¡
  • GPU-­‑based ¡Malware ¡Signature ¡Detec.on ¡

– Network ¡intrusion ¡detec.on/preven.on ¡ – Virus ¡scanning ¡

  • GPU-­‑assisted ¡Malware ¡

– Code-­‑armoring ¡techniques ¡ – Keylogger ¡

  • GPU ¡as ¡a ¡Secure ¡Crypto-­‑Processor ¡
  • Conclusions ¡

42 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-43
SLIDE 43

Mo.va.on ¡

  • Malware ¡con.nually ¡seek ¡new ¡methods ¡for ¡

hiding ¡their ¡malicious ¡ac.vity, ¡… ¡

– Packing ¡ – Polymorphism ¡

  • … ¡as ¡well ¡as, ¡hinder ¡reverse ¡engineering ¡and ¡code ¡

analysis ¡

– Code ¡obfusca.on ¡ – An.-­‑debugging ¡tricks ¡

  • Is ¡it ¡possible ¡for ¡a ¡malware ¡to ¡exploit ¡the ¡rich ¡

func.onality ¡of ¡modern ¡GPUs? ¡

43 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-44
SLIDE 44

Proof-­‑of-­‑Concept ¡GPU-­‑based ¡Malware ¡

  • Design ¡and ¡implementa.on ¡of ¡code ¡armoring ¡

techniques ¡based ¡on ¡GPU ¡code ¡

– Self-­‑unpacking ¡ – Run-­‑.me ¡polymorphism ¡

  • Design ¡and ¡implementa.on ¡of ¡stealthy ¡host ¡

memory ¡scanning ¡techniques ¡

– Keylogger ¡

44 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-45
SLIDE 45

Self-­‑unpacking ¡GPU-­‑malware ¡

45 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-46
SLIDE 46

Self-­‑unpacking: ¡Strengths ¡

  • Current ¡analysis ¡and ¡unpacking ¡systems ¡

cannot ¡handle ¡GPU ¡code ¡

  • GPU ¡can ¡use ¡extremely ¡complex ¡encryp.on ¡

schemes ¡

  • Cannot ¡run ¡on ¡virtual-­‑machines ¡
  • Exposes ¡minimal ¡x86 ¡code ¡footprint ¡

46 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-47
SLIDE 47

Run.me-­‑polymorphic ¡GPU-­‑malware ¡

47 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-48
SLIDE 48

Run.me-­‑polymorphism: ¡Strengths ¡

  • GPU ¡can ¡use ¡different ¡encryp.on ¡key ¡every ¡

.me ¡

– Random-­‑generated ¡

  • Each ¡encryp.on ¡key ¡is ¡stored ¡in ¡device ¡

memory ¡

– Not ¡accessible ¡from ¡CPU ¡

48 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-49
SLIDE 49

GPU-­‑keylogger ¡

  • Scan ¡kernel’s ¡memory ¡to ¡locate ¡the ¡keyboard ¡

buffer ¡

  • Remap ¡the ¡memory ¡page ¡of ¡the ¡buffer ¡to ¡user ¡

space ¡

  • Set ¡the ¡GPU ¡to ¡periodically ¡read ¡and ¡scan ¡

them ¡for ¡sensi.ve ¡informa.on ¡(e.g., ¡credit ¡ card ¡numbers) ¡ ¡

  • Unmap ¡the ¡memory ¡in ¡order ¡to ¡leave ¡no ¡

traces ¡

49 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-50
SLIDE 50

Implementa.on ¡

Step ¡1: ¡Locate ¡the ¡keyboard ¡buffer ¡

§ Keyboard ¡buffer ¡dynamically ¡changes ¡address ¡aHer ¡system ¡ reboo/ng ¡or ¡aHer ¡unplugging ¡and ¡plugging ¡back ¡in ¡the ¡device ¡

50 ¡

kernel module controller process memory scanner GPU code

start keylogger manipulate page table entries locate buffer scan pages

24/10/14 ¡ CANS ¡2014 ¡

slide-51
SLIDE 51

Implementa.on ¡

Step ¡2: ¡Configure ¡the ¡GPU ¡to ¡constantly ¡ monitor ¡buffer ¡contents ¡for ¡changes ¡

¡

51 ¡

kernel module controller process memory scanner GPU code

start keylogger manipulate page table entries locate buffer scan pages

24/10/14 ¡ CANS ¡2014 ¡

slide-52
SLIDE 52

Implementa.on ¡

Step ¡3: ¡Start ¡GPU ¡process ¡& ¡Capture ¡keystrokes ¡

¡

52 ¡

kernel module controller process memory scanner GPU code

start keylogger manipulate page table entries locate buffer scan pages

24/10/14 ¡ CANS ¡2014 ¡

slide-53
SLIDE 53

Possible ¡Defenses ¡

  • Monitoring ¡GPU ¡access ¡paferns ¡

§ Mul.ple/repeated ¡DMAs ¡from ¡the ¡GPU ¡to ¡system ¡RAM ¡

  • Monitoring ¡GPU ¡usage ¡

§ Unexpected ¡increased ¡GPU ¡usage ¡ ¡

53 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-54
SLIDE 54

Current ¡Prototype ¡Limita.ons ¡

  • Requires ¡a ¡CPU ¡process ¡to ¡control ¡its ¡

execu.on ¡

§ Future ¡GPGPU ¡SDKs ¡might ¡allow ¡us ¡to ¡drop ¡the ¡CPU ¡controller ¡ process ¡

  • Requires ¡administra.ve ¡privileges ¡

§ For ¡installing ¡and ¡using ¡the ¡module ¡ § However ¡the ¡control ¡process ¡runs ¡in ¡user-­‑space ¡

  • No ¡kernel ¡injec.on ¡needed ¡or ¡data ¡structure ¡

manipula.on, ¡in ¡order ¡to ¡hide ¡

54 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-55
SLIDE 55

Summary

  • GPUs offer new ways for robust and stealthy malware

– We ¡demonstrated ¡how ¡a ¡malware ¡can ¡increase ¡its ¡robustness ¡ against ¡detec.on ¡using ¡the ¡GPU ¡

  • Unpacking ¡
  • Run-­‑.me ¡polymorphism ¡

– Presented ¡a ¡fully ¡func.onal ¡and ¡stealthy ¡GPU-­‑based ¡keylogger ¡

  • Low ¡CPU ¡and ¡GPU ¡usage ¡
  • No ¡device ¡hooking ¡
  • No ¡traces ¡lej ¡ajer ¡exploita.on ¡
  • User ¡mode ¡applica.on; ¡No ¡kernel ¡injec.on ¡needed ¡
  • Graphics ¡cards ¡may ¡be ¡a ¡promising ¡new ¡environment ¡for ¡

future ¡malware

55 24/10/14 ¡ CANS ¡2014 ¡

slide-56
SLIDE 56

Outline ¡

  • Background ¡and ¡mo.va.on ¡
  • GPU-­‑based ¡Malware ¡Signature ¡Detec.on ¡

– Network ¡intrusion ¡detec.on/preven.on ¡ – Virus ¡scanning ¡

  • GPU-­‑assisted ¡Malware ¡

– Code-­‑armoring ¡techniques ¡ – Keylogger ¡

  • GPU ¡as ¡a ¡Secure ¡Crypto-­‑Processor ¡
  • Conclusions ¡

56 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-57
SLIDE 57

Last ¡years ¡increase ¡of ¡SSL ¡traffic ¡

57 ¡

5.7 5.76x x

4. 4.15 15x x

1. 1.66x 66x

“We should encrypt the entire internet”

  • - Matt Cutts, Head of Google's Webspam team

source: ¡Sandvine ¡Inc. ¡

24/10/14 ¡ CANS ¡2014 ¡

slide-58
SLIDE 58

Mo.va.on ¡

  • Secure ¡Sockets ¡Layer ¡(SSL) ¡is ¡a ¡de-­‑facto ¡standard ¡

for ¡secure ¡communica.on ¡ ¡

– Authen.ca.on, ¡confiden.ality, ¡integrity ¡ ¡

  • Cryptographic ¡keys ¡may ¡remain ¡unencrypted ¡in ¡

CPU ¡Registers, ¡RAM, ¡HDD, ¡etc. ¡

– Memory ¡afacks ¡ – DMA/Firewire ¡afacks ¡ – Heartbleed ¡afack ¡ – Cold-­‑boot ¡afacks ¡

58 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-59
SLIDE 59

PixelVault ¡Overview ¡

  • Runs ¡encryp.on ¡securely ¡
  • utside ¡CPU/RAM ¡
  • Secret ¡keys ¡and ¡states ¡

never ¡observed ¡from ¡ host ¡

  • Instead, ¡only ¡GPU’s ¡non-­‑

addressable ¡memory ¡is ¡ used ¡as ¡storage ¡

Host ¡

x86 ¡Host ¡CPU ¡

PLAINTEXT CIPHERTEXT

Graphics ¡Card ¡

ENCRYPT

59 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-60
SLIDE 60

PixelVault ¡Features ¡

  • Prevent ¡key ¡leakages ¡

– Even ¡when ¡the ¡base ¡system ¡is ¡fully ¡compromised ¡

  • Requires ¡just ¡a ¡commodity ¡GPU ¡

– No ¡OS ¡kernel ¡modifica.ons ¡or ¡recompila.on ¡

  • Provides ¡strong ¡security ¡guarantees ¡

– Even ¡against ¡local ¡root ¡afackers ¡

60 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-61
SLIDE 61

Limita.ons ¡

  • Require ¡trusted ¡bootstrap ¡
  • Dedicated ¡GPU ¡execu.on ¡
  • Misusing ¡PixelVault ¡for ¡encryp.ng/decryp.ng ¡

messages ¡

  • Denial-­‑of-­‑Service ¡afacks ¡
  • Side-­‑channel ¡afacks ¡

61 ¡ 24/10/14 ¡ CANS ¡2014 ¡

slide-62
SLIDE 62

Conclusions ¡

  • GPUs ¡have ¡diverse ¡security ¡applica.ons ¡

– Both ¡for ¡defense ¡and ¡offense ¡ – NDIS, ¡AV, ¡crypto-­‑devices, ¡secure ¡processors, ¡etc. ¡ – Generic ¡library ¡with ¡func.onality ¡for ¡various ¡applica.ons ¡ – Combine ¡high-­‑performance ¡with ¡programmability ¡

  • Future ¡work ¡

– Adapt ¡to ¡other ¡ciphers ¡and ¡applica.on ¡domains ¡ ¡ – Apply ¡to ¡mobile ¡and ¡embedded ¡devices ¡ – U.lize ¡integrated ¡CPU-­‑GPU ¡designs ¡

  • ¡ Credits ¡to: ¡

– Giorgos ¡Vassiliadis, ¡Lazaros ¡Koromilas, ¡Michalis ¡Polychronakis, ¡Spyros ¡ Antonatos, ¡Vagelis ¡Ladakis, ¡Elias ¡Athanasopoulos, ¡Evangelos ¡Markatos ¡

62 ¡ 24/10/14 ¡ CANS ¡2014 ¡