Pwnie Express
Practical Man in the Middle
1Saturday, June 22, 13
whoami
• Jonathan Cran
• Advisor, SOURCE Conference
• CTO Pwnie Express
• QA Director Metasploit
• Penetration Tester Rapid7
2Saturday, June 22, 13
Agenda
• MitM is a huge topic
• Why ShouldYou Care in 2013?
• Practical Attacks
• Practical Attack Automation
• Drop Boxes!
• Takeaways + Future Work
3Saturday, June 22, 13
Let’s not re-invent the
wheel
4Saturday, June 22, 13
Our Focus
• Local & Wireless Network
• Getting in the Middle
• Viewing and Manipulating Traffic
• Automating Easy Wins
5Saturday, June 22, 13
Not our focus
• Attacking SSL through certificate
manipulation
• Attacking BGP
• More complex attacks (STP, HSRP)
• Proxy trojans (MitB, BitB)
6Saturday, June 22, 13
Focus:
Highly targeted, local
network attacks
7Saturday, June 22, 13
8Saturday, June 22, 13
9Saturday, June 22, 13
10Saturday, June 22, 13
Why ShouldYou Care
in 2013?
11Saturday, June 22, 13
12Saturday, June 22, 13
13Saturday, June 22, 13
A couple reasons
• Wireless everywhere
• Smartphones / AT&T auto-connect
• Retail / POS Networks
• Android apps
• Sometimes it’s hard to take control of a particular
system. Network is the easier target.
14Saturday, June 22, 13
And...
• Local Network - ARP Cache Poisoning is STILL
a valid attack - defense is impractical in many cases
• Local Network -SLAAC looks to be the best
replacement if ARP Cache Poisoning won’t work -
Windows 7+ has a default IPv6-enabled stack -
Recommendation? Disable IPv6
• Internet - SSL - Would your users really notice
lack of http or an invalid cert?
• Wireless - Wireless ā€œEvil Twinā€ flaws still pervasive
15Saturday, June 22, 13
Android
• It means your personal information is being
transmitted to advertising agencies in mass
quantities.
• Mallodroid - Leibniz University of Hannover
• 13,500 android apps reversed, 1074 vulnerable
(8%)
• SSL/TLS code that is potentially vulnerable to
MITM attacks
16Saturday, June 22, 13
And...
• ARM Devices continue to get smaller / more
portable
• Pwn Plug
• Gumstix
• ODroid
• MK - SS808
17Saturday, June 22, 13
And...
18Saturday, June 22, 13
And...
19Saturday, June 22, 13
And...
20Saturday, June 22, 13
And...
21Saturday, June 22, 13
And...
22Saturday, June 22, 13
And...
23Saturday, June 22, 13
And...
24Saturday, June 22, 13
And...
25Saturday, June 22, 13
And...
• 4G / LTE Speeds will get faster
• Freedom Stick
26Saturday, June 22, 13
That said...
• Securing Layer 2 is hard
• You’re probably not getting owned by folks with
physical access (or are you?)
• TJX (WEP + Arp Spoofing)
• Subway (Backdoored devices)
• Barnes and Noble (Verifone / Linux Pinpads)
• Realistically, dumping hashes on a windows box is an
easier vector during most enterprise penetration
tests
• Financial Crime? Man-in-Browser
• Go where the data is, silly.
27Saturday, June 22, 13
I thought you said
practical
28Saturday, June 22, 13
Super Practical Attacks
• Hardware Taps & Bridges
• ARP Cache Poisoning
• DNS Cache Poisoning
• IPv6 Abuse / SLAAC Attack
• DHCP Exhaustion
• Wireless Evil Twin
• Forced HTTP / SSLStrip
29Saturday, June 22, 13
A Note on Attack
Prevention
• Use a strongVPN Connection
• Do not use PPTP, MSCHAPv2 broken
• L2TP/IPSec, IPSec with IKEv2 and
OpenVPN
30Saturday, June 22, 13
Hardware Taps
• DualComm DCSW-1005 (Active Copy)
• Throwing Star LAN Tap (Passive)
vs
31Saturday, June 22, 13
Hardware Bridges
• Simply place a device in-line and act as a
bridge
• brctl (bridge-utils)
• EBTables to route traffic
32Saturday, June 22, 13
Hardware Bridges
# brctl addbr br0
# brctl addif br0 eth0
# brctl addif br0 eth1
# ifconfig br0 netmask 255.255.255.0 10.1.1.1 up
33Saturday, June 22, 13
Preventing Hardware
Attacks
• Good physical security
• Good loss prevention
• 802.1x / NAC
34Saturday, June 22, 13
ARP Cache Poisoning
• Observe broadcast request, send malicious
ARP reply, victim stores attacker’s MAC for
the IP
• ā€œPoisonā€ a single comm channel, or both
• Automated:
• zomg so many ways to do it - just use
arpspoof
35Saturday, June 22, 13
ARP Cache Poisoning
• echo 1 > /proc/sys/net/ipv4/ip_forward
• arpspoof -t <poisoned_host> <gateway>
36Saturday, June 22, 13
Preventing ARP Cache
Poisoning
• Broadcast Traffic Filtering
• Disable Gratuitous ARP
• Enable DHCP Snooping
• Static ARP Tables
• Monitoring
• ArpWatch,Tons of others
• HUAWEI Patented techniques
• MACSEC / 802.1AE
37Saturday, June 22, 13
A note on MACSec
• MACsec, defined in 802.1AE, provides
MAC-layer encryption over wired
networks
• MKA and MACsec are implemented after
successful authentication using the 802.1x
Extensible Authentication Protocol (EAP)
framework.
38Saturday, June 22, 13
DNS Cache Poisoning,
previously
• Cache poisoning without response forgery
• bailiwick rule fixed this in ~1993
• Blind response forgery using birthday attack
• ā€œBirthday attackā€ - guess TXID, known since
2002
• ā€œKaminsky attackā€ - required guessing TXID, but
added hijacking the authority records
• Automating: http://www.metasploit.com/
modules/auxiliary/spoof/dns/
bailiwicked_domain
39Saturday, June 22, 13
DNS Cache Poisoning
Source: http://www.cs.utexas.edu/~shmatshmat_securecomm10.pdf
40Saturday, June 22, 13
DNS Cache Poisoning,
now
• Response forgery using eavesdropping
• Requires ā€œbeing in the middleā€
• Automating: Ettercap
41Saturday, June 22, 13
DNS Cache Poisoning,
now
Source: http://www.blackhat.com/presentations/bh-usa-03/bh-us-03-ornaghi-valleri.pdf
42Saturday, June 22, 13
Preventing DNS
Spoofing
• DNSSEC
43Saturday, June 22, 13
DNS Cache Poisoning,
now
• Response forgery using eavesdropping
• Requires ā€œbeing in the middleā€
• Automating: Ettercap
44Saturday, June 22, 13
SLAAC Attack
• Instructions provided by the Infosec
Institute article
• Uses RADVD + DHCPv6 + NAT-PT + IPv6
DNS server
• NAT-PT allows our IPv6-addressed victims
to access the Internet through IPv4
45Saturday, June 22, 13
SLAAC Attack
Source: http://resources.infosecinstitute.com/slaac-attack/
46Saturday, June 22, 13
SLAAC Attack
Source: http://resources.infosecinstitute.com/slaac-attack/
47Saturday, June 22, 13
SLAAC Attack
• The address of the victim’s DNS server matches the
NAT-PT prefix on evil-rtr, denoting that the last 32 bits
contain the DNS server’s IPv4 address.
• NAT-PT translates the source and destination IPv6/IPv4
addresses in both directions.
• The DNS ALG translates the victim’s AAAA query for
an IPv6 address into an A query for an IPv4 address and
vice versa on the way back.
• The DNS ALG also translates the IPv4 address in the
reply to an IPv6 address that matches the NAT-PT
prefix.
48Saturday, June 22, 13
SLAAC Attack
Source: http://resources.infosecinstitute.com/slaac-attack/
49Saturday, June 22, 13
SLAAC Attack
• We have not compromised or altered the operation of
the victim’s IPv4 network, as we would have needed to
do in order to MITM IPv4 traffic.We’ve not even
needed to get an IPv4 address from their DHCP server.
• We have not compromised an existing IPv6 network,
because there wasn’t one before we arrived.
• We have not compromised any given victim host (yet!).
Each machine is behaving as designed and is choosing
IPv6 over IPv4 of its own volition.
• We have managed to totally alter the flow of traffic on
the victim’s network by awakening the hosts’ latent
desire to use IPv6 over IPv4.
50Saturday, June 22, 13
SLAAC Attack
• We’re introducing a new path to the Internet.Any
defences or monitoring employed at the network’s IPv4
boundary are therefore ineffective and will raise no
indicators of compromise.
• There’s a chance that the victim’s security systems
(e.g., host firewalls, HIPS, SIEM boxes, etc.) won’t be
able to handle IPv6 traffic. IPv6 support on such
systems is rarely as mature as its IPv4 equivalent.
• Since the victims ā€œaren’t using IPv6″ they won’t be
expecting an attack that makes use of it.
• If the above is true, there’s a chance their Incident
Response teams won’t have the necessary training and
experience with IPv6 to deal with an incident.
51Saturday, June 22, 13
SLAAC Attack
52Saturday, June 22, 13
SLAAC Attack
53Saturday, June 22, 13
Preventing SLAAC
54Saturday, June 22, 13
DHCP Exhaustion
• Request leases until the server runs out
• Provide a lease to new clients
• Set up your own DNS server for the client
• Automated:
• http://www.digininja.org/metasploit/
dns_dhcp.php
• yersinia
55Saturday, June 22, 13
DHCP Exhaustion
56Saturday, June 22, 13
Preventing DHCP
Exhaustion
57Saturday, June 22, 13
Preventing DHCP
Exhaustion
58Saturday, June 22, 13
Wireless Evil Twin
• Automating:
• airbase-ng
• Wifi-Pineapple
• Pwnie Gear
59Saturday, June 22, 13
• 802.11 and Bluetooth Wireless Surveys
•802.11 Wireless MitM Testing
• Wireless Traffic Capture
• Remote Network Access
• Zigbee Sniffing with Kisbee
• RFID Sniffing with the Proxmark |||
• Bluetooth Sniffing with the Ubertooth
Pwn Pad
60Saturday, June 22, 13
61Saturday, June 22, 13
DEMO: Getting In The
Middle of a Wireless
Network
62Saturday, June 22, 13
Preventing Evil Twin Attacks
• Educate users
• Don’t use AT&T phones
• Use RADIUS - Avoid LEAP
• EAP-TLS, EAP-TTLS, or PEAP
• MS-CHAPv2 + TLS Tunnel
63Saturday, June 22, 13
MDM?
64Saturday, June 22, 13
MDM?
65Saturday, June 22, 13
Forced HTTP
• Take advantage of servers that server over
both HTTP and HTTPS
• Rewrite links as HTTP
• Abuse the user’s ignorance of ā€œsecureā€
• Automated: SSLStrip + IPTables
66Saturday, June 22, 13
Forced HTTP with
SSLStrip
• echo 1 > /proc/sys/net/ipv4/ip_forward
• iptables -t nat -A PREROUTING -p tcp --
dport 80 -j REDIRECT --to-ports 10000
• sslstrip -a -k -f -p 10000
67Saturday, June 22, 13
DEMO: Forced HTTP
with SSLStrip
68Saturday, June 22, 13
Preventing SSLStrip
• Server-side HSTS Header
• Automatically turns any insecure links to
the website into secure links.
• http://example.com/some/page/ ->
https://example.com/some/page/
• If the security of the connection cannot
be ensured (ie, self-signed cert), show an
error message and do not allow the user
to access the site.
69Saturday, June 22, 13
HSTS
• HSTS tells the browser: never use HTTP
with this site.
• The first time the browser sees the HSTS
header from the server, it remembers it.
• This will work as long as the attacker
doesn't strip the header on the first visit to
the site.
70Saturday, June 22, 13
Other Attacks
• CAM Overflow /
Flooding
• Certificate Abuse
• BGP Attacks
• Port-Stealing
• HSRP
Manipulation
• IRDP Spoofing
• Traffic Tunneling
• STP Mangling
• VLAN Attacks
71Saturday, June 22, 13
CAM Overflow
• Flood the local network with random MAC
addresses
• Causes some switches to fail open in
repeating mode
• Automated: sudo macof -i eth0
72Saturday, June 22, 13
Preventing CAM
Overflow
• Similar to ARP Spoofing
• MAC Address monitoring
• DHCP Snooping
• Dynamic ARP Inspection
73Saturday, June 22, 13
Certificate Abuse
• ā€œMD5 considered harmful todayā€
• Stolen CA Certificates
• Comodo (March 2011)
• Diginotar (July 2011)
• Trustwave CA-signed certificate
• SSLSniff + Null Byte Attack
74Saturday, June 22, 13
BGP Attacks
• "Stealing the Internet - A Routed,Wide-area, Man in
the Middle Attack"
• Renesys - ā€œDefending Against BGP Man-In-The-
Middle Attacksā€
• Every organization owes its Internet connectivity to
one protocol: BGP4.There are no alternatives.
• Everyone who connects to the Internet is currently
exposed to various routing risks: downtime,
hijacking and now even wholesale traffic
interception.
75Saturday, June 22, 13
Port Stealing
Source: http://www.packetwatch.net/documents/papers/layer2sniffing.pdf
76Saturday, June 22, 13
HSRP Manipulation
Source: http://packetlife.net/blog/2008/oct/27/hijacking-hsrp/
77Saturday, June 22, 13
HSRP Manipulation
Source: http://packetlife.net/blog/2008/oct/27/hijacking-hsrp/
78Saturday, June 22, 13
HSRP Manipulation
• Linux# scapy
• Welcome to Scapy (2.0.0.10 beta)
• >>> ip = IP(src='172.16.40.128', dst='224.0.0.2')
• >>> udp = UDP()
• >>> hsrp = HSRP(group=1, priority=255,
virtualIP='172.16.40.1')
• >>> send(ip/udp/hsrp, iface='eth1', inter=3, loop=1)
Source: http://packetlife.net/blog/2008/oct/27/hijacking-hsrp/
79Saturday, June 22, 13
HSRP Manipulation
Source: http://packetlife.net/blog/2008/oct/27/hijacking-hsrp/
80Saturday, June 22, 13
Preventing HSRP
Manipulation
• Prevent L2 Access to any connected switch
• Note: HSRP,VRRP, and GLBP all vulnerable
81Saturday, June 22, 13
IRDP Spoofing
• ICMP Internet Router Discovery Protocol (IRDP) uses Internet
Control Message Protocol (ICMP) router advertisements and
router solicitation messages to allow a host to discover the
addresses of operational routers on the subnet.
• The attacker can forge some advertisement packet pretending to
be the router for the LAN.
• He/she can set the ā€œpreference levelā€ and the ā€œlifetimeā€ at high
values to be sure the hosts will choose it as the preferred router.
• The attack can be improved by sending some spoofed ICMP Host
Unreachable pretending to be the real router
• Automated: IRPAS (http://www.phenoelit.de/irpas)
82Saturday, June 22, 13
Traffic Tunneling
83Saturday, June 22, 13
STP Mangling
• STP (Spanning-Tree Protocol) mangling refers to the
technique used for the attacker host to be elected as the
new root bridge of the spanning tree.
• The attacker may start either by forging BPDUs (Bridge
Protocol Data Units) with high priority assuming to be the
new root, or by broadcasting STP Configuration/Topology
Change Acknowledgement BPDUs to get his host elected as
the new root bridge.
• Automated: yersinia
84Saturday, June 22, 13
Others
• Dsniff
• Ettercap (http://ettercap.github.io/ettercap/)
• Beef + Shank (http://media.blackhat.com/bh-us-12/Briefings/Ocepek/BH_US_12_Ocepek_Linn_BeEF_MITM_WP.pdf)
• EvilGrade (http://www.infobyte.com.ar/down/isr-evilgrade-Readme.txt)
• EasyCreds (https://github.com/brav0hax/easy-creds)
• Subterfuge (https://code.google.com/p/subterfuge/)
85Saturday, June 22, 13
Takeaways
86Saturday, June 22, 13
Takeaways
• ā€œMitM is a underrated attack vectorā€
• Phones are trivial to MitM because of Evil Twin issues
• Dropboxes present a credible threat
• POS networks / systems are available / trending wireless
• Many powerful MitM attacks can be automated, old school
techniques still work
87Saturday, June 22, 13
Prior Work and
Resources
• http://www.blackhat.com/presentations/bh-usa-02/bh-us-02-
convery-switches.pdf
• http://www.blackhat.com/presentations/bh-usa-03/bh-us-03-
ornaghi-valleri.pdf
• http://www.blackhat.com/presentations/bh-europe-03/bh-
europe-03-valleri.pdf
• http://www.packetwatch.net/documents/papers/
layer2sniffing.pdf
• http://packetlife.net
• http://my.safaribooksonline.com/book/networking/security/
9781587052569
88Saturday, June 22, 13
Questions?
89Saturday, June 22, 13
THANKS! (and don’t forget feedback forms)
90Saturday, June 22, 13

More Related Content

PDF
DDoS Defense Mechanisms for IXP Infrastructures
PDF
Using MikroTik routers for BGP transit and IX points
PDF
Blackholing from a_providers_perspektive_theo_voss
PDF
FastNetMon - ENOG9 speech about DDoS mitigation
PDF
Дтроим ханипот Šø Š²Ń‹ŃŠ²Š»ŃŠµŠ¼ DDoS-атаки
PPTX
FastNetMon Advanced DDoS detection tool
PDF
Ripe71 FastNetMon open source DoS / DDoS mitigation
PPTX
BGP FlowSpec experience and future developments
DDoS Defense Mechanisms for IXP Infrastructures
Using MikroTik routers for BGP transit and IX points
Blackholing from a_providers_perspektive_theo_voss
FastNetMon - ENOG9 speech about DDoS mitigation
Дтроим ханипот Šø Š²Ń‹ŃŠ²Š»ŃŠµŠ¼ DDoS-атаки
FastNetMon Advanced DDoS detection tool
Ripe71 FastNetMon open source DoS / DDoS mitigation
BGP FlowSpec experience and future developments

What's hot (19)

PDF
FastNetMonć‚’č©¦ć—ć¦ćæćŸ
PDF
Detecting and mitigating DDoS ZenDesk by Vicente De Luca
PDF
Distributed Denial of Service Attack - Detection And Mitigation
PDF
DDoS Challenges in IPv6 environment
PPTX
DeiC DDoS Prevention System - DDPS
PDF
DDoS Mitigation Tools and Techniques
PDF
Jon Nield FastNetMon
PDF
Make the internet safe with DNS Firewall
PDF
HTTP/3 over QUIC. All is new but still the same!
PPT
9534715
PPTX
redGuardian DP100 large scale DDoS mitigation solution
PDF
Preventing Traffic with Spoofed Source IP address
PDF
What can possibly go wrong? Why eSport needs an AntiDDoS Protection
PDF
Let's talk about routing security, Anurag Bhatia, Hurricane Electric
PDF
Implementing BGP Flowspec at IP transit network
PDF
Nanog66 vicente de luca fast netmon
PDF
Keeping your rack cool
PDF
Protect your edge BGP security made simple
PDF
St Louis Linux Users Group Wireguard (for Fun and Networking)
FastNetMonć‚’č©¦ć—ć¦ćæćŸ
Detecting and mitigating DDoS ZenDesk by Vicente De Luca
Distributed Denial of Service Attack - Detection And Mitigation
DDoS Challenges in IPv6 environment
DeiC DDoS Prevention System - DDPS
DDoS Mitigation Tools and Techniques
Jon Nield FastNetMon
Make the internet safe with DNS Firewall
HTTP/3 over QUIC. All is new but still the same!
9534715
redGuardian DP100 large scale DDoS mitigation solution
Preventing Traffic with Spoofed Source IP address
What can possibly go wrong? Why eSport needs an AntiDDoS Protection
Let's talk about routing security, Anurag Bhatia, Hurricane Electric
Implementing BGP Flowspec at IP transit network
Nanog66 vicente de luca fast netmon
Keeping your rack cool
Protect your edge BGP security made simple
St Louis Linux Users Group Wireguard (for Fun and Networking)
Ad

Viewers also liked (15)

PPTX
Arp spoofing slides
PPTX
Raspbery pi Arm
PDF
Minimalist Operating Systems for Containers
PDF
IoT - Innovating without compromising security
PDF
BKK16-406 Ubuntu Core - a snappy platform for Embedded, IoT and 96boards!
Ā 
PPT
ŠžŠ»ŠµŠ³ ŠšŃƒŠæŃ€ŠµŠµŠ² - ŠžŠ±Š·Š¾Ń€ Šø Š“ŠµŠ¼Š¾Š½ŃŃ‚Ń€Š°Ń†ŠøŃ Š½ŃŽŠ°Š½ŃŠ¾Š² Šø Ń‚Ń€ŃŽŠŗŠ¾Š² ŠøŠ· области беспровоГных ...
PPTX
Home Arcade setup (NoVA Hackers)
PPTX
FC00::1 (Algunos) Ataques en IPv6
PPT
Arp spoofing
PPTX
Spoofing Techniques
PPT
Ip Spoofing
PDF
Mark Shuttleworth (Ubuntu) - Faster, Easier and More Secure: The Next Generat...
PPTX
Pwn phone2014 jrs
PPT
Spoofing
Arp spoofing slides
Raspbery pi Arm
Minimalist Operating Systems for Containers
IoT - Innovating without compromising security
BKK16-406 Ubuntu Core - a snappy platform for Embedded, IoT and 96boards!
Ā 
ŠžŠ»ŠµŠ³ ŠšŃƒŠæŃ€ŠµŠµŠ² - ŠžŠ±Š·Š¾Ń€ Šø Š“ŠµŠ¼Š¾Š½ŃŃ‚Ń€Š°Ń†ŠøŃ Š½ŃŽŠ°Š½ŃŠ¾Š² Šø Ń‚Ń€ŃŽŠŗŠ¾Š² ŠøŠ· области беспровоГных ...
Home Arcade setup (NoVA Hackers)
FC00::1 (Algunos) Ataques en IPv6
Arp spoofing
Spoofing Techniques
Ip Spoofing
Mark Shuttleworth (Ubuntu) - Faster, Easier and More Secure: The Next Generat...
Pwn phone2014 jrs
Spoofing
Ad

Similar to Practical mitm for_pentesters (20)

PPT
MAGPI: Advanced Services: IPv6, Multicast, DNSSEC
PDF
Don Bailey - A Million Little Tracking Devices
PDF
Day 2 Operations for Kubernetes Networking with Cilium
PDF
PLNOG 5: Merike Kaeo - Something Old Is New Again
PPTX
How we lose etu hadoop competition
PDF
HES2011 - Sebastien Tricaud - Capture me if you can
PDF
Hackito Ergo Sum 2011: Capture me if you can!
PDF
DDoS Attacks - Scenery, Evolution and Mitigation
PPTX
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
PDF
Security events in 2014
PDF
4G LTE Security - What hackers know?
PDF
IPv6 Threat Presentation
PDF
SignalR
PDF
Yunusov babin 7 sins pres atm v2
PDF
A million little tracking devices - Don Bailey
PDF
InfiltrateCon 2016 - Why Nation-State Hack Telco Networks
PDF
IPv6 Security - Where is the Challenge?
PPTX
Outsourced database
PDF
Attacking GRX - GPRS Roaming eXchange
PDF
fgont-h2hc-2020-ipv6-security.pdf
MAGPI: Advanced Services: IPv6, Multicast, DNSSEC
Don Bailey - A Million Little Tracking Devices
Day 2 Operations for Kubernetes Networking with Cilium
PLNOG 5: Merike Kaeo - Something Old Is New Again
How we lose etu hadoop competition
HES2011 - Sebastien Tricaud - Capture me if you can
Hackito Ergo Sum 2011: Capture me if you can!
DDoS Attacks - Scenery, Evolution and Mitigation
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
Security events in 2014
4G LTE Security - What hackers know?
IPv6 Threat Presentation
SignalR
Yunusov babin 7 sins pres atm v2
A million little tracking devices - Don Bailey
InfiltrateCon 2016 - Why Nation-State Hack Telco Networks
IPv6 Security - Where is the Challenge?
Outsourced database
Attacking GRX - GPRS Roaming eXchange
fgont-h2hc-2020-ipv6-security.pdf

More from Jonathan Cran (8)

PDF
Intrigue Core: Scaling Assessment Automation
PPTX
2019 Cybersecurity Retrospective and a look forward to 2020
PPTX
Top 10 exploited vulnerabilities 2019 (thus far...)
PDF
Effective Prioritization Through Exploit Prediction
PPTX
Vulnerability Prioritization and Prediction
PPTX
RSA 2018: Recon For the Defender - You know nothing (about your assets)
PDF
Attack Surface Discovery with Intrigue
ZIP
Intrigue Core: Scaling Assessment Automation
2019 Cybersecurity Retrospective and a look forward to 2020
Top 10 exploited vulnerabilities 2019 (thus far...)
Effective Prioritization Through Exploit Prediction
Vulnerability Prioritization and Prediction
RSA 2018: Recon For the Defender - You know nothing (about your assets)
Attack Surface Discovery with Intrigue

Recently uploaded (20)

PPTX
2018-HIPAA-Renewal-Training for executives
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
A review of recent deep learning applications in wood surface defect identifi...
DOCX
search engine optimization ppt fir known well about this
PPTX
The various Industrial Revolutions .pptx
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Architecture types and enterprise applications.pdf
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
Zenith AI: Advanced Artificial Intelligence
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
Microsoft Excel 365/2024 Beginner's training
PPTX
Configure Apache Mutual Authentication
2018-HIPAA-Renewal-Training for executives
UiPath Agentic Automation session 1: RPA to Agents
A review of recent deep learning applications in wood surface defect identifi...
search engine optimization ppt fir known well about this
The various Industrial Revolutions .pptx
Build Your First AI Agent with UiPath.pptx
Credit Without Borders: AI and Financial Inclusion in Bangladesh
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
sbt 2.0: go big (Scala Days 2025 edition)
Comparative analysis of machine learning models for fake news detection in so...
Architecture types and enterprise applications.pdf
OpenACC and Open Hackathons Monthly Highlights July 2025
Enhancing plagiarism detection using data pre-processing and machine learning...
Zenith AI: Advanced Artificial Intelligence
Module 1.ppt Iot fundamentals and Architecture
1 - Historical Antecedents, Social Consideration.pdf
A contest of sentiment analysis: k-nearest neighbor versus neural network
Microsoft Excel 365/2024 Beginner's training
Configure Apache Mutual Authentication

Practical mitm for_pentesters

  • 1. Pwnie Express Practical Man in the Middle 1Saturday, June 22, 13
  • 2. whoami • Jonathan Cran • Advisor, SOURCE Conference • CTO Pwnie Express • QA Director Metasploit • Penetration Tester Rapid7 2Saturday, June 22, 13
  • 3. Agenda • MitM is a huge topic • Why ShouldYou Care in 2013? • Practical Attacks • Practical Attack Automation • Drop Boxes! • Takeaways + Future Work 3Saturday, June 22, 13
  • 4. Let’s not re-invent the wheel 4Saturday, June 22, 13
  • 5. Our Focus • Local & Wireless Network • Getting in the Middle • Viewing and Manipulating Traffic • Automating Easy Wins 5Saturday, June 22, 13
  • 6. Not our focus • Attacking SSL through certificate manipulation • Attacking BGP • More complex attacks (STP, HSRP) • Proxy trojans (MitB, BitB) 6Saturday, June 22, 13
  • 7. Focus: Highly targeted, local network attacks 7Saturday, June 22, 13
  • 11. Why ShouldYou Care in 2013? 11Saturday, June 22, 13
  • 14. A couple reasons • Wireless everywhere • Smartphones / AT&T auto-connect • Retail / POS Networks • Android apps • Sometimes it’s hard to take control of a particular system. Network is the easier target. 14Saturday, June 22, 13
  • 15. And... • Local Network - ARP Cache Poisoning is STILL a valid attack - defense is impractical in many cases • Local Network -SLAAC looks to be the best replacement if ARP Cache Poisoning won’t work - Windows 7+ has a default IPv6-enabled stack - Recommendation? Disable IPv6 • Internet - SSL - Would your users really notice lack of http or an invalid cert? • Wireless - Wireless ā€œEvil Twinā€ flaws still pervasive 15Saturday, June 22, 13
  • 16. Android • It means your personal information is being transmitted to advertising agencies in mass quantities. • Mallodroid - Leibniz University of Hannover • 13,500 android apps reversed, 1074 vulnerable (8%) • SSL/TLS code that is potentially vulnerable to MITM attacks 16Saturday, June 22, 13
  • 17. And... • ARM Devices continue to get smaller / more portable • Pwn Plug • Gumstix • ODroid • MK - SS808 17Saturday, June 22, 13
  • 26. And... • 4G / LTE Speeds will get faster • Freedom Stick 26Saturday, June 22, 13
  • 27. That said... • Securing Layer 2 is hard • You’re probably not getting owned by folks with physical access (or are you?) • TJX (WEP + Arp Spoofing) • Subway (Backdoored devices) • Barnes and Noble (Verifone / Linux Pinpads) • Realistically, dumping hashes on a windows box is an easier vector during most enterprise penetration tests • Financial Crime? Man-in-Browser • Go where the data is, silly. 27Saturday, June 22, 13
  • 28. I thought you said practical 28Saturday, June 22, 13
  • 29. Super Practical Attacks • Hardware Taps & Bridges • ARP Cache Poisoning • DNS Cache Poisoning • IPv6 Abuse / SLAAC Attack • DHCP Exhaustion • Wireless Evil Twin • Forced HTTP / SSLStrip 29Saturday, June 22, 13
  • 30. A Note on Attack Prevention • Use a strongVPN Connection • Do not use PPTP, MSCHAPv2 broken • L2TP/IPSec, IPSec with IKEv2 and OpenVPN 30Saturday, June 22, 13
  • 31. Hardware Taps • DualComm DCSW-1005 (Active Copy) • Throwing Star LAN Tap (Passive) vs 31Saturday, June 22, 13
  • 32. Hardware Bridges • Simply place a device in-line and act as a bridge • brctl (bridge-utils) • EBTables to route traffic 32Saturday, June 22, 13
  • 33. Hardware Bridges # brctl addbr br0 # brctl addif br0 eth0 # brctl addif br0 eth1 # ifconfig br0 netmask 255.255.255.0 10.1.1.1 up 33Saturday, June 22, 13
  • 34. Preventing Hardware Attacks • Good physical security • Good loss prevention • 802.1x / NAC 34Saturday, June 22, 13
  • 35. ARP Cache Poisoning • Observe broadcast request, send malicious ARP reply, victim stores attacker’s MAC for the IP • ā€œPoisonā€ a single comm channel, or both • Automated: • zomg so many ways to do it - just use arpspoof 35Saturday, June 22, 13
  • 36. ARP Cache Poisoning • echo 1 > /proc/sys/net/ipv4/ip_forward • arpspoof -t <poisoned_host> <gateway> 36Saturday, June 22, 13
  • 37. Preventing ARP Cache Poisoning • Broadcast Traffic Filtering • Disable Gratuitous ARP • Enable DHCP Snooping • Static ARP Tables • Monitoring • ArpWatch,Tons of others • HUAWEI Patented techniques • MACSEC / 802.1AE 37Saturday, June 22, 13
  • 38. A note on MACSec • MACsec, defined in 802.1AE, provides MAC-layer encryption over wired networks • MKA and MACsec are implemented after successful authentication using the 802.1x Extensible Authentication Protocol (EAP) framework. 38Saturday, June 22, 13
  • 39. DNS Cache Poisoning, previously • Cache poisoning without response forgery • bailiwick rule fixed this in ~1993 • Blind response forgery using birthday attack • ā€œBirthday attackā€ - guess TXID, known since 2002 • ā€œKaminsky attackā€ - required guessing TXID, but added hijacking the authority records • Automating: http://www.metasploit.com/ modules/auxiliary/spoof/dns/ bailiwicked_domain 39Saturday, June 22, 13
  • 40. DNS Cache Poisoning Source: http://www.cs.utexas.edu/~shmatshmat_securecomm10.pdf 40Saturday, June 22, 13
  • 41. DNS Cache Poisoning, now • Response forgery using eavesdropping • Requires ā€œbeing in the middleā€ • Automating: Ettercap 41Saturday, June 22, 13
  • 42. DNS Cache Poisoning, now Source: http://www.blackhat.com/presentations/bh-usa-03/bh-us-03-ornaghi-valleri.pdf 42Saturday, June 22, 13
  • 44. DNS Cache Poisoning, now • Response forgery using eavesdropping • Requires ā€œbeing in the middleā€ • Automating: Ettercap 44Saturday, June 22, 13
  • 45. SLAAC Attack • Instructions provided by the Infosec Institute article • Uses RADVD + DHCPv6 + NAT-PT + IPv6 DNS server • NAT-PT allows our IPv6-addressed victims to access the Internet through IPv4 45Saturday, June 22, 13
  • 48. SLAAC Attack • The address of the victim’s DNS server matches the NAT-PT prefix on evil-rtr, denoting that the last 32 bits contain the DNS server’s IPv4 address. • NAT-PT translates the source and destination IPv6/IPv4 addresses in both directions. • The DNS ALG translates the victim’s AAAA query for an IPv6 address into an A query for an IPv4 address and vice versa on the way back. • The DNS ALG also translates the IPv4 address in the reply to an IPv6 address that matches the NAT-PT prefix. 48Saturday, June 22, 13
  • 50. SLAAC Attack • We have not compromised or altered the operation of the victim’s IPv4 network, as we would have needed to do in order to MITM IPv4 traffic.We’ve not even needed to get an IPv4 address from their DHCP server. • We have not compromised an existing IPv6 network, because there wasn’t one before we arrived. • We have not compromised any given victim host (yet!). Each machine is behaving as designed and is choosing IPv6 over IPv4 of its own volition. • We have managed to totally alter the flow of traffic on the victim’s network by awakening the hosts’ latent desire to use IPv6 over IPv4. 50Saturday, June 22, 13
  • 51. SLAAC Attack • We’re introducing a new path to the Internet.Any defences or monitoring employed at the network’s IPv4 boundary are therefore ineffective and will raise no indicators of compromise. • There’s a chance that the victim’s security systems (e.g., host firewalls, HIPS, SIEM boxes, etc.) won’t be able to handle IPv6 traffic. IPv6 support on such systems is rarely as mature as its IPv4 equivalent. • Since the victims ā€œaren’t using IPv6″ they won’t be expecting an attack that makes use of it. • If the above is true, there’s a chance their Incident Response teams won’t have the necessary training and experience with IPv6 to deal with an incident. 51Saturday, June 22, 13
  • 55. DHCP Exhaustion • Request leases until the server runs out • Provide a lease to new clients • Set up your own DNS server for the client • Automated: • http://www.digininja.org/metasploit/ dns_dhcp.php • yersinia 55Saturday, June 22, 13
  • 59. Wireless Evil Twin • Automating: • airbase-ng • Wifi-Pineapple • Pwnie Gear 59Saturday, June 22, 13
  • 60. • 802.11 and Bluetooth Wireless Surveys •802.11 Wireless MitM Testing • Wireless Traffic Capture • Remote Network Access • Zigbee Sniffing with Kisbee • RFID Sniffing with the Proxmark ||| • Bluetooth Sniffing with the Ubertooth Pwn Pad 60Saturday, June 22, 13
  • 62. DEMO: Getting In The Middle of a Wireless Network 62Saturday, June 22, 13
  • 63. Preventing Evil Twin Attacks • Educate users • Don’t use AT&T phones • Use RADIUS - Avoid LEAP • EAP-TLS, EAP-TTLS, or PEAP • MS-CHAPv2 + TLS Tunnel 63Saturday, June 22, 13
  • 66. Forced HTTP • Take advantage of servers that server over both HTTP and HTTPS • Rewrite links as HTTP • Abuse the user’s ignorance of ā€œsecureā€ • Automated: SSLStrip + IPTables 66Saturday, June 22, 13
  • 67. Forced HTTP with SSLStrip • echo 1 > /proc/sys/net/ipv4/ip_forward • iptables -t nat -A PREROUTING -p tcp -- dport 80 -j REDIRECT --to-ports 10000 • sslstrip -a -k -f -p 10000 67Saturday, June 22, 13
  • 68. DEMO: Forced HTTP with SSLStrip 68Saturday, June 22, 13
  • 69. Preventing SSLStrip • Server-side HSTS Header • Automatically turns any insecure links to the website into secure links. • http://example.com/some/page/ -> https://example.com/some/page/ • If the security of the connection cannot be ensured (ie, self-signed cert), show an error message and do not allow the user to access the site. 69Saturday, June 22, 13
  • 70. HSTS • HSTS tells the browser: never use HTTP with this site. • The first time the browser sees the HSTS header from the server, it remembers it. • This will work as long as the attacker doesn't strip the header on the first visit to the site. 70Saturday, June 22, 13
  • 71. Other Attacks • CAM Overflow / Flooding • Certificate Abuse • BGP Attacks • Port-Stealing • HSRP Manipulation • IRDP Spoofing • Traffic Tunneling • STP Mangling • VLAN Attacks 71Saturday, June 22, 13
  • 72. CAM Overflow • Flood the local network with random MAC addresses • Causes some switches to fail open in repeating mode • Automated: sudo macof -i eth0 72Saturday, June 22, 13
  • 73. Preventing CAM Overflow • Similar to ARP Spoofing • MAC Address monitoring • DHCP Snooping • Dynamic ARP Inspection 73Saturday, June 22, 13
  • 74. Certificate Abuse • ā€œMD5 considered harmful todayā€ • Stolen CA Certificates • Comodo (March 2011) • Diginotar (July 2011) • Trustwave CA-signed certificate • SSLSniff + Null Byte Attack 74Saturday, June 22, 13
  • 75. BGP Attacks • "Stealing the Internet - A Routed,Wide-area, Man in the Middle Attack" • Renesys - ā€œDefending Against BGP Man-In-The- Middle Attacksā€ • Every organization owes its Internet connectivity to one protocol: BGP4.There are no alternatives. • Everyone who connects to the Internet is currently exposed to various routing risks: downtime, hijacking and now even wholesale traffic interception. 75Saturday, June 22, 13
  • 79. HSRP Manipulation • Linux# scapy • Welcome to Scapy (2.0.0.10 beta) • >>> ip = IP(src='172.16.40.128', dst='224.0.0.2') • >>> udp = UDP() • >>> hsrp = HSRP(group=1, priority=255, virtualIP='172.16.40.1') • >>> send(ip/udp/hsrp, iface='eth1', inter=3, loop=1) Source: http://packetlife.net/blog/2008/oct/27/hijacking-hsrp/ 79Saturday, June 22, 13
  • 81. Preventing HSRP Manipulation • Prevent L2 Access to any connected switch • Note: HSRP,VRRP, and GLBP all vulnerable 81Saturday, June 22, 13
  • 82. IRDP Spoofing • ICMP Internet Router Discovery Protocol (IRDP) uses Internet Control Message Protocol (ICMP) router advertisements and router solicitation messages to allow a host to discover the addresses of operational routers on the subnet. • The attacker can forge some advertisement packet pretending to be the router for the LAN. • He/she can set the ā€œpreference levelā€ and the ā€œlifetimeā€ at high values to be sure the hosts will choose it as the preferred router. • The attack can be improved by sending some spoofed ICMP Host Unreachable pretending to be the real router • Automated: IRPAS (http://www.phenoelit.de/irpas) 82Saturday, June 22, 13
  • 84. STP Mangling • STP (Spanning-Tree Protocol) mangling refers to the technique used for the attacker host to be elected as the new root bridge of the spanning tree. • The attacker may start either by forging BPDUs (Bridge Protocol Data Units) with high priority assuming to be the new root, or by broadcasting STP Configuration/Topology Change Acknowledgement BPDUs to get his host elected as the new root bridge. • Automated: yersinia 84Saturday, June 22, 13
  • 85. Others • Dsniff • Ettercap (http://ettercap.github.io/ettercap/) • Beef + Shank (http://media.blackhat.com/bh-us-12/Briefings/Ocepek/BH_US_12_Ocepek_Linn_BeEF_MITM_WP.pdf) • EvilGrade (http://www.infobyte.com.ar/down/isr-evilgrade-Readme.txt) • EasyCreds (https://github.com/brav0hax/easy-creds) • Subterfuge (https://code.google.com/p/subterfuge/) 85Saturday, June 22, 13
  • 87. Takeaways • ā€œMitM is a underrated attack vectorā€ • Phones are trivial to MitM because of Evil Twin issues • Dropboxes present a credible threat • POS networks / systems are available / trending wireless • Many powerful MitM attacks can be automated, old school techniques still work 87Saturday, June 22, 13
  • 88. Prior Work and Resources • http://www.blackhat.com/presentations/bh-usa-02/bh-us-02- convery-switches.pdf • http://www.blackhat.com/presentations/bh-usa-03/bh-us-03- ornaghi-valleri.pdf • http://www.blackhat.com/presentations/bh-europe-03/bh- europe-03-valleri.pdf • http://www.packetwatch.net/documents/papers/ layer2sniffing.pdf • http://packetlife.net • http://my.safaribooksonline.com/book/networking/security/ 9781587052569 88Saturday, June 22, 13
  • 90. THANKS! (and don’t forget feedback forms) 90Saturday, June 22, 13