Lecture-9 Deep Packet Inspection
Lecture-9 Deep Packet Inspection
• Program :
• Faculty of Artificial Intelligence
Discussion for "Deep
Packet Inspection
(DPI)"
1. What is Deep Packet Inspection (DPI)?
Deep Packet Inspection (DPI) is an advanced
method of analyzing and managing network
traffic. Unlike basic packet analysis, which
focuses on headers, DPI inspects the payload of
Deep Packet
data packets. This deeper level of analysis allows
it to detect and block hidden threats, enforce
policies, and optimize network performance.
Policy Enforcement:
Blocks unauthorized applications, such as peer-to-peer file sharing or unauthorized
cloud services.
Data Leak Prevention:
Detects and prevents the transmission of sensitive information, such as Social
Security Numbers or credit card data.
Application Control:
Monitors and controls application usage, ensuring compliance with
organizational policies.
4.Ethical
Considerations of DPI
While DPI is a powerful tool for securing networks, it
raises significant ethical and legal concerns:
• •Privacy Concerns:
• DPI inspects packet payloads, potentially exposing private user
information, such as emails, browsing habits, or personal data.
• Example: Inspecting encrypted web traffic could inadvertently
reveal sensitive information like passwords or financial
transactions.
•Potential for Abuse:
• DPI can be misused for mass surveillance, censorship, or targeted
monitoring.
• Governments or organizations may use DPI to monitor user
behavior beyond legitimate security needs.
Transparency and
Consent
• Legal Implications:
• DPI must comply with data protection
laws, such as GDPR, HIPAA, or other
jurisdiction-specific regulations.
• Unauthorized use of DPI can lead to legal
liabilities.
5. Balancing Security and Ethics
in DPI
Best Practices for Ethical DPI
Example of Ethical DPI Use:
Implementation:
1.Transparency: Clearly • A financial institution using DPI to
communicate to users why and how detect data exfiltration attempts but
DPI is being used. avoiding inspection of personal
2.Minimization: Inspect only what is email content unless flagged by
necessary to meet security goals. specific security rules.
3.Data Protection: Encrypt and
anonymize captured data wherever
possible.
4.Legal Compliance: Ensure all DPI
operations adhere to applicable laws
and regulations.
5.Access Control: Restrict access to
DPI logs to authorized personnel
only.
6. Challenges in DPI
Implementation
Encrypted • The increasing use of HTTPS and encrypted protocols limits
DPI’s ability to inspect payloads.
Traffic: • Solution: Employ TLS decryption or rely on metadata analysis.
Positives:
• Solution: Refine rules and signatures regularly to reduce false
positives.
Discussion for
"Encrypted Traffic
Challenges"
1. The Rise of Encrypted Traffic
Certificate Management:
• Mismanaged or outdated certificates can disrupt
decryption workflows.
• Solution: Automate certificate renewal and
management processes.
Wireshark:
• Configure to decrypt HTTPS traffic using server
private keys or pre-shared keys for SSL/TLS.
7. Tools for • Example: Load private keys in Wireshark to
TLS inspect decrypted traffic.
Decryption Zeek (Bro):
and Encrypted
• Monitors encrypted traffic and provides insights
Traffic into metadata and flow patterns.
Analysis
Security Appliances:
• Firewalls and intrusion prevention systems (IPS)
with built-in TLS decryption capabilities.
Analyzing
• Requests to newly registered or uncommon domains.
• Domains hosted in regions known for cybercrime
activity.
Flows in a • Indicators:
• Redirects to multiple domains, often ending on a
Phishing
fraudulent login page.
• POST requests containing sensitive information (e.g.,
credentials).
Campaign
traffic generated when the attachment is executed.
• Indicators:
• Connection to Command-and-Control (C2) servers.
• Download of additional malware payloads.
3. Tracing
the
Attacker's
IP and
Server
3. Tracing the Attacker's IP and
Server
•Packet analysis provides crucial insights for tracing the origin of a phishing
attack:
• Step 1: Source IP Address
• Analyze packet headers to extract the source IP address of traffic
initiated by the phishing link or attachment.
• Tools like Wireshark can display this in the packet details.
• Step 2: Geolocate the IP Address
• Use IP geolocation tools (e.g., MaxMind, IP2Location) to determine
the approximate physical location of the attacker or their
infrastructure.
• Note: Attackers often use proxies or VPNs to obscure their real
location.
3. Tracing the Attacker's IP and
Server
• Step 3: Analyze Server Hosting
• Use tools like WHOIS to gather information about the domain and its hosting
provider.
• Indicators:
• Recently registered domains.
• Hosting providers known for lenient anti-abuse policies.
• Step 4: Reverse Engineering Redirects
• Phishing links often redirect through multiple domains to obfuscate their origin.
• Use packet analysis to reconstruct the full redirection chain and identify all
associated servers.
• Step 5: Look for C2 Communication
•If the phishing campaign is part of a broader attack (e.g., delivering ransomware),
inspect outgoing traffic for repeated communication with a specific server or IP.
4. Case Example: A Phishing
Email Targeting Credentials
• Scenario:
• A user receives an email claiming to be from their bank, requesting them to log in to verify their
account.
• The email contains a link to a fraudulent login page.
• Packet Analysis Findings:
• DNS Query to a Suspicious Domain:
• Query to secure-login-bank.com, a domain unrelated to the actual bank.
• The domain was registered two days prior and is hosted in a region known for cybercrime.
• HTTP POST Request:
• Packet captures show the user’s credentials were sent to the server via a POST request.
• The server’s IP address traces to a shared hosting provider.
• Malware Download:
• Clicking a secondary link in the phishing page triggers a file download (invoice.exe), initiating
outbound connections to a C2 server.
• Tracing the Attacker:
• The IP address of the phishing page’s server is linked to a hosting provider with multiple reports of
abuse.
• Geolocation reveals the server is based in a foreign country known for cybercrime activity.
Immediate Actions:
• IP Spoofing:
• Attackers often spoof IP addresses to
mask their identity.
• Solution: Analyze headers and correlate
with logs to identify inconsistencies.
• Use of Proxies and VPNs:
• Phishing servers often operate behind
anonymizing services.
• Solution: Look for patterns across multiple
attacks to trace infrastructure reuse.
• Encrypted Traffic:
• HTTPS encryption obscures payloads.
• Solution: Use TLS decryption tools or
metadata analysis to identify suspicious
traffic.
7. Tools for Packet Analysis
in Phishing Investigations
• Wireshark:
• Analyze packet flows and
reconstruct HTTP/HTTPS
requests.
• Zeek (formerly Bro):
• Detect phishing indicators in
DNS and HTTP traffic.
• Snort/Suricata:
• Identify known phishing
signatures in packet payloads.
11 Best Packet Sniffers Reviewed in 2024 (Free + P
aid)
1.ManageEngine NetFlow Analyzer EDITOR’S CHOICE This traffic monitor provides real-time
visibility into network traffic, applications, interfaces, and devices and includes a packet sniffer as well
as data extraction services that use the NetFlow, J-Flow, sFlow Netstream, IPFIX, and AppFlow
protocols. Available for Windows Server, Linux, AWS, and Azure. Start a 30-day free trial.
2.Paessler Packet Capture Tool (FREE TRIAL) A packet sniffer, a NetFlow sensor, an sFlow sensor,
and a J-Flow sensor built into Paessler PRTG. Download a 30-day free trial.
3.Omnipeek Network Protocol Analyzer A network monitor that can be extended to capture packets.
4.SolarWinds Deep Packet Inspection and Analysis Tool Gives detailed insights into what causes
network slowness and uses deep packet inspection to allow you to resolve the root causes.
5.tcpdump The essential free packet capture tool that every network manager needs in his toolkit.
6.Windump A free clone of tcpdump written for Windows systems.
7.Wireshark A well-known free packet capture and data analysis tool.
8.tshark A lightweight answer to those who want the functionality of Wireshark, but the slim profile of
tcpdump.
9.NetworkMiner A Windows-based network analyzer with a no-frills free version.
10.Fiddler A packet capture tool that focuses on HTTP(s) traffic.
11.Capsa Written for Windows, the free packet capture tool can be upgraded for payment to add on
analytical features.
Case Study: DDoS
Attack
1. What is a DDoS Attack?
A Distributed Denial of Service (DDoS) attack overwhelms a target
system, server, or network with an enormous volume of traffic,
rendering it unavailable to legitimate users. This traffic originates from
multiple compromised devices, often part of a botnet controlled by an
attacker.