Top Banner
Honeypots for Active Defense A Practical Guide to Honeynets within the Enterprise Greg Foss SecOps Lead / Senior Researcher @heinzarelli
71
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Honeypots for Active Defense

Honeypots for Active DefenseA Practical Guide to Honeynets within the Enterprise

Greg Foss SecOps Lead / Senior Researcher @heinzarelli

Page 2: Honeypots for Active Defense

# whoami

Greg Foss

SecOps Team Lead

Sr. Security Research Engineer

OSCP, GAWN, GPEN, GWAPT, GCIH, CEH, CYBER APT

Page 3: Honeypots for Active Defense

Traditional Defensive Concepts

• Maintain a tough perimeter

• Implement layered security controls

• Block known attacks and ban malicious IP’s

• Create and enforce policy to discourage misuse

Page 4: Honeypots for Active Defense

…cross our fingers

Page 5: Honeypots for Active Defense

InfoSec Realities• There is no magic security product that

will protect you or your company. Period.

• It’s when, not if — there’s always a way in…

Page 6: Honeypots for Active Defense

Not Just ‘APTs’

Page 7: Honeypots for Active Defense

Active Defense

Page 8: Honeypots for Active Defense

What is ‘Active Defense’• All comes down to tipping the odds in our

favor as defenders…

• Annoying the attacker

• Trapping them and wasting time

• Gather data + attempt attribution

• ‘Attacking Back’

• Reduce the MTTD and MTTR

• MTTD => Mean-Time-to-Detect

• MTTR => Mean-Time-to-Respond

Page 9: Honeypots for Active Defense
Page 10: Honeypots for Active Defense

Why Internal Honeypots?

• Easy to configure, deploy, and maintain

• Fly traps for anomalous activity

• They don’t even need to look legit once breached… Just enough to raise a flag.

• You will learn a ton about your adversaries. Information that will help in the future…

• *Honeypots are something to focus on after the basics have been taken care of.

Page 11: Honeypots for Active Defense

Honeypot Use Cases

• Research

• Understand how attackers think, what works, what doesn’t, and what they are after.

• Defense

• Learn from the adversary and adapt… Lay traps to catch subtle yet abnormal activities.

Page 12: Honeypots for Active Defense

Defense

Page 13: Honeypots for Active Defense

VM’s

ADHD

http://sourceforge.net/projects/adhd/

Honey Drive 3

http://sourceforge.net/projects/honeydrive/

Page 14: Honeypots for Active Defense

First things first…• Honeypots and Active Defense come after

baseline security controls are in place.

• Warning banners are critical and assist in the event prosecution is necessary / desired.

Page 15: Honeypots for Active Defense

Types of Honeypots

No Interaction

Low Interaction

Medium Interaction

High Interaction

Honey Tokens / Drives / Strings / Etc.

*note - this is my interpretation, not necessarily ‘industry standard’

Page 16: Honeypots for Active Defense

No Interaction Honeypots

Primarily referred to as Honeyports, or services that simply log and/or ban on full TCP connect.

Page 17: Honeypots for Active Defense

‘No Interaction’ Honeypots• Basic Honeyports

• Linux - NetCat and IPTables

• Windows - NetCat and Netsh

• Python and PowerShell options as well…

Page 18: Honeypots for Active Defense

Windows PowerShell Honeyports

Page 19: Honeypots for Active Defense

Windows PowerShell Honeyports

Page 20: Honeypots for Active Defense

Linux Honeyports• Artillery — supports Windows too!

• https://www.trustedsec.com/downloads/artillery/

Page 21: Honeypots for Active Defense

Artillery Logging• Port Scanning and/or Illegitimate Service Access

• Local Syslog, Flat File, or Remote Syslog options

• IP’s are added to the banlist and blocked locally via IPTables

Page 22: Honeypots for Active Defense

Artillery Logging Bonus!• File Integrity Monitoring

Page 23: Honeypots for Active Defense
Page 24: Honeypots for Active Defense

Low Interaction Honeypots

Honeypots that serve up basic content and are not interactive once breached.

Page 25: Honeypots for Active Defense

WordPot• https://github.com/gbrindisi/wordpot

• Fake WordPress app, written in Python…

