SlideShare une entreprise Scribd logo
1  sur  34
Session ID:
Session Classification:
Hacking the future with
USB HID
Nikhil “SamratAshok” Mittal
Hacker




Session ID:
Session Classification:
About Me
 SamratAshok
 Twitter - @nikhil_mitt
 Blog – http://labofapenetrationtester.blogspot.com
 Creator of Kautilya, Mareech and Nishang
 Interested in Offensive Information Security, new attack
  vectors and methodologies to pwn systems.
 Previous Talks
     Clubhack’10, Hackfest’11, Clubhack’11, Black hat Abu
      Dhabi’11, Black Hat Europe’12, Troopers’12, PHDays’12, Black
      Hat USA’12
 Upcoming Talks
     Talk at EUSecWest’12
     Training at GrrCON’12
Agenda
   Human Interface Devices
   Using HIDs in Penetration Tests
   HID of choice – Teensy++
   How we will use Teensy++?
   Windows Family
   Mac OS X Family
   Kautilya
   Attacks Demo (on Windows 8 and Mountain Lion )
   Comparison
   Future of Attacks
   Limitation
   Defense
   Conclusion


                            4
A typical Pen Test Scenario


 A client engagement comes with IP addresses.
 We need to complete the assignment in very
  restrictive time frame.
 Pressure is on us to deliver a “good” report with
  some high severity findings. (That “High” return
  inside a red colored box)
How the threats are Tested




   Vuln
                Exploit      Report
   Scan
 This is a best case scenario.
 Only lucky ones find that.
 Generally legacy Enterprise Applications or
  Business Critical applications are not upgraded
  and are the first targets.
 There is almost no fun doing it that way.
Some of us do it better




 Enum        Scan         Exploit   Report
Some of us do it even better




 Enum
                            Post
   +      Scan    Exploit          Report
                            Exp
 Intel
Why do we need to exploit?
 To gain access to the systems.
 This shows the real threat to clients that we can
  actually make an impact on their business. No
  more “so-what” 
 We can create reports with “High” Severity
  findings which bring $$$
What do we exploit?
 Memory Corruption bugs.
     Server side
     Client Side
   Mis-configurations
   Open file shares.
   Sticky slips.
   Man In The Middle (many types)
   Unsecured Dumpsters
   Humans
   <Audience>
Worse Scenario
 Many times we get some vulnerabilities but can’t
  exploit.
     No public exploits available.
     Not allowed on the system.
     Countermeasure blocking it.
     Exploit completed but no session was generated :P
Worst Scenario
 Hardened Systems
 Patches in place
 Countermeasures blocking scans and exploits
 Security incident monitoring and blocking
 No network access


 We need alternatives.
Need for new methods to break into systems

 Breaking into systems is not as easy as done in
  the movies.
 Those defending the systems have become
  smarter and it is getting harder to break into
  “secured” environments.
 Everyone is breaking into systems using the
  older ways, you need new ways to do it better.
Human Interface Devices
 Wikipedia – “A human interface device or HID is
  a type of computer device that interacts directly
  with, and most often takes input from, humans
  and may deliver output to humans.”
 Mice, Keyboards and Joysticks are most
  common HID.
 What could go wrong?
Using HIDs in Penetration Tests
 Human Interface Devices are trusted by
  Operating Systems.
 Countermeasures like Anti Virus do not care for
  such devices.
 The way we use it, using HID for offensive
  security is equivalent to sitting in front of the
  target system as a user.
 The attack scenarios are large in number and
  may have severe impact.



                           16
HID of choice – Teensy++
 A USB Micro-controller device from pjrc.com
 Storage of about 130 KB.
 We will use Teensy ++ which is an updated
  version of Teensy.
 A cheap device, costs only $24.
 It uses an Atmel based
  processor.
HID of choice – Teensy++
 It could be used as Keyboard/Mouse/Joystick.
 The device is easily programmable using C or C
  type syntax using Arduino Development
  Environment with Teensyduino plugin.
 The device works with many Operating Systems.
 It is small in size.
How we will use Teensy++?
 As a programmable keyboard.
 We will program the device to do a defined set of
  activities when it is connected to a system.
 We will utilise the privileges of the currently
  logged in user and any higher privileges
  accessible to the user.
 Aim is to mimic a user sitting in front of the
  target.




                           19
