SlideShare a Scribd company logo
Ducky-in-the-Middle
Injecting keystrokes into plaintext protocols
Esteban Rodriguez
https://www.n00py.io
Who Am I
• Penetration tester at Coalfire
Labs





• Part-time blogger and
security researcher
• Previous experience
Background
• Title is a reference to the USB Rubber Ducky
• This talk is about exploiting applications that:
• send keystrokes within the protocol
• are not encrypted
• Research began from curiosity
Ducky Video
Analyzing Protocols
• You don’t need much to do this, really!
• Wireshark by itself is often enough
• Wireshark is a protocol analyzer
• Deep inspection of hundreds of different protocols
• Live and offline analysis
• Runs on Linux /Windows / MacOS
• Powerful filtering
• Totally free
Wireshark Screenshot
TCP Session hijacking
• Taking over an existing TCP connection
• You must know the TCP sequence number
• You can guess the right number
• Read up on the “Mitnick Attack”
• You can sniff the number from a connection
• Requires Man-In-The-Middle
• Can be done easily with ARP spoofing
TCP Session hijacking
• This attack has been around for a long time
• Old tools like “Shijack” and “Hunt” can accomplish
this
• This attack can be stopped by proper use of crypto
• Encrypting the communication channel
• Message Digest / Hashing
Hunt Demo
Last Word on TCP Hijacking
• TCP Hijacking is cool, but often not necessary
• Typically easier to sniff out credentials and start a new
session
• Easy to accidentally break the original connection
between the host and the server
• Not as easy to pull off on more complicated protocols
Virtual Network Computing
• VNC has been around for a while
• Used to remotely control another computer
• uses the RFB protocol, which is not encrypted
• VNC authentication uses DES
• DES is extremely weak
• passwords are often truncated to 8 characters
VNC Password Files
• These are usually stored in the registry or in an .ini file
• They are encrypted with DES
• This doesn't even matter because VNC uses the
same static key to encrypt all passwords
• The key is in the source code, effectively public
• {23,82,107,6,35,78,88,7}
VNC Handshake
Challenge*
MITM Required
Keystroke Monitoring
• Keystrokes are easy to sniff out in Wireshark
• VNCKeylogger
• Python script for sniffing keystrokes out of a pcap
• https://jon.oberheide.org/files/vnclogger.py
• PHoss can sniff out the handshakes
• http://www.phenoelit.org/phoss/
VNC Cracking
• The handshake can be easily cracked
• It’s DES, usually 8 character password maximum
• Really old tools can do this quickly
• VNCrack - self explanatory
• http://www.phenoelit.org/vncrack/
• Cain and Abel can sniff as well as crack
• http://www.oxid.it/ca_um/topics/sniffer.htm
Injecting Keystrokes
• Once you crack the handshake you have the password
• You can connect like normal person…
• or you can start spraying keystrokes!
• Metasploit
• VNC Keyboard Remote Code Execution
Metasploit Video
MITM not required
HippoRemote
• Turns your iPhone into a wireless keyboard and mouse
• Works with Windows, Mac, Linux
• Password manager 😬
• Was pretty popular, but no no longer being actively
maintained
HippoRemote Video
HippoRemote protocol
• Windows version has a VNC client that is basically
UltraVNC
• Linux version you use your own VNC client
• OSX/MacOS version uses it’s own app called
HippoConnect
• We will move from VNC and focus on HippoConnect
Password Storage
• The app has some issues with password storage
• Uses LaunchDaemons and LaunchAgents to start the
server on logon
• The password is stored in a .plist (Like XML)
• Password is not encrypted
• This file is word-readable
• Program executes as root
Password Storage
HippoConnect Protocol
• Very similar to VNC
• Uses VNC authentication
• Everything is sent as JSON
• Keystrokes
• Mouse movement
• All the same flaws as VNC
TCP Stream
• Server identifies itself and sends a challenge
• Client sends response
• Server acknowledges successful auth
• Client sends keystrokes / mouse movement
MITM Required
Monitoring Keystrokes
MITM Required
Cracking Handshakes
MITM Required to sniff, but not crack
Injecting Keystrokes
MITM not required
Injecting Keystrokes
MITM not required
Bonjour
• Easy to spot HippoConnect in a network
• The client will use Bonjour to advertise itself
Mitigation
• Don’t use VNC
• If you do, tunnel it over a secure protocol such as
SSH
• Don’t use the HippoConnect MacOS app
• When using HippoRemote, use MacOS
ScreenSharing (Apple Remote Desktop)
• Similar to VNC but encrypted
Synergy
• Synergy is a mouse and keyboard sharing software
• Cross platform
• Two Versions: Basic and Pro
• Pro uses SSL encryption, basic doesn’t
• Synergy 2 now uses SSL for Basic and Pro
• Released after my exploit tool, unknown if this
research was motivator
Synergy 1 vs Synergy 2
Synergy
Monitoring Keystrokes
• Just like the other protocols, keystroke monitoring is
super easy
• 9 lines of Python with Scapy
MITM Required
Synergy Hijacking
• Different attack path - instead of impersonating a
client, we will impersonate a server
• The server sends the keystroke data to the clients
• Client connects to the server to receive commands
• Client configures the server to use via IP address,
hostname, or Auto-config (via Bonjour)
• Autoconfig will connect to any available Synergy server
Hijack (autoConfig)
Rogue*
MITM not required
Hijacking with ARP Spoofing
• Identify the IP address of any Synergy clients and
servers via Bonjour
• Assume the IP of the real Synergy server
• ARP spoof the victim to make it think you now have
that IP
• The connection will break, and attempt to re-connect
• The victim will accept commands from the fake server
Hijacking with ARP Spoofing
Rogue*
Mitigation
• Use Synergy Pro, Or Synergy 2
• These encrypt the commands with SSL
• Must verify the server fingerprint before connecting
Conclusion
• Encrypt all the things
• Don’t be afraid to do your own research
• Attack Tools
• Dissonance - Rogue Synergy Server
• https://github.com/n00py/Dissonance
• AngryHippo - HippoRemote Hacking Toolset
• https://github.com/n00py/AngryHippo
• All tools are made with Python - if you don’t know how to script, you should
learn
https://www.n00py.io

