reverse engineering malware: a look inside operation tovar

56
Reverse Engineering Malware: A look inside Operation Tovar Brandon Tansey Security Researcher, Lancope © 2014 Lancope, Inc. All rights reserved. 1

Upload: lancope-inc

Post on 15-Jan-2015

740 views

Category:

Technology


1 download

DESCRIPTION

Join us as we step through the reverse engineering of CryptoLocker, identifying important functionality and weaknesses. We'll demonstrate how we were able to use this information to help protect our customers months ago, the weaknesses that the Department of Justice took advantage of, and how you can do the same for other types of malware down the line.

TRANSCRIPT

Page 1: Reverse Engineering Malware: A look inside Operation Tovar

1

Reverse Engineering Malware: A look inside Operation TovarBrandon TanseySecurity Researcher, Lancope

© 2014 Lancope, Inc. All rights reserved.

Page 2: Reverse Engineering Malware: A look inside Operation Tovar

2© 2014 Lancope, Inc. All rights reserved.

Source: 2014 Verizon DBIR

Page 3: Reverse Engineering Malware: A look inside Operation Tovar

3© 2014 Lancope, Inc. All rights reserved.

75% of malware contained functionality of spyware/keyloggers

55% of malware automatically collected pre-existing data on victim computers

Source: 2013 Verizon DBIR

Page 4: Reverse Engineering Malware: A look inside Operation Tovar

4© 2014 Lancope, Inc. All rights reserved.

All malware leaves behind some information of its own

Page 5: Reverse Engineering Malware: A look inside Operation Tovar

5© 2014 Lancope, Inc. All rights reserved.

Malware Analysis

Page 6: Reverse Engineering Malware: A look inside Operation Tovar

6

• Command and control hosts• Encryption keys• Implementation flaws• Exploits• Malware capabilities• …

© 2014 Lancope, Inc. All rights reserved.

What information is there to find?

Page 7: Reverse Engineering Malware: A look inside Operation Tovar

7© 2014 Lancope, Inc. All rights reserved.

What information do you need?

Page 8: Reverse Engineering Malware: A look inside Operation Tovar

8© 2014 Lancope, Inc. All rights reserved.

Page 9: Reverse Engineering Malware: A look inside Operation Tovar

9© 2014 Lancope, Inc. All rights reserved.

Page 10: Reverse Engineering Malware: A look inside Operation Tovar

10© 2014 Lancope, Inc. All rights reserved.

Dynamic Analysis vs. Static Analysis

Page 11: Reverse Engineering Malware: A look inside Operation Tovar

11© 2014 Lancope, Inc. All rights reserved.

Initialization1. Start the malware

Page 12: Reverse Engineering Malware: A look inside Operation Tovar

12© 2014 Lancope, Inc. All rights reserved.

Initialization1. Start the malware

2. Malware loads RSAenh.dll (Microsoft Enhanced Cryptographic Provider)

Page 13: Reverse Engineering Malware: A look inside Operation Tovar

13© 2014 Lancope, Inc. All rights reserved.

Establishing Persistence3. Copy self to Application Data

Page 14: Reverse Engineering Malware: A look inside Operation Tovar

14© 2014 Lancope, Inc. All rights reserved.

Establishing Persistence3. Copy self to Application Data

4. Open second process

Page 15: Reverse Engineering Malware: A look inside Operation Tovar

15© 2014 Lancope, Inc. All rights reserved.

Establishing Persistence5. Maintain auto-start registry keys

Page 16: Reverse Engineering Malware: A look inside Operation Tovar

16© 2014 Lancope, Inc. All rights reserved.

Reaching Out6. Make network calls

Page 17: Reverse Engineering Malware: A look inside Operation Tovar

17© 2014 Lancope, Inc. All rights reserved.

Reaching Out6. Make network calls

7. Start looking for command and control hosts

Page 18: Reverse Engineering Malware: A look inside Operation Tovar

18© 2014 Lancope, Inc. All rights reserved.

Page 19: Reverse Engineering Malware: A look inside Operation Tovar

19© 2014 Lancope, Inc. All rights reserved.

Establish C2

8. Find valid C2 host

Page 20: Reverse Engineering Malware: A look inside Operation Tovar

20© 2014 Lancope, Inc. All rights reserved.

Compromise9. Store public key

Page 21: Reverse Engineering Malware: A look inside Operation Tovar

21© 2014 Lancope, Inc. All rights reserved.

Compromise9. Store public key

10. Scan and encrypt files

Page 22: Reverse Engineering Malware: A look inside Operation Tovar

22© 2014 Lancope, Inc. All rights reserved.

Page 23: Reverse Engineering Malware: A look inside Operation Tovar

23© 2014 Lancope, Inc. All rights reserved.

Close loop11. Log encrypted files and start over

Page 24: Reverse Engineering Malware: A look inside Operation Tovar

24© 2014 Lancope, Inc. All rights reserved.

Page 25: Reverse Engineering Malware: A look inside Operation Tovar

25

• Takes advantage of advanced public key crypto– RSAenh.dll– PublicKey registry key

• Loops through DNS requests for tons of gibberish hosts until it finds active, real one– All samples appear to create the same domains

• Does not begin encrypting until it receives public key from C2 server

© 2014 Lancope, Inc. All rights reserved.