Windows Family
 A user is notified when a new device is
  connected.
 It takes 20-25 seconds while the driver for the
  device gets loaded.
 A device can type really fast on Windows
  machine thanks to large USB keyboard buffer of
  Windows.
 If PowerShell is used some really powerful
  things could be done.



                         20
OS X Family
 A user is not notified if a USB device is
  connected.
 It takes 10-15 seconds while the device is
  detected and loaded.
 The device cannot type very fast.
 Built-in scripting languages make payloads
  powerful.




                          21
Kautilya
 It is a toolkit which aims to make HID more
  useful in Penetration Tests.
 Named after Chanakya a.k.a. Kautilya.
 Written in Ruby.
 It’s a menu drive program which let users select
  and customize payloads.
 Aims to make HID part of every Penetration
  tester’s tool chest.
 Contains payloads for Windows, Linux and OS
  X.
Payloads in Kautilya

 Payloads are tested on Teensy without SD Card.
 Pastebin is extensively used for uploads and
  downloads.
 Payloads are commands, powershell scripts or
  combination of both.
 Payload execution depends on privilege of user
  logged in when the device is plugged in.
Attacks Demo
(on Windows 8 and Mountain Lion )

 Let us have a look at three attacks on both
   Download and execute shellcode.
   Reverse shell using built-in features.
   DNS TXT Code Execution.




                            24
Comparison
Attribute                  Windows 8                   Mac OS X Mountain Lion

Detection or blocking of   Shows a balloon. Easy to    No information to user.
USB HIDs                   prevent installation of     Not easy to block a device.
                           removable devices using
                           Group policies.


Response to a very fast    Possible to send input      Delays must be introduced
keyboard input             really fast.                between the keyboard
                                                       inputs.

Trust on end user (as we   For sensitive functions a   Sudo is required for
are simulating one)        UAC prompt is shown.        sensitive functions.




                                       25
Pen Test Stories
Library Fun

 Internal PT for a large media house.
 The access to network was quite restrictive.
 The desktops at Library were left unattended
  many times.
 Teensy was plugged into one system with a
  sethc and utilman backdoor.
 Later in the evening the system was accessed
  and pwnage ensued.
Pen Test Stories
Breaking the perimeter

 A telecom company.
 A perimeter check for the firm was to be done.
 The Wireless rogue AP payload was used and
  Teensy was sold to the clients employees during
  lunch hours.
 Within couple of hours, we got a wireless
  network ready with an administrative user and a
  bind shell.
Pen Test Stories
Help by the Helpdesk
 A pharma company.
 A user’s data card was replcaed with a Teensy
  inside the data card’s cover.
 The payload selected was Keylogger.
 “Data card” obviously didn’t worked and multiple
  keyloggers were installed, for the user and the
  helpdesk.
 Helpdesk guys had access to almost everything
  in the environment and over a workday, it was
  over.
Limitations with Teensy
 Limited storage in Teensy. Resolved if you
  attach a SD card with Teensy.
 Inability to “read” from the system. You have to
  assume the responses of victim OS and there is
  only one way traffic.
 Inability to clear itself after a single run.
Limitations with Kautilya
 Many payloads need Administrative privilege.
 Lots of traffic to and from pastebin.
 Some times payloads are not stable.
 For payloads which use executables you
  manually need to convert and paste them to
  pastebin.
Future of Attacks
 Improvement in current payloads.
 Use some payloads as libraries so that they can
  be reused.
 More payloads for Non-Windows platform.
 Implementation of newer payloads.
 Reliable user activity detection.
Defence
 For Windows systems, use Group Policy to
  “Prevent Installation of Removable Devices”.
 For Mac OS X, udev rules may be used.
 Best defence is to physically block USB ports or
  lock the existing devices to the ports.




                         32
Conclusion
 USB HID attacks are real threats and here to
  stay.
 This is because Operating System trust itself
  and its users.
 Security ends with trust.




                         33
Thank You
 Questions?
 Insults?
 Feedback?

 Kautilya is available at
  http://code.google.com/p/kautilya/
 Follow me @nikhil_mitt
 http://labofapenetrationtester.blogspot.com/