Page 26: Honeypots for Active Defense

Fake PhpMyAdmin• https://github.com/gfoss/phpmyadmin_honeypot

• Simple fake phpmyadmin ‘app’ that logs to flat files. This same approach can be applied to anything…

Page 27: Honeypots for Active Defense

$any fake login panel• Custom - but believable and hidden from normal

users

• Can be used in ‘reverse phishing’ — discussing later…

Page 28: Honeypots for Active Defense

$any fake login panel• Logging attacker data is standard, what if you

need evidence that is a bit more tangible…

Page 29: Honeypots for Active Defense

Honeybadger• https://bitbucket.org/LaNMaSteR53/honeybadger/

• Gain *true attribution on your adversaries…

Page 30: Honeypots for Active Defense
Page 31: Honeypots for Active Defense

Medium Interaction Honeypots

Interactive honeypots that resemble real services and provide limited functionality once breached.

Page 32: Honeypots for Active Defense

Medium Interaction Honeypots

• TONS! But one of my favorites:

• https://github.com/desaster/kippo

• https://github.com/gfoss/kippo

• Simulate SSH Service…

Page 33: Honeypots for Active Defense

Kippo• Python script which simulates an SSH service that is

highly customizable, portable, and adaptable.

• Logs to flat files and stores the full TTY session for each connection, so that attacks can be replayed in real-time.

• One of the more popular honeypots out there, as a result, attackers know how to differentiate between this and a real Linux host very quickly. Be cautious…

• When deploying externally, there is a risk of CnC’s maintaining persistent connections.

• Can be used as a pentest tool as well :-)

Page 34: Honeypots for Active Defense
Page 35: Honeypots for Active Defense

Kippo Alert Automation

https://github.com/gfoss/kippo/blob/master/replay-alert.sh

Page 36: Honeypots for Active Defense

High Interaction Honeypots

Imitate real systems or modify real hosts to act as honeypots in order to verbosely log attacker activity and capture all network and related flow data.

Page 37: Honeypots for Active Defense
Page 38: Honeypots for Active Defense

Analysis Tools• LogRhythm Network Monitor and SIEM

• Suricata IDS

• http://suricata-ids.org/download/

• BRO IDS

• https://www.bro.org/

• Cuckoo Sandbox

• http://www.cuckoosandbox.org/

Page 39: Honeypots for Active Defense

Routers and Switches• ROMAN Hunter - Router Man Hunter

• http://sourceforge.net/projects/romanhunter/

• Configure real AP as a honeypot

• Capture MAC of attacker that bypasses security

• Correlate the MAC and add it to anorganizational blacklist…

Page 40: Honeypots for Active Defense

High Interaction Warning!

• Deploying real systems / devices / services is dangerous and requires dedicated monitoring.

• Whenever hosts can actually be compromised there is huge risk if not monitored appropriately.

• Never use the organization’s gold-standard image for the honeypot.

• Segment these hosts from the production network!

Page 41: Honeypots for Active Defense

Honey Tokens and Document Bugging

Tracking file access, modification, exfiltration, etc…

Page 42: Honeypots for Active Defense

File Integrity Monitoring

Page 43: Honeypots for Active Defense

Honey Tokens• Use file integrity monitoring to track all

interactions with files/folders/etc of interest. Great for network shares.

• Not just files, this can be strings, drives, directories, etc.

• Any predefined item that will generate a log when accessed/modified/etc.

• Trivial to configure…

Page 44: Honeypots for Active Defense

Document Bugging• WebBug How To:

• http://ha.ckers.org/webbug.html

• WebBug Server:

• https://bitbucket.org/ethanr/webbugserver

• Bugged Files - Is your Document Telling on You?

• Daniel Crowley + Damon Smith

• https://www.youtube.com/watch?v=co1gFikKLpA

Page 45: Honeypots for Active Defense

Document Tracking• Same tricks used by Marketing for years,

normally for tracking emails.

• Why loading externalimages within email is risky…

Page 46: Honeypots for Active Defense

Document Tracking• Documents can be tracked in the same way as email /

web.

• Automating the process…

• https://github.com/gfoss/misc/tree/master/Bash/webbug

Page 47: Honeypots for Active Defense

Document Tracking Issues• If the document is opened up offline it will

