SlideShare a Scribd company logo
4
Most read
6
Most read
10
Most read
Packet Capture on AWS
Teri Radichel | @teriradichel
https://www.sans.org/reading-room/whitepapers/detection/packet-capture-aws-37905
(A SANS Gold Paper)
Largest Security Training Organization in World…
SANS.org
What’s a packet?
• Data is split into packets or small pieces to send over the network
• Follows a protocol – the devices on both ends must understand
• Packets are reassembled at the destination, if protocol requires
• Some protocols resend failed packets (TCP) others do not (UDP)
Source DestinationNetwork
What Is Packet Capture?
• Capture the details about packets as they traverse the network.
• For example, if you have tcpdump installed can run this on mac/linux:
sudo tcpdump –x -n
• You’ll get a number of packets rolling by on your screen like this:
23:56:50.183837 ARP, Reply 192.168.1.95 is-at f4:5c:89:b6:7b:7f, length 28
0x0000: 1491 829a 0b62 f45c 89b6 7b7f 0806 0001
0x0010: 0800 0604 0002 f45c 89b6 7b7f c0a8 015f
0x0020: 1491 829a 0b62 c0a8 0101
• That’s a packet displayed in hex format (-x), and with IPs instead of
domain names (-n)
• http://www.tcpdump.org/tcpdump_man.html
Network Layers and Headers
• OSI or TCP model – network layers
• Different headers for each layer
• Example – IPv4 header
• Devices at source wrap the packet
in a headers
• Devices at the destination unwrap
the headers
http://websitenotebook.blogspot.com/2014/05/decoding-ip-header-example.html
Decoding Packets
• Packets are sent over the network in hex
• Decoding a packet header:
http://websitenotebook.blogspot.com/2014/05/decoding-ip-header-
example.html
• Hex to Binary Cheat Sheet:
• http://websitenotebook.blogspot.com/2014/05/hexadecimal-to-
binary-to-decimal-cheat.html
• Note that on AWS there are some AWS specific headers you don’t see
• https://www.youtube.com/watch?v=St3SE4LWhKo
Why do we care about packets?
• VPC Flow Logs only capture source, destination, protocol, timestamp
and a few other things; Web traffic logs only capture certain details
pertaining to web requests.
• A full packet has much more data that a other types of network logs
• Sometimes the full packet is required to resolve network issues
• Attackers obfuscate packet data to pass through security appliances
undetected – some of these attacks are only visible at packet level
• Data hidden in unused packet fields can exfiltrate data on channels in
undetected manner only visible when looking at raw packets
Captured packets can be stored and analyzed
• Many programs store packets in a format call “pcap” files
• Programs such as Wireshark can read these files and help security
professionals analyze the data
• An IDS/IPS can alert on or block packets that match nefarious
patterns (Snort, Bro, Suricata)
• Yara files can be used to match packet capture patterns and alert or
block malicious traffic
• Some devices like a WatchGuard Firebox with security services
provide this service so you don’t have to do it yourself
Typical Way to Capture Packets
• Span port on switch
“mirrors” the data
• Send packets to IDS/IPS
and/or logs
• So…how do we do this on
AWS?
• Can’t plug into the
switch…
https://wiki.wireshark.org/CaptureSetup/Ethernet
Tcpdump on every machine < 
instances
bucket
A better way…
• Route All the Packets Through Packet Capture Host(s)
• Capture host(s) must be able to receive the traffic, log it, and forward
the traffic to the destination
• Network configuration must force all packets through the capture
host(s)
• Any extraneous routes let packets bypass capture host(s)
AWS NAT Example
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html
Note that the web server
traffic would not pass
through the NAT instance
and this is typically only for
outbound traffic. We want
to capture all traffic…
NAT Architecture
Security groups
and route tables
can force all
traffic through
the NAT. NAT
instance can be
modified to
handle all traffic,
in and out.
Proxy Architecture with Load Balancing
This shows
architecture for
Squid proxy.
Squid proxy
would only
handle layer 7
traffic but we
could modify
these instances
to capture all
traffic. Load
balancing
provides scaling.
Would need to
handle inbound
and outbound. https://aws.amazon.com/articles/6463473546098546
Proxy Architecture – Peered VPCs
Instances can only talk to other instances in a directly peered VPC. A proxy will allow traffic to pass
through one VPC to another. This can be used for nefarious purposes but in our case we can
leverage this to capture as it crosses network boundaries, which could be useful. More on that in
an upcoming slide.
Packet Capture Via Security Appliance
A security appliance
designed to capture and
pass through network
traffic after analyzing it
might be a good way to
capture packets as they
traverse network
boundaries. Noticed the
network design which
separates the packet
capture functionality and
storage from the rest of
the network.
Transit VPC
We could use a transit
VPC to capture all traffic
coming into and leaving
AWS, or traversing the
network from one
account to another. This is
a very interesting idea
because not only does it
make managing
connections between
different networks easier,
it provides a way to
ensure all packets must
pass through our packet
capture architecture. https://aws.amazon.com/blogs/aws/aws-solution-transit-vpc/
POC – Capture Packets in Lambda Function
https://github.com/tradichel/PacketCaptureAWS
Here’s the POC using
WatchGuard Firebox Cloud’s
CLI command to capture
packets. Clone the code,
execute the run file and it will
ask a couple questions. You
will get this…
Note the protection of the key
in S3 with stringent bucket
policy. Could make it even
more stringent by creating the
key on the fly in AWS with no
access to it outside the AWS
network.
Packets!
Please read the paper for details. Must have packets flowing when you run the lambda to capture.
What Next? Suggestions?
• This was a POC Only!
• Lambda is short lived – would want a source that stays online
• Need to test performance over time of this solution and others
• Scalability
• Storage
• Potentially set up an open source IDS/IPS to analyze packets
• Store as PCAP
• Or store to CloudWatch and use some other type of parser to pull the
data out into PCAP or desired format
Teri Radichel |@teriradichel
https://secplicity.org