More Related Content

PPTX
Network scanning
ODP
2600 av evasion_deuce
PDF
y3dips hacking priv8 network
PPT
Port Scanning
PDF
St Louis Linux Users Group Wireguard (for Fun and Networking)
PPTX
Scapy TLS: A scriptable TLS 1.3 stack
PDF
CNIT 141: 1. Encryption
Network scanning
2600 av evasion_deuce
y3dips hacking priv8 network
Port Scanning
St Louis Linux Users Group Wireguard (for Fun and Networking)
Scapy TLS: A scriptable TLS 1.3 stack
CNIT 141: 1. Encryption

What's hot (19)

PPTX
Nous Sommes Cyber - HTB Blue
ODP
Wireless security beyond password cracking by Mohit Ranjan
PDF
Central Iowa Linux Users Group May 2020 Meeting: WireGuard
PPTX
BSides Ottawa 2019 - HTB Blue
PDF
Wireless Hacking Fast Track
PPTX
Pentesting custom TLS stacks
PPTX
Scanning networks (by piyush upadhyay)
PDF
CNIT 141: 1. Encryption
PPT
Dynamic Port Scanning
PPTX
Hacking Blind
PPTX
OFFENSIVE: Exploiting DNS servers changes BlackHat Asia 2014
PDF
Nginx conf.compressed
PPTX
Recon with Nmap
PDF
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
PPT
Nmap(network mapping)
PPTX
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
PDF
Solnik secure enclaveprocessor-pacsec
PDF
HTTPプロクシライブラリproxy2の設計と実装
PDF
Penetration Testing Resource Guide
Nous Sommes Cyber - HTB Blue
Wireless security beyond password cracking by Mohit Ranjan
Central Iowa Linux Users Group May 2020 Meeting: WireGuard
BSides Ottawa 2019 - HTB Blue
Wireless Hacking Fast Track
Pentesting custom TLS stacks
Scanning networks (by piyush upadhyay)
CNIT 141: 1. Encryption
Dynamic Port Scanning
Hacking Blind
OFFENSIVE: Exploiting DNS servers changes BlackHat Asia 2014
Nginx conf.compressed
Recon with Nmap
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
Nmap(network mapping)
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Solnik secure enclaveprocessor-pacsec
HTTPプロクシライブラリproxy2の設計と実装
Penetration Testing Resource Guide
Ad

Similar to BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keystrokes into plaintext protocols (20)