Contenu connexe

Tendances

Abusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itAbusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itBenjamin Delpy
 
Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentTeymur Kheirkhabarov
 
Catch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueCatch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueWill Schroeder
 
Putting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You ArePutting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You AreKatie Nickels
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceDhruv Majumdar
 
ReCertifying Active Directory
ReCertifying Active DirectoryReCertifying Active Directory
ReCertifying Active DirectoryWill Schroeder
 
Hunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows EnvironmentHunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows EnvironmentTeymur Kheirkhabarov
 
PHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabTeymur Kheirkhabarov
 
Here Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLsHere Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLsAndy Robbins
 
Threat hunting and achieving security maturity
Threat hunting and achieving security maturityThreat hunting and achieving security maturity
Threat hunting and achieving security maturityDNIF
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShellWill Schroeder
 
Troopers 19 - I am AD FS and So Can You
Troopers 19 - I am AD FS and So Can YouTroopers 19 - I am AD FS and So Can You
Troopers 19 - I am AD FS and So Can YouDouglas Bienstock
 
Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...
Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...
Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...MITRE ATT&CK
 
Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat HuntingGIBIN JOHN
 
.LNK Tears of the Kingdom
.LNK Tears of the Kingdom.LNK Tears of the Kingdom
.LNK Tears of the KingdomMITRE ATT&CK
 
MITRE ATT&CK based Threat Analysis for Electronic Flight Bag
MITRE ATT&CK based Threat Analysis for Electronic Flight BagMITRE ATT&CK based Threat Analysis for Electronic Flight Bag
MITRE ATT&CK based Threat Analysis for Electronic Flight BagMITRE ATT&CK
 
OSINT for Proactive Defense - RootConf 2019
OSINT for Proactive Defense - RootConf 2019OSINT for Proactive Defense - RootConf 2019
OSINT for Proactive Defense - RootConf 2019RedHunt Labs
 
Adversary Emulation and Red Team Exercises - EDUCAUSE
Adversary Emulation and Red Team Exercises - EDUCAUSEAdversary Emulation and Red Team Exercises - EDUCAUSE
Adversary Emulation and Red Team Exercises - EDUCAUSEJorge Orchilles
 

Tendances (20)

Abusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itAbusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get it
 
Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows Environment
 
Catch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueCatch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs Blue
 
Putting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You ArePutting MITRE ATT&CK into Action with What You Have, Where You Are
Putting MITRE ATT&CK into Action with What You Have, Where You Are
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat Intelligence
 
ReCertifying Active Directory
ReCertifying Active DirectoryReCertifying Active Directory
ReCertifying Active Directory
 
Hunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows EnvironmentHunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows Environment
 
How fun of privilege escalation Red Pill2017
How fun of privilege escalation  Red Pill2017How fun of privilege escalation  Red Pill2017
How fun of privilege escalation Red Pill2017
 
PHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On Lab
 
Here Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLsHere Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLs
 
Threat hunting and achieving security maturity
Threat hunting and achieving security maturityThreat hunting and achieving security maturity
Threat hunting and achieving security maturity
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShell
 
Troopers 19 - I am AD FS and So Can You
Troopers 19 - I am AD FS and So Can YouTroopers 19 - I am AD FS and So Can You
Troopers 19 - I am AD FS and So Can You
 
Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...
Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...
Driving Intelligence with MITRE ATT&CK: Leveraging Limited Resources to Build...
 
Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
 
.LNK Tears of the Kingdom
.LNK Tears of the Kingdom.LNK Tears of the Kingdom
.LNK Tears of the Kingdom
 
MITRE ATT&CK based Threat Analysis for Electronic Flight Bag
MITRE ATT&CK based Threat Analysis for Electronic Flight BagMITRE ATT&CK based Threat Analysis for Electronic Flight Bag
MITRE ATT&CK based Threat Analysis for Electronic Flight Bag
 
OSINT for Proactive Defense - RootConf 2019
OSINT for Proactive Defense - RootConf 2019OSINT for Proactive Defense - RootConf 2019
OSINT for Proactive Defense - RootConf 2019
 