More Related Content

PPT
Secure Network Design
PDF
천만 사용자를 위한 AWS 클라우드 아키텍처 진화하기::이창수::AWS Summit Seoul 2018
PDF
20200526 AWS Black Belt Online Seminar AWS X-Ray
PPTX
EC2上でパケットをミラーリング
PDF
20200930 AWS Black Belt Online Seminar Amazon Kinesis Video Streams
PPTX
Advanced Access Management with Aruba ClearPass #AirheadsConf Italy
PDF
쉽고 빠르게 접하는 오픈스택
PPTX
Get Hands-On with NGINX and QUIC+HTTP/3
Secure Network Design
천만 사용자를 위한 AWS 클라우드 아키텍처 진화하기::이창수::AWS Summit Seoul 2018
20200526 AWS Black Belt Online Seminar AWS X-Ray
EC2上でパケットをミラーリング
20200930 AWS Black Belt Online Seminar Amazon Kinesis Video Streams
Advanced Access Management with Aruba ClearPass #AirheadsConf Italy
쉽고 빠르게 접하는 오픈스택
Get Hands-On with NGINX and QUIC+HTTP/3

What's hot (20)

PPTX
Access Management with Aruba ClearPass
PDF
AWS Summit Seoul 2023 |Datadog을 활용한 AWS 서버리스 Observability
PPTX
Access Control authentication and authorization .pptx
PPTX
Traditional Firewall vs. Next Generation Firewall
PDF
20190911 AWS Black Belt Online Seminar AWS Batch
PDF
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
PPT
OpenVPN
PDF
Technical Approach to Red Team Operations
PDF
ClearPass Overview
PDF
SDN입문 (Overlay and Underlay)
PPTX
AmazonのDNSサービス Amazon Route 53の使いかたと裏側
PDF
AWS Black Belt Techシリーズ AWS Management Console
PPTX
Azure AD による Web API の 保護
PDF
Support formation vidéo : Cisco CCNA Routing & Switching - Examen (200-125) (2)
PDF
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
PPTX
Web Servers(IIS, NGINX, APACHE)
PDF
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
PPTX
あなたのところに専用線が届くまで
PPTX
Managing enterprise users in Hadoop ecosystem
PPTX
ClearPass design scenarios that solve the toughest security policy requirements
Access Management with Aruba ClearPass
AWS Summit Seoul 2023 |Datadog을 활용한 AWS 서버리스 Observability
Access Control authentication and authorization .pptx
Traditional Firewall vs. Next Generation Firewall
20190911 AWS Black Belt Online Seminar AWS Batch
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
OpenVPN
Technical Approach to Red Team Operations
ClearPass Overview
SDN입문 (Overlay and Underlay)
AmazonのDNSサービス Amazon Route 53の使いかたと裏側
AWS Black Belt Techシリーズ AWS Management Console
Azure AD による Web API の 保護
Support formation vidéo : Cisco CCNA Routing & Switching - Examen (200-125) (2)
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
Web Servers(IIS, NGINX, APACHE)
AWSを含めたハイブリッド環境の監視の実現 ~zabbixのクラウド対応モジュールHyClops~
あなたのところに専用線が届くまで
Managing enterprise users in Hadoop ecosystem
ClearPass design scenarios that solve the toughest security policy requirements
Ad

Similar to Packet Capture on AWS (20)