What do we think we know?

Page 26: Reverse Engineering Malware: A look inside Operation Tovar

26© 2014 Lancope, Inc. All rights reserved.

Static Analysis

Page 27: Reverse Engineering Malware: A look inside Operation Tovar

27© 2014 Lancope, Inc. All rights reserved.

Page 28: Reverse Engineering Malware: A look inside Operation Tovar

28© 2014 Lancope, Inc. All rights reserved.

Page 29: Reverse Engineering Malware: A look inside Operation Tovar

29© 2014 Lancope, Inc. All rights reserved.

Page 30: Reverse Engineering Malware: A look inside Operation Tovar

30© 2014 Lancope, Inc. All rights reserved.

Source: microsoft.com

Page 31: Reverse Engineering Malware: A look inside Operation Tovar

31© 2014 Lancope, Inc. All rights reserved.

Page 32: Reverse Engineering Malware: A look inside Operation Tovar

32© 2014 Lancope, Inc. All rights reserved.

Page 33: Reverse Engineering Malware: A look inside Operation Tovar

33© 2014 Lancope, Inc. All rights reserved.

Page 34: Reverse Engineering Malware: A look inside Operation Tovar

34© 2014 Lancope, Inc. All rights reserved.

Page 35: Reverse Engineering Malware: A look inside Operation Tovar

35© 2014 Lancope, Inc. All rights reserved.

Page 36: Reverse Engineering Malware: A look inside Operation Tovar

36© 2014 Lancope, Inc. All rights reserved.

Page 37: Reverse Engineering Malware: A look inside Operation Tovar

37© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 38: Reverse Engineering Malware: A look inside Operation Tovar

38© 2014 Lancope, Inc. All rights reserved.

Operation Tovar

Page 39: Reverse Engineering Malware: A look inside Operation Tovar

39© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 40: Reverse Engineering Malware: A look inside Operation Tovar

40© 2014 Lancope, Inc. All rights reserved.

Operational Security(OPSEC)

Source: archive.gov

Page 41: Reverse Engineering Malware: A look inside Operation Tovar

41© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 42: Reverse Engineering Malware: A look inside Operation Tovar

42© 2014 Lancope, Inc. All rights reserved.

“In cooperation with Luxembourg law enforcement agencies, pursuant to an

MLAT request, the FBI analyzed the contents of [second level Cryptolocker]

server, discovering HTTP access logs that showed which users were accessing this

server.”

Source: justice.gov

Page 43: Reverse Engineering Malware: A look inside Operation Tovar

43© 2014 Lancope, Inc. All rights reserved.

“This consistent pattern of overlapping IP addresses and user agent strings establishes

that Bogachev was the individual utilizing and managing the [Gameover] infrastructure.

Moreover, the fact that Bogachev had elevated Administrative access to the critical UK GOZ

server establishes that he is not only a participant in the GOZ conspiracy, but a

leader.” Source: justice.gov

Page 44: Reverse Engineering Malware: A look inside Operation Tovar

44© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 45: Reverse Engineering Malware: A look inside Operation Tovar

45© 2014 Lancope, Inc. All rights reserved.

Tovar Time-out!

Page 46: Reverse Engineering Malware: A look inside Operation Tovar

46© 2014 Lancope, Inc. All rights reserved.

Source: virustotal.com

Page 47: Reverse Engineering Malware: A look inside Operation Tovar

47© 2014 Lancope, Inc. All rights reserved.

Source: blackhat.com

Library of SpartaTom Cross, David Raymond, Greg Conti

Wednesday, August 5th at 10:15am

Page 48: Reverse Engineering Malware: A look inside Operation Tovar

48© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 49: Reverse Engineering Malware: A look inside Operation Tovar

49© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 50: Reverse Engineering Malware: A look inside Operation Tovar

50© 2014 Lancope, Inc. All rights reserved.

Source: justice.gov

Page 51: Reverse Engineering Malware: A look inside Operation Tovar

51© 2014 Lancope, Inc. All rights reserved.

Page 52: Reverse Engineering Malware: A look inside Operation Tovar

52© 2014 Lancope, Inc. All rights reserved.

Page 53: Reverse Engineering Malware: A look inside Operation Tovar

53

• YOUR FAVORITE SEARCH ENGINE!• Process Monitor (SysInternals)• Wireshark• Inetsim (via Remnux)• IDA Pro (alt. IDA shareware, radare, Hopper, objdump)

© 2014 Lancope, Inc. All rights reserved.

Tools

Page 54: Reverse Engineering Malware: A look inside Operation Tovar

54

• OpenSecurityTraining.info• Practical Malware Analysis (Michael Sikorski and Andrew Honig)• The IDA Pro Book (Chris Eagle)

<shamelessPlug>• http://lancope.com/blog• https://twitter.com/stealth_labs• https://twitter.com/lancope</shamelessPlug>

© 2014 Lancope, Inc. All rights reserved.

Want to learn more?

Page 55: Reverse Engineering Malware: A look inside Operation Tovar

55

THANK YOU

© 2014 Lancope, Inc. All rights reserved.

Brandon TanseySecurity [email protected]

Page 56: Reverse Engineering Malware: A look inside Operation Tovar

56© 2014 Lancope, Inc. All rights reserved.