divulge information about the tracking service.

• *There is no telling how someone will react once it is discovered that they were being tracked…

Page 48: Honeypots for Active Defense

Screwing with Attackers• Reverse Phishing and ‘Attacking Back’

• A casestudy…

Page 49: Honeypots for Active Defense
Page 50: Honeypots for Active Defense
Page 51: Honeypots for Active Defense
Page 52: Honeypots for Active Defense
Page 53: Honeypots for Active Defense
Page 54: Honeypots for Active Defense
Page 55: Honeypots for Active Defense
Page 56: Honeypots for Active Defense
Page 57: Honeypots for Active Defense

• Zip Bombs

• http://unforgettable.dk - 42.zip

• BeEF - Browser Exploitation Framework

• http://beefproject.com/

• USB Killer

• http://kukuruku.co/hub/diy/usb-killer

• Clippy!

• http://www.irongeek.com/i.php?page=security/phpids-install-notes

More Tricks

Page 58: Honeypots for Active Defense

cat /dev/random | nc -nl 22

Page 59: Honeypots for Active Defense

https://github.com/nitram509/ascii-telnet-server

ASCII Art Distraction

Page 60: Honeypots for Active Defense

Monitoring• Dedicated SOC - Security Operations Center

• SIEM - Security Information Event Management

• Correlate and Track Events

• Evaluate Impact on the Real Environment

• Measure Risk and Actively Respond to Threats

• IDS, Network Flow Analysis, Firewalls, etc.

• Configure once and it’s smooth sailing from there…

Page 61: Honeypots for Active Defense

Enterprise Threat Intelligence• Develop Context-Aware Threat Intelligence

• Leverage knowledge gained from attackers to create IOC’s and custom IDS and SIEM rules…

Page 62: Honeypots for Active Defense

Event Correlation

Page 63: Honeypots for Active Defense

Automating Response• Dynamic Honeypotting

• Deploy PowerShell and Command Line Logging

• http://www.slideshare.net/Hackerhurricane/ask-aalware-archaeologist/25

Page 64: Honeypots for Active Defense

Automating Response• Google Rapid Response - GRR

• https://github.com/google/grr

• Netflix FIDO

• https://github.com/Netflix/Fido

• Kansa

• https://github.com/davehull/Kansa

• Power Forensics

• https://github.com/Invoke-IR/PowerForensics

Page 65: Honeypots for Active Defense

1 PowerShell Script

Live Data Acquisition and Incident Response

Integrates into Existing Security Processes

Remote Forensic Acquisition

Host and User Lockdown

https://github.com/gfoss/PSRecon/

Page 66: Honeypots for Active Defense
Page 67: Honeypots for Active Defense

Bringing it all together…

Page 68: Honeypots for Active Defense

Honeypot Dashboards• HoneyDrive3 comes complete with

dashboards and enhancement scripts to display interesting data.

• Kippo Graph

• http://bruteforce.gr/kippo-graph

• The Modern Honey Network - can also deploy!

• https://threatstream.com/blog/mhn-modern-honey-network

• LogRhythm SIEM - Honeypot Analytics Suite

Page 69: Honeypots for Active Defense
Page 70: Honeypots for Active Defense

Works Cited & Recommended Reading

• Strand, John, and Asadoorian, Paul. Offensive Countermeasures: The Art of Active Defense. 2013.

• Murdoch, D. W. Blue Team Handbook: Incident Response Edition: A Condensed Field Guide for the Cyber Security Incident Responder. United States: CreateSpace Independent, 2014.

• Chuvakin, Anton, and Kevin Schmidt. Logging and Log Management: The Authoritative Guide to Dealing with Syslog, Audit Logs, Events, Alerts and Other IT 'noise' Rockland, MA: Syngress, 2012.

• Bodmer, Sean. Reverse Deception: Organized Cyber Threat Counter-exploitation. N.p.: n.p., n.d. Print.

Page 71: Honeypots for Active Defense

Thank You!

Questions?

https://github.com/gfoss/

Greg Foss OSCP, GAWN, GPEN, GWAPT, GCIH, CEH

SecOps Lead / Sr. Researchergreg.foss[at]LogRhythm.com

@heinzarelli