PDF
Common Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
DOCX
Experiment 7 traffic analysis
PDF
Cassandra To Infinity And Beyond
PDF
CloudStack - LinuxFest NorthWest
PPTX
Securing management, control & data plane
PDF
Hands on with CoAP and Californium
PDF
Apache Stratos tutorial WSO2Con Europe-2014
PDF
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
PPT
PowerPoint Presentation
PDF
IDS Evasion Techniques
PDF
Cloud Networking is not Virtual Networking - London VMUG 20130425
PPTX
Wireshark
PDF
Advanced use cases and approaches with stratos paa s
PDF
Reach: Solving AWS Networking Problems Faster
PDF
AWS BaseCamp: AWS Architecture Fundamentals
PDF
Securing & Enforcing Network Policy and Encryption with Weave Net
PPTX
AWS Best Practices Version 2
PPTX
Introduction to ns3
PPTX
AWS Best Practices
DOCX
Networking answers
Common Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
Experiment 7 traffic analysis
Cassandra To Infinity And Beyond
CloudStack - LinuxFest NorthWest
Securing management, control & data plane
Hands on with CoAP and Californium
Apache Stratos tutorial WSO2Con Europe-2014
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
PowerPoint Presentation
IDS Evasion Techniques
Cloud Networking is not Virtual Networking - London VMUG 20130425
Wireshark
Advanced use cases and approaches with stratos paa s
Reach: Solving AWS Networking Problems Faster
AWS BaseCamp: AWS Architecture Fundamentals
Securing & Enforcing Network Policy and Encryption with Weave Net
AWS Best Practices Version 2
Introduction to ns3
AWS Best Practices
Networking answers
Ad

More from 2nd Sight Lab (20)

PPTX
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
PPTX
Cross-Cloud Comparison and Security Notes
PPTX
Threat Modeling a Batch Job System - AWS Security Community Day
PPTX
Azure Security - Day6 - Operations And Risk
PPTX
Azure Security - Day5 - Governance And Architecture
PPTX
AzureSecurity Day4 Compute And Application Service Security
PPTX
AzureSecurity - Day3 - Storage And Key Vault
PPTX
AzureSecurity - Day2 - Azure Network Security
PPTX
AzureSecurity Day1: Identity and Access Management
PPTX
So You Want a Job in Cybersecurity
PPTX
Cloud Offense Informs Cloud Defense.pptx
PPTX
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
PPTX
Real World Cloud Compromise
PPTX
Serverless Attack Vectors
PPTX
Top Priorities for Cloud Application Security
PPTX
Azure for Auditors
PPTX
How the Cloud Changes Cyber Security
PPTX
Are you ready for a cloud pentest? AWS re:Inforce 2019
PPTX
Are You Ready for a Cloud Pentest?
PPTX
Red Team vs. Blue Team on AWS ~ re:Invent 2018
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Cross-Cloud Comparison and Security Notes
Threat Modeling a Batch Job System - AWS Security Community Day
Azure Security - Day6 - Operations And Risk
Azure Security - Day5 - Governance And Architecture
AzureSecurity Day4 Compute And Application Service Security
AzureSecurity - Day3 - Storage And Key Vault
AzureSecurity - Day2 - Azure Network Security
AzureSecurity Day1: Identity and Access Management
So You Want a Job in Cybersecurity
Cloud Offense Informs Cloud Defense.pptx
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
Real World Cloud Compromise
Serverless Attack Vectors
Top Priorities for Cloud Application Security
Azure for Auditors
How the Cloud Changes Cyber Security
Are you ready for a cloud pentest? AWS re:Inforce 2019
Are You Ready for a Cloud Pentest?
Red Team vs. Blue Team on AWS ~ re:Invent 2018

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
cuic standard and advanced reporting.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
KodekX | Application Modernization Development
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
cuic standard and advanced reporting.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx
Chapter 3 Spatial Domain Image Processing.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
KodekX | Application Modernization Development
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
sap open course for s4hana steps from ECC to s4
“AI and Expert System Decision Support & Business Intelligence Systems”
Digital-Transformation-Roadmap-for-Companies.pptx