DOCX
Certified Ethical Hacker quick test prep cheat sheet
PDF
Last mile authentication problem: Exploiting the missing link in end-to-end s...
PDF
Computer network (2)
PPT
Security and Linux Security
PDF
Ericas-Security-Plus-Study-Guide
ODP
Wifi Security, or Descending into Depression and Drink
PDF
Hack Attack! An Introduction to Penetration Testing
PPTX
Red Team Apocalypse
PPT
IS Security Presentation
PDF
Workshop on Network Security
PPTX
Security concepts
PDF
Top 20 Ethical Hacker Interview Questions.pdf
PPT
Network security
PPT
Network Security Attacks, and Solutions.
PPT
Network Security. Different aspects of Network Security.
PPTX
Introduction Ethical hacking by eslam hussein
PPTX
501 ch 4 securing your network
PPTX
Penetration Testing and Intrusion Detection System
PPTX
Creating Havoc using Human Interface Device
PDF
Cisel1 d
Certified Ethical Hacker quick test prep cheat sheet
Last mile authentication problem: Exploiting the missing link in end-to-end s...
Computer network (2)
Security and Linux Security
Ericas-Security-Plus-Study-Guide
Wifi Security, or Descending into Depression and Drink
Hack Attack! An Introduction to Penetration Testing
Red Team Apocalypse
IS Security Presentation
Workshop on Network Security
Security concepts
Top 20 Ethical Hacker Interview Questions.pdf
Network security
Network Security Attacks, and Solutions.
Network Security. Different aspects of Network Security.
Introduction Ethical hacking by eslam hussein
501 ch 4 securing your network
Penetration Testing and Intrusion Detection System
Creating Havoc using Human Interface Device
Cisel1 d
Ad

More from JosephTesta9 (12)