Adversary Emulation and Red Team Exercises - EDUCAUSE
Adversary Emulation and Red Team Exercises - EDUCAUSEAdversary Emulation and Red Team Exercises - EDUCAUSE
Adversary Emulation and Red Team Exercises - EDUCAUSE
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 

En vedette

Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devicesNikhil Mittal
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration TestersNikhil Mittal
 
Ae rio 2011 prof. courtnay- publico
Ae rio 2011   prof. courtnay- publicoAe rio 2011   prof. courtnay- publico
Ae rio 2011 prof. courtnay- publicoFernando Botafogo
 
AE Rio 2011 - Arquitetura da Informação organizacional
AE Rio 2011 - Arquitetura da Informação organizacionalAE Rio 2011 - Arquitetura da Informação organizacional
AE Rio 2011 - Arquitetura da Informação organizacionalFernando Botafogo
 
Continuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friendsContinuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friendsNikhil Mittal
 
Aula 1. arquitetura organizacional.pptm
Aula 1.   arquitetura organizacional.pptmAula 1.   arquitetura organizacional.pptm
Aula 1. arquitetura organizacional.pptmClaudio Parra
 
Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)
Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)
Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)Rafael Targino
 
Governança da Arquitetura Corporativa
Governança da Arquitetura CorporativaGovernança da Arquitetura Corporativa
Governança da Arquitetura CorporativaMarcelo Sávio
 
Powerpreter: Post Exploitation like a Boss
Powerpreter: Post Exploitation like a BossPowerpreter: Post Exploitation like a Boss
Powerpreter: Post Exploitation like a BossNikhil Mittal
 
Workshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration TestersWorkshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration TestersNikhil Mittal
 
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItAMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItNikhil Mittal
 

En vedette (13)

Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devices
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration Testers
 
Conceitos Ae
Conceitos AeConceitos Ae
Conceitos Ae
 
Ae rio 2011 prof. courtnay- publico
Ae rio 2011   prof. courtnay- publicoAe rio 2011   prof. courtnay- publico
Ae rio 2011 prof. courtnay- publico
 
AE Rio 2011 - Arquitetura da Informação organizacional
AE Rio 2011 - Arquitetura da Informação organizacionalAE Rio 2011 - Arquitetura da Informação organizacional
AE Rio 2011 - Arquitetura da Informação organizacional
 
Arquitetura.corporativa
Arquitetura.corporativaArquitetura.corporativa
Arquitetura.corporativa
 
Continuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friendsContinuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friends
 
Aula 1. arquitetura organizacional.pptm
Aula 1.   arquitetura organizacional.pptmAula 1.   arquitetura organizacional.pptm
Aula 1. arquitetura organizacional.pptm
 
Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)
Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)
Proposta de um Processo de Arquitetura Corporativa (Enterprise Architecture)
 
Governança da Arquitetura Corporativa
Governança da Arquitetura CorporativaGovernança da Arquitetura Corporativa
Governança da Arquitetura Corporativa
 
Powerpreter: Post Exploitation like a Boss
Powerpreter: Post Exploitation like a BossPowerpreter: Post Exploitation like a Boss
Powerpreter: Post Exploitation like a Boss
 
Workshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration TestersWorkshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration Testers
 
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItAMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
 

Similaire à Hacking the future with USB HID

Teensy Programming for Everyone
Teensy Programming for EveryoneTeensy Programming for Everyone
Teensy Programming for EveryoneNikhil Mittal
 
More fun using Kautilya
More fun using KautilyaMore fun using Kautilya
More fun using KautilyaNikhil Mittal
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shellNikhil Mittal
 
Mere Paas Teensy Hai (Nikhil Mittal)
Mere Paas Teensy Hai (Nikhil Mittal)Mere Paas Teensy Hai (Nikhil Mittal)
Mere Paas Teensy Hai (Nikhil Mittal)ClubHack
 
Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...
Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...
Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...AI Frontiers
 
The Media Access Control Address
The Media Access Control AddressThe Media Access Control Address
The Media Access Control AddressAngie Lee
 
The Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A PrimerThe Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A Primeramiable_indian
 
Derby con 2014
Derby con 2014Derby con 2014
Derby con 2014TonikJDK
 