Packet Capture on AWS

  • 1. Packet Capture on AWS Teri Radichel | @teriradichel https://www.sans.org/reading-room/whitepapers/detection/packet-capture-aws-37905 (A SANS Gold Paper)
  • 2. Largest Security Training Organization in World… SANS.org
  • 3. What’s a packet? • Data is split into packets or small pieces to send over the network • Follows a protocol – the devices on both ends must understand • Packets are reassembled at the destination, if protocol requires • Some protocols resend failed packets (TCP) others do not (UDP) Source DestinationNetwork
  • 4. What Is Packet Capture? • Capture the details about packets as they traverse the network. • For example, if you have tcpdump installed can run this on mac/linux: sudo tcpdump –x -n • You’ll get a number of packets rolling by on your screen like this: 23:56:50.183837 ARP, Reply 192.168.1.95 is-at f4:5c:89:b6:7b:7f, length 28 0x0000: 1491 829a 0b62 f45c 89b6 7b7f 0806 0001 0x0010: 0800 0604 0002 f45c 89b6 7b7f c0a8 015f 0x0020: 1491 829a 0b62 c0a8 0101 • That’s a packet displayed in hex format (-x), and with IPs instead of domain names (-n) • http://www.tcpdump.org/tcpdump_man.html
  • 5. Network Layers and Headers • OSI or TCP model – network layers • Different headers for each layer • Example – IPv4 header • Devices at source wrap the packet in a headers • Devices at the destination unwrap the headers http://websitenotebook.blogspot.com/2014/05/decoding-ip-header-example.html
  • 6. Decoding Packets • Packets are sent over the network in hex • Decoding a packet header: http://websitenotebook.blogspot.com/2014/05/decoding-ip-header- example.html • Hex to Binary Cheat Sheet: • http://websitenotebook.blogspot.com/2014/05/hexadecimal-to- binary-to-decimal-cheat.html • Note that on AWS there are some AWS specific headers you don’t see • https://www.youtube.com/watch?v=St3SE4LWhKo
  • 7. Why do we care about packets? • VPC Flow Logs only capture source, destination, protocol, timestamp and a few other things; Web traffic logs only capture certain details pertaining to web requests. • A full packet has much more data that a other types of network logs • Sometimes the full packet is required to resolve network issues • Attackers obfuscate packet data to pass through security appliances undetected – some of these attacks are only visible at packet level • Data hidden in unused packet fields can exfiltrate data on channels in undetected manner only visible when looking at raw packets
  • 8. Captured packets can be stored and analyzed • Many programs store packets in a format call “pcap” files • Programs such as Wireshark can read these files and help security professionals analyze the data • An IDS/IPS can alert on or block packets that match nefarious patterns (Snort, Bro, Suricata) • Yara files can be used to match packet capture patterns and alert or block malicious traffic • Some devices like a WatchGuard Firebox with security services provide this service so you don’t have to do it yourself
  • 9. Typical Way to Capture Packets • Span port on switch “mirrors” the data • Send packets to IDS/IPS and/or logs • So…how do we do this on AWS? • Can’t plug into the switch… https://wiki.wireshark.org/CaptureSetup/Ethernet
  • 10. Tcpdump on every machine <  instances bucket
  • 11. A better way… • Route All the Packets Through Packet Capture Host(s) • Capture host(s) must be able to receive the traffic, log it, and forward the traffic to the destination • Network configuration must force all packets through the capture host(s) • Any extraneous routes let packets bypass capture host(s)
  • 12. AWS NAT Example http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html Note that the web server traffic would not pass through the NAT instance and this is typically only for outbound traffic. We want to capture all traffic…
  • 13. NAT Architecture Security groups and route tables can force all traffic through the NAT. NAT instance can be modified to handle all traffic, in and out.
  • 14. Proxy Architecture with Load Balancing This shows architecture for Squid proxy. Squid proxy would only handle layer 7 traffic but we could modify these instances to capture all traffic. Load balancing provides scaling. Would need to handle inbound and outbound. https://aws.amazon.com/articles/6463473546098546
  • 15. Proxy Architecture – Peered VPCs Instances can only talk to other instances in a directly peered VPC. A proxy will allow traffic to pass through one VPC to another. This can be used for nefarious purposes but in our case we can leverage this to capture as it crosses network boundaries, which could be useful. More on that in an upcoming slide.
  • 16. Packet Capture Via Security Appliance A security appliance designed to capture and pass through network traffic after analyzing it might be a good way to capture packets as they traverse network boundaries. Noticed the network design which separates the packet capture functionality and storage from the rest of the network.
  • 17. Transit VPC We could use a transit VPC to capture all traffic coming into and leaving AWS, or traversing the network from one account to another. This is a very interesting idea because not only does it make managing connections between different networks easier, it provides a way to ensure all packets must pass through our packet capture architecture. https://aws.amazon.com/blogs/aws/aws-solution-transit-vpc/
  • 18. POC – Capture Packets in Lambda Function https://github.com/tradichel/PacketCaptureAWS Here’s the POC using WatchGuard Firebox Cloud’s CLI command to capture packets. Clone the code, execute the run file and it will ask a couple questions. You will get this… Note the protection of the key in S3 with stringent bucket policy. Could make it even more stringent by creating the key on the fly in AWS with no access to it outside the AWS network.
  • 19. Packets! Please read the paper for details. Must have packets flowing when you run the lambda to capture.
  • 20. What Next? Suggestions? • This was a POC Only! • Lambda is short lived – would want a source that stays online • Need to test performance over time of this solution and others • Scalability • Storage • Potentially set up an open source IDS/IPS to analyze packets • Store as PCAP • Or store to CloudWatch and use some other type of parser to pull the data out into PCAP or desired format