PDF
BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open So...
PDF
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
PPTX
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
PDF
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
PDF
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
PPTX
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
PPTX
BSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
PPTX
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
PDF
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
PPTX
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
ODP
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
PPTX
BSides Rochester 2018: Anthony DiDonato: Virtualization Based Security
BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open So...
BSides Rochester 2018: Chaim Sanders: How the Cookie Crumbles: Modern HTTP St...
BSides Rochester 2018: Justin Moore: Automated HTTP Request Repeating With Bu...
BSides Rochester 2018: Dave Kukfa: BinDbg: Easy Windows Debugging for Binary ...
BSides Rochester 2018: Timothy Duffy: Civic and Humanitarian Open Source
BSides Rochester 2018: Michael West: Sentry, Or: How I Learned To Stop Worryi...
BSides Rochester 2018: Lee Kagan: Red and Blue Ping Pong
BSides Rochester 2018: Jonathan Myers: IoT Malware Detection with Machine Lea...
BSides Rochester 2018: Issa Hafiri & Christian Halbert: IOT Devices (And Why ...
BSides Rochester 2018: Drew Kirkpatrick: Open Source SAST and DAST Tools for ...
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
BSides Rochester 2018: Anthony DiDonato: Virtualization Based Security

Recently uploaded (20)

PDF
Hybrid model detection and classification of lung cancer
PPTX
1. Introduction to Computer Programming.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
project resource management chapter-09.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
STKI Israel Market Study 2025 version august
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
Hybrid model detection and classification of lung cancer
1. Introduction to Computer Programming.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Group 1 Presentation -Planning and Decision Making .pptx
project resource management chapter-09.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
STKI Israel Market Study 2025 version august
NewMind AI Weekly Chronicles - August'25-Week II
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
TLE Review Electricity (Electricity).pptx
Zenith AI: Advanced Artificial Intelligence
Web App vs Mobile App What Should You Build First.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
OMC Textile Division Presentation 2021.pptx
1 - Historical Antecedents, Social Consideration.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Final SEM Unit 1 for mit wpu at pune .pptx

BSides Rochester 2018: Esteban Rodriguez: Ducky In The Middle: Injecting keystrokes into plaintext protocols

  • 1. Ducky-in-the-Middle Injecting keystrokes into plaintext protocols Esteban Rodriguez https://www.n00py.io
  • 2. Who Am I • Penetration tester at Coalfire Labs
 
 
 • Part-time blogger and security researcher • Previous experience
  • 3. Background • Title is a reference to the USB Rubber Ducky • This talk is about exploiting applications that: • send keystrokes within the protocol • are not encrypted • Research began from curiosity
  • 5. Analyzing Protocols • You don’t need much to do this, really! • Wireshark by itself is often enough • Wireshark is a protocol analyzer • Deep inspection of hundreds of different protocols • Live and offline analysis • Runs on Linux /Windows / MacOS • Powerful filtering • Totally free
  • 7. TCP Session hijacking • Taking over an existing TCP connection • You must know the TCP sequence number • You can guess the right number • Read up on the “Mitnick Attack” • You can sniff the number from a connection • Requires Man-In-The-Middle • Can be done easily with ARP spoofing
  • 8. TCP Session hijacking • This attack has been around for a long time • Old tools like “Shijack” and “Hunt” can accomplish this • This attack can be stopped by proper use of crypto • Encrypting the communication channel • Message Digest / Hashing
  • 10. Last Word on TCP Hijacking • TCP Hijacking is cool, but often not necessary • Typically easier to sniff out credentials and start a new session • Easy to accidentally break the original connection between the host and the server • Not as easy to pull off on more complicated protocols
  • 11. Virtual Network Computing • VNC has been around for a while • Used to remotely control another computer • uses the RFB protocol, which is not encrypted • VNC authentication uses DES • DES is extremely weak • passwords are often truncated to 8 characters
  • 12. VNC Password Files • These are usually stored in the registry or in an .ini file • They are encrypted with DES • This doesn't even matter because VNC uses the same static key to encrypt all passwords • The key is in the source code, effectively public • {23,82,107,6,35,78,88,7}
  • 14. Keystroke Monitoring • Keystrokes are easy to sniff out in Wireshark • VNCKeylogger • Python script for sniffing keystrokes out of a pcap • https://jon.oberheide.org/files/vnclogger.py • PHoss can sniff out the handshakes • http://www.phenoelit.org/phoss/
  • 15. VNC Cracking • The handshake can be easily cracked • It’s DES, usually 8 character password maximum • Really old tools can do this quickly • VNCrack - self explanatory • http://www.phenoelit.org/vncrack/ • Cain and Abel can sniff as well as crack • http://www.oxid.it/ca_um/topics/sniffer.htm
  • 16. Injecting Keystrokes • Once you crack the handshake you have the password • You can connect like normal person… • or you can start spraying keystrokes! • Metasploit • VNC Keyboard Remote Code Execution
  • 18. HippoRemote • Turns your iPhone into a wireless keyboard and mouse • Works with Windows, Mac, Linux • Password manager 😬 • Was pretty popular, but no no longer being actively maintained
  • 20. HippoRemote protocol • Windows version has a VNC client that is basically UltraVNC • Linux version you use your own VNC client • OSX/MacOS version uses it’s own app called HippoConnect • We will move from VNC and focus on HippoConnect
  • 21. Password Storage • The app has some issues with password storage • Uses LaunchDaemons and LaunchAgents to start the server on logon • The password is stored in a .plist (Like XML) • Password is not encrypted • This file is word-readable • Program executes as root
  • 23. HippoConnect Protocol • Very similar to VNC • Uses VNC authentication • Everything is sent as JSON • Keystrokes • Mouse movement • All the same flaws as VNC
  • 24. TCP Stream • Server identifies itself and sends a challenge • Client sends response • Server acknowledges successful auth • Client sends keystrokes / mouse movement MITM Required
  • 26. Cracking Handshakes MITM Required to sniff, but not crack
  • 29. Bonjour • Easy to spot HippoConnect in a network • The client will use Bonjour to advertise itself
  • 30. Mitigation • Don’t use VNC • If you do, tunnel it over a secure protocol such as SSH • Don’t use the HippoConnect MacOS app • When using HippoRemote, use MacOS ScreenSharing (Apple Remote Desktop) • Similar to VNC but encrypted
  • 31. Synergy • Synergy is a mouse and keyboard sharing software • Cross platform • Two Versions: Basic and Pro • Pro uses SSL encryption, basic doesn’t • Synergy 2 now uses SSL for Basic and Pro • Released after my exploit tool, unknown if this research was motivator
  • 32. Synergy 1 vs Synergy 2
  • 34. Monitoring Keystrokes • Just like the other protocols, keystroke monitoring is super easy • 9 lines of Python with Scapy MITM Required
  • 35. Synergy Hijacking • Different attack path - instead of impersonating a client, we will impersonate a server • The server sends the keystroke data to the clients • Client connects to the server to receive commands • Client configures the server to use via IP address, hostname, or Auto-config (via Bonjour) • Autoconfig will connect to any available Synergy server
  • 37. Hijacking with ARP Spoofing • Identify the IP address of any Synergy clients and servers via Bonjour • Assume the IP of the real Synergy server • ARP spoof the victim to make it think you now have that IP • The connection will break, and attempt to re-connect • The victim will accept commands from the fake server
  • 38. Hijacking with ARP Spoofing Rogue*
  • 39. Mitigation • Use Synergy Pro, Or Synergy 2 • These encrypt the commands with SSL • Must verify the server fingerprint before connecting
  • 40. Conclusion • Encrypt all the things • Don’t be afraid to do your own research • Attack Tools • Dissonance - Rogue Synergy Server • https://github.com/n00py/Dissonance • AngryHippo - HippoRemote Hacking Toolset • https://github.com/n00py/AngryHippo • All tools are made with Python - if you don’t know how to script, you should learn https://www.n00py.io