making fun of your malware - def con...explorer gets kill hup-ed shellserviceobjectdelayload yes no...

37
making fun of your malware Defcon 17 Matt Richard and Michael Ligh

Upload: others

Post on 05-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

making fun of your malware

Defcon 17Matt Richard and Michael Ligh

Page 2: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Following the presentation at Defcon 17, you can find the final slides here:

http://code.google.com/p/mhl-malware-scripts/Defcon2009_MakingFun.pdf

Page 3: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Silent Banker author forgets to seed the PRNG

Honey, I Shrunk the Entropy!

Page 4: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Off to a bad start…

Zeus, September 2007PRNG used to avoid hash-based detection

Silent Banker, Feburary 2008PRNG used to generate temporary file names

Page 5: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Recipe for disaster - step 1

Silent Banker, July 2008PRNG used to generate encryption key

Page 6: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Recipe for disaster

1. Seed the PRNG2. Generate 16 byte key with 1000 calls to rand()3. Generate 8 byte number from 16 byte key4. Generate another 8 byte number from the first 8

byte number and “secd” value from INI configuration file

5. Explode the second 8 byte number into 32 bytes

6. Encrypt stolen data with original 16 byte key from step 2

7. Send the exploded 32 byte number along with stolen data

Page 7: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Recipe to exploit the disaster

1. Seed the PRNG TO ZERO2. Generate 16 byte key with 1000 calls to rand()3. Generate 8 byte number from 16 byte key4. Generate another 8 byte number from the first 8

byte number and “secd” value from INI configuration file

5. Explode the second 8 byte number into 32 bytes

6. Encrypt stolen data with original 16 byte key from step 2

7. Send the exploded 32 byte number along with stolen data

Page 8: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Disaster recovery

Page 9: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

The one that got away…

Page 10: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Torpig installs MBR rootkit to get a DLL Injected into user-mode programs

I created a hyper cool MBR rootkit and all I got was this old trojan DLL

Page 11: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

The nasty side

Page 12: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

The funny side

Page 13: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

The nice side

Page 14: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Attacker’s trojan defaults to xordue to invalid size DES key

To DES or not to DES?

Page 15: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Always make backups!

xor backup method

Page 16: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

How to shoot yourself in the foot

Page 17: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

MSDN to the rescue

Page 18: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Conficker.B’s flawed IP generator only scans a portion of the Internet

Honey, sorry to bother you again, I shrunk the Internet

Page 19: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

The flawed method

Page 20: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

What’s the big deal?

1. Excludes multicast, private, broadcast, etc2. Excludes IPs on blacklisted subnets (researcher and A/V networks)3. Excludes any IP with an octet set to 2554. Excludes any IP with a last octet set to 05. Excludes any IP with a 1 in the upper bit of octets 2 and 4

Page 21: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Simulating the flawed method

Page 22: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

A/V vendors miss detection of $10m trojanfor 15 months because of NOOPS

Baffled by the NOOP

Page 23: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Neosploit screws everyone

Thanks for the cash, now we’re going to dash

Page 24: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Laqma arbitrary file upload

PHP cookies…mmmm…cookies

Page 25: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Coreflood authors re-invent “location dependent encryption”

You did what with what?

Page 26: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Location dependent encryption ;-)

• http://www.freepatentsonline.com/6948062.html

Page 27: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Patent pending…

Page 28: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

How to dump core

Page 29: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

How to dump core…with wireshark

Page 30: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Explorer gets KILL HUP-ed

FeebsYes NoYesShellServiceObjectDelayLoad

Torpig/Mebroot

Bankpatch

CoreFlood

Virtumonde

Conficker

Zeus

Torpig/Mebroot

Laqma

Vundo

Silent Banker

Example

YesNoNoPE patch on disk

YesNoYesShellIconOverlayIdentifier

YesYesYesWinlogon notify package

YesNoYesSvchosts.exe ServiceDll

NoNoNoLoading DLLs from kernel

NoNoNoCreateRemoteThread

NoNoYesShellExecute hooks

NoNoNoEvent hooks

NoNoNoWindows hooks

YesNoYesAppInit_DLLs

YesNoYesBrowser helper objects

Requires App restart

Requires reboot

Modifies registryMethod

Page 31: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Quietly, so no one hears

Page 32: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Arms and legs, but no head

Page 33: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Malfind vs Coreflood

Page 34: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Limbo 2

Greatest threat to 2007 to occur in 2008

Page 35: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Peeper tests code on himself

Don’t get high on your own supply

Page 36: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

Hacker’s own info stealing tool posts info to monitored site

How to steal your own identity

Page 37: Making fun of your malware - DEF CON...Explorer gets KILL HUP-ed ShellServiceObjectDelayLoad Yes No Yes Feebs Torpig/Mebroot Bankpatch CoreFlood Virtumonde Conficker Zeus Torpig/Mebroot

The End