Dev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT SecurityDev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT SecurityMario Heiderich
 
01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network Security01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network SecurityHarish Chaudhary
 
Avoid embarrassing press by designing secure IoT products with Misha Seltzer
Avoid embarrassing press by designing secure IoT products with Misha SeltzerAvoid embarrassing press by designing secure IoT products with Misha Seltzer
Avoid embarrassing press by designing secure IoT products with Misha SeltzerProduct of Things
 
A pinguin as a bouncer... Open Source Security Solutions
A pinguin as a bouncer... Open Source Security SolutionsA pinguin as a bouncer... Open Source Security Solutions
A pinguin as a bouncer... Open Source Security SolutionsB.A.
 
Cyber Security and GDPR Made Easy
Cyber Security and GDPR Made EasyCyber Security and GDPR Made Easy
Cyber Security and GDPR Made EasyChristoanSmit
 
Rootkit Hunting & Compromise Detection
Rootkit Hunting & Compromise DetectionRootkit Hunting & Compromise Detection
Rootkit Hunting & Compromise Detectionamiable_indian
 
Building Trust Despite Digital Personal Devices
Building Trust Despite Digital Personal DevicesBuilding Trust Despite Digital Personal Devices
Building Trust Despite Digital Personal DevicesJavier González
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface DevicePositive Hack Days
 
Bsides Tampa Blue Team’s tool dump.
Bsides Tampa Blue Team’s tool dump.Bsides Tampa Blue Team’s tool dump.
Bsides Tampa Blue Team’s tool dump.Alexander Kot
 
amrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdfamrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdfamrapalibuildersreviews
 
IoT Security Briefing FBI 07 23-2017 final
IoT Security Briefing FBI 07 23-2017 finalIoT Security Briefing FBI 07 23-2017 final
IoT Security Briefing FBI 07 23-2017 finalFrank Siepmann
 

Similaire à Hacking the future with USB HID (20)

Teensy Programming for Everyone
Teensy Programming for EveryoneTeensy Programming for Everyone
Teensy Programming for Everyone
 
More fun using Kautilya
More fun using KautilyaMore fun using Kautilya
More fun using Kautilya
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shell
 
Mere Paas Teensy Hai (Nikhil Mittal)
Mere Paas Teensy Hai (Nikhil Mittal)Mere Paas Teensy Hai (Nikhil Mittal)
Mere Paas Teensy Hai (Nikhil Mittal)
 
Broken by design (Danny Fullerton)
Broken by design (Danny Fullerton)Broken by design (Danny Fullerton)
Broken by design (Danny Fullerton)
 
Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...
Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...
Rajarshi Gupta at AI Frontiers : Security is AI’s biggest challenge, AI is Se...
 
The Media Access Control Address
The Media Access Control AddressThe Media Access Control Address
The Media Access Control Address
 
The Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A PrimerThe Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A Primer
 
Derby con 2014
Derby con 2014Derby con 2014
Derby con 2014
 
Dev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT SecurityDev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT Security
 
01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network Security01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network Security
 
Avoid embarrassing press by designing secure IoT products with Misha Seltzer
Avoid embarrassing press by designing secure IoT products with Misha SeltzerAvoid embarrassing press by designing secure IoT products with Misha Seltzer
Avoid embarrassing press by designing secure IoT products with Misha Seltzer
 
A pinguin as a bouncer... Open Source Security Solutions
A pinguin as a bouncer... Open Source Security SolutionsA pinguin as a bouncer... Open Source Security Solutions
A pinguin as a bouncer... Open Source Security Solutions
 
Cyber Security and GDPR Made Easy
Cyber Security and GDPR Made EasyCyber Security and GDPR Made Easy
Cyber Security and GDPR Made Easy
 
Rootkit Hunting & Compromise Detection
Rootkit Hunting & Compromise DetectionRootkit Hunting & Compromise Detection
Rootkit Hunting & Compromise Detection
 
Building Trust Despite Digital Personal Devices
Building Trust Despite Digital Personal DevicesBuilding Trust Despite Digital Personal Devices
Building Trust Despite Digital Personal Devices
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
Bsides Tampa Blue Team’s tool dump.
Bsides Tampa Blue Team’s tool dump.Bsides Tampa Blue Team’s tool dump.
Bsides Tampa Blue Team’s tool dump.
 
amrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdfamrapali builders @@hacking printers.pdf
amrapali builders @@hacking printers.pdf
 
IoT Security Briefing FBI 07 23-2017 final
IoT Security Briefing FBI 07 23-2017 finalIoT Security Briefing FBI 07 23-2017 final
IoT Security Briefing FBI 07 23-2017 final
 

Hacking the future with USB HID

  • 2. Hacking the future with USB HID Nikhil “SamratAshok” Mittal Hacker Session ID: Session Classification:
  • 3. About Me  SamratAshok  Twitter - @nikhil_mitt  Blog – http://labofapenetrationtester.blogspot.com  Creator of Kautilya, Mareech and Nishang  Interested in Offensive Information Security, new attack vectors and methodologies to pwn systems.  Previous Talks  Clubhack’10, Hackfest’11, Clubhack’11, Black hat Abu Dhabi’11, Black Hat Europe’12, Troopers’12, PHDays’12, Black Hat USA’12  Upcoming Talks  Talk at EUSecWest’12  Training at GrrCON’12
  • 4. Agenda  Human Interface Devices  Using HIDs in Penetration Tests  HID of choice – Teensy++  How we will use Teensy++?  Windows Family  Mac OS X Family  Kautilya  Attacks Demo (on Windows 8 and Mountain Lion )  Comparison  Future of Attacks  Limitation  Defense  Conclusion 4
  • 5. A typical Pen Test Scenario  A client engagement comes with IP addresses.  We need to complete the assignment in very restrictive time frame.  Pressure is on us to deliver a “good” report with some high severity findings. (That “High” return inside a red colored box)
  • 6. How the threats are Tested Vuln Exploit Report Scan
  • 7.  This is a best case scenario.  Only lucky ones find that.  Generally legacy Enterprise Applications or Business Critical applications are not upgraded and are the first targets.  There is almost no fun doing it that way.
  • 8. Some of us do it better Enum Scan Exploit Report
  • 9. Some of us do it even better Enum Post + Scan Exploit Report Exp Intel
  • 10. Why do we need to exploit?  To gain access to the systems.  This shows the real threat to clients that we can actually make an impact on their business. No more “so-what”   We can create reports with “High” Severity findings which bring $$$
  • 11. What do we exploit?  Memory Corruption bugs.  Server side  Client Side  Mis-configurations  Open file shares.  Sticky slips.  Man In The Middle (many types)  Unsecured Dumpsters  Humans  <Audience>
  • 12. Worse Scenario  Many times we get some vulnerabilities but can’t exploit.  No public exploits available.  Not allowed on the system.  Countermeasure blocking it.  Exploit completed but no session was generated :P
  • 13. Worst Scenario  Hardened Systems  Patches in place  Countermeasures blocking scans and exploits  Security incident monitoring and blocking  No network access  We need alternatives.
  • 14. Need for new methods to break into systems  Breaking into systems is not as easy as done in the movies.  Those defending the systems have become smarter and it is getting harder to break into “secured” environments.  Everyone is breaking into systems using the older ways, you need new ways to do it better.
  • 15. Human Interface Devices  Wikipedia – “A human interface device or HID is a type of computer device that interacts directly with, and most often takes input from, humans and may deliver output to humans.”  Mice, Keyboards and Joysticks are most common HID.  What could go wrong?
  • 16. Using HIDs in Penetration Tests  Human Interface Devices are trusted by Operating Systems.  Countermeasures like Anti Virus do not care for such devices.  The way we use it, using HID for offensive security is equivalent to sitting in front of the target system as a user.  The attack scenarios are large in number and may have severe impact. 16
  • 17. HID of choice – Teensy++  A USB Micro-controller device from pjrc.com  Storage of about 130 KB.  We will use Teensy ++ which is an updated version of Teensy.  A cheap device, costs only $24.  It uses an Atmel based processor.
  • 18. HID of choice – Teensy++  It could be used as Keyboard/Mouse/Joystick.  The device is easily programmable using C or C type syntax using Arduino Development Environment with Teensyduino plugin.  The device works with many Operating Systems.  It is small in size.
  • 19. How we will use Teensy++?  As a programmable keyboard.  We will program the device to do a defined set of activities when it is connected to a system.  We will utilise the privileges of the currently logged in user and any higher privileges accessible to the user.  Aim is to mimic a user sitting in front of the target. 19
  • 20. Windows Family  A user is notified when a new device is connected.  It takes 20-25 seconds while the driver for the device gets loaded.  A device can type really fast on Windows machine thanks to large USB keyboard buffer of Windows.  If PowerShell is used some really powerful things could be done. 20
  • 21. OS X Family  A user is not notified if a USB device is connected.  It takes 10-15 seconds while the device is detected and loaded.  The device cannot type very fast.  Built-in scripting languages make payloads powerful. 21
  • 22. Kautilya  It is a toolkit which aims to make HID more useful in Penetration Tests.  Named after Chanakya a.k.a. Kautilya.  Written in Ruby.  It’s a menu drive program which let users select and customize payloads.  Aims to make HID part of every Penetration tester’s tool chest.  Contains payloads for Windows, Linux and OS X.
  • 23. Payloads in Kautilya  Payloads are tested on Teensy without SD Card.  Pastebin is extensively used for uploads and downloads.  Payloads are commands, powershell scripts or combination of both.  Payload execution depends on privilege of user logged in when the device is plugged in.
  • 24. Attacks Demo (on Windows 8 and Mountain Lion )  Let us have a look at three attacks on both  Download and execute shellcode.  Reverse shell using built-in features.  DNS TXT Code Execution. 24
  • 25. Comparison Attribute Windows 8 Mac OS X Mountain Lion Detection or blocking of Shows a balloon. Easy to No information to user. USB HIDs prevent installation of Not easy to block a device. removable devices using Group policies. Response to a very fast Possible to send input Delays must be introduced keyboard input really fast. between the keyboard inputs. Trust on end user (as we For sensitive functions a Sudo is required for are simulating one) UAC prompt is shown. sensitive functions. 25
  • 26. Pen Test Stories Library Fun  Internal PT for a large media house.  The access to network was quite restrictive.  The desktops at Library were left unattended many times.  Teensy was plugged into one system with a sethc and utilman backdoor.  Later in the evening the system was accessed and pwnage ensued.
  • 27. Pen Test Stories Breaking the perimeter  A telecom company.  A perimeter check for the firm was to be done.  The Wireless rogue AP payload was used and Teensy was sold to the clients employees during lunch hours.  Within couple of hours, we got a wireless network ready with an administrative user and a bind shell.
  • 28. Pen Test Stories Help by the Helpdesk  A pharma company.  A user’s data card was replcaed with a Teensy inside the data card’s cover.  The payload selected was Keylogger.  “Data card” obviously didn’t worked and multiple keyloggers were installed, for the user and the helpdesk.  Helpdesk guys had access to almost everything in the environment and over a workday, it was over.
  • 29. Limitations with Teensy  Limited storage in Teensy. Resolved if you attach a SD card with Teensy.  Inability to “read” from the system. You have to assume the responses of victim OS and there is only one way traffic.  Inability to clear itself after a single run.
  • 30. Limitations with Kautilya  Many payloads need Administrative privilege.  Lots of traffic to and from pastebin.  Some times payloads are not stable.  For payloads which use executables you manually need to convert and paste them to pastebin.
  • 31. Future of Attacks  Improvement in current payloads.  Use some payloads as libraries so that they can be reused.  More payloads for Non-Windows platform.  Implementation of newer payloads.  Reliable user activity detection.
  • 32. Defence  For Windows systems, use Group Policy to “Prevent Installation of Removable Devices”.  For Mac OS X, udev rules may be used.  Best defence is to physically block USB ports or lock the existing devices to the ports. 32
  • 33. Conclusion  USB HID attacks are real threats and here to stay.  This is because Operating System trust itself and its users.  Security ends with trust. 33
  • 34. Thank You  Questions?  Insults?  Feedback?  Kautilya is available at http://code.google.com/p/kautilya/  Follow me @nikhil_mitt  http://labofapenetrationtester.blogspot.com/