Abusing Windows Remote Management with Metasploit David Maloney Metasploit Software Engineer Rapid7.

Slides:



Advertisements
Similar presentations
ActiveXperts Network Monitor Monitors servers, workstations and devices for availability Alerts and corrects.
Advertisements

Armitage and Metasploit Penetration Testing Lab
Offensive Security Part 1 Basics of Penetration Testing
Chapter 7 HARDENING SERVERS.
Great people, great experience, great passion Administering SharePoint with Windows PowerShell Go Beyond the Management Shell with SharePoint and Windows.
Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Real World Windows Azure Development – Tips & Tricks.
Browser Exploitation Framework (BeEF) Lab
Hacking Web Server Defiana Arnaldy, M.Si
CADRipper Pro Installation The CADRipper Pro is installed on either a 32-bit or 64-bit desktop computer running the latest updates for XP, Vista and Windows.
We have you by the gadgets Hitting your OS below the belt.
MIS Week 7 Site:
System Center 2012 R2 Windows Azure Pack Service Management Automation 101.
Nikto LUCA ALEXANDRA ADELA. Nikto  Web server assessment tool  Written by Chris Solo and David Lodge  Released on December 27, 2001  Stable release:
Task Scheduler Pro Managing scheduled tasks across the enterprise Joe Vachon Sales Engineer.
Smart Card Single Sign On with Access Gateway Enterprise Edition
Ins and Outs of Authenticating Users Requests to IIS 6.0 and ASP.NET Chris Adams Program Manager IIS Product Unit Microsoft Corporation.
AppCMD Quick Reference Guide for IIS 7 installed on Win2k8 Servers.
Administering Windows 7 Lesson 11. Objectives Troubleshoot Windows 7 Use remote access technologies Troubleshoot installation and startup issues Understand.
Remote Desktop Services Remote Desktop Connection Remote Desktop Protocol Remote Assistance Remote Server Administration T0ols.
MIS Week 2 Site:
Remote Administration Remote Desktop Remote Assistance Remote Server Administration Tools.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
IST 210 Web Application Security. IST 210 Introduction Security is a process of authenticating users and controlling what a user can see or do.
SharePoint 2010 Development Environment A Guide to Setup SharePoint 2010 Development Environment on Windows 7 Machine.
Virtual techdays INDIA │ august 2010 INVENTORY YOUR NETWORK AND CLIENTS WITH POWERSHELL Govindaraj Rangan │ Technology Strategist, Microsoft Corporation.
CCAT Troubleshooting Training XenApp April 2012 Citrix Consulting Architecture Team.
PowerShell Shenanigans Lateral Movement with PowerShell
Introduction to Windows PowerShell DANIEL HIBBERT PRIMER FIELD ENGINEER DMVMUG User Conference 2013 – Reston, VA.
Reinsel Kuntz Lesher, LLP.  Outline Overview  netstat -an (-ano will give the PID)  ftp  bin  mget  mput  telnet  telnet bobm.us 25  helo  mail.
Module 4 : Installation Jong S. Bok
POWERSHELL SHENANIGANS KIERAN JACOBSEN HP ENTERPRISE SERVICES.
Remote Administration Remote Desktop Remote Desktop Gateway Remote Assistance Windows Remote Management Service Remote Server Administration Tools.
Privilege separation in Condor Bruce Beckles University of Cambridge Computing Service.
Corey Hynes HynesITe, Inc Session Code: SRV317 Objectives Let you walk out of here, being able to run a script against an OU of computers, to make some.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
CNIT 124: Advanced Ethical Hacking Ch 10: Client-Side Exploitation.
MIS Week 7 Site:
Web Security. Introduction Webserver hacking refers to attackers taking advantage of vulnerabilities inherent to the web server software itself These.
Module 1A An Introduction to Metasploit – Based upon Chapter 2 of “Metasploit the Penetration testers guide” Based upon Chapter 2 of “Metasploit the Penetration.
Microsoft ® Lync™ Server 2010 Setup and Deployment Module 04 Microsoft Corporation.
MIS Week 5 Site:
EXCELLENCE AS STANDARD PowerShell Fu with Metasploit “Interactive PowerShell Sessions in Metasploit” 4 th July 2015 Presented to SteelCon Presented by.
©2014 CliftonLarsonAllen LLP CLAconnect.com See CLA PowerPoint User Guide for instructions to insert an image or change the icon on the business card.
Common System Exploits Tom Chothia Computer Security, Lecture 17.
Intercept X Early Access Program Sophos Tester
Intro to Ethical Hacking
Ssh: secure shell.
Hacking SQL Server a peek into the dark side by Dustin Prescott
Lesson 6: Configuring Servers for Remote Management
Module 38 (Driving Around on Windows)
PowerShell 2.0 Remoting Ravikanth C.
Network Exploitation Tool
Metasploit a one-stop hack shop
Intro to Ethical Hacking
Windows Administration using Python
CIT 480: Securing Computer Systems
Security Incident Response: Faster and Safer with PowerShell
Limiting SQL Server Exposure
Nessus Vulnerability Scanning
Windows PowerShell Remoting: Definitely NOT Just for Servers
Hybrid Search Planning Implementation.
Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting
Intro to Ethical Hacking
Web Application Penetration Testing ‘17
Limiting SQL Server Exposure
PowerShell Best Practices for SQL DBA’s
Mass Hunting and exploitation with powershell
Windows Remote Management
Bro, I Can See You Moving Laterally
Penetration Testing & Network Defense
Presentation transcript:

Abusing Windows Remote Management with Metasploit David Maloney Metasploit Software Engineer Rapid7

Introduction Windows Remote Management and Windows Remote Shell Why they’re interesting for penetration testers Abusing WinRM and WinRS Live demo Setting up your demo environment Pitfalls to watch out for Q&A 2 Agenda

Windows Remote Manangement Remote management service for Windows XP and higher: Installed but not enabled Can be installed on lower versions HTTP/S SOAP Listener Kerberos and NTLM authentication 3 Introducing WinRM and WinRS Windows Remote Shell WinRM’s twin sister Remote shell service for Windows HTTP/S SOAP Listener Kerberos and NTLM authentication

Additional attack vector on systems Especially WinRS surprisingly often enabled Avoid anti-virus detection Great alternative to PSExec module Why They Are Interesting to Penetration Testers 4

Find WinRM listeners on the network Metasploit module: use auxiliary/scanner/winrm/winrm_a uth_methods 5 Discovery

Bruteforce 6 Bruteforce credentials on WinRM service Accessing service requires credentials Supports Negotiate (NTLM) authentication Metasploit module: use auxiliary/scanner/winrm/winrm_lo gin

Running WMI Queries 7 WMI = Windows Management Instrumentation Execute arbitrary WQL (SQL for WMI) queries against target Find out architecture (32/64 bit) We’ll need the architecture later Metasploit module: use auxiliary/scanner/winrm_wql

Running Commands 8 Instantiate a shell Stateless shell over HTTP/SOAP Send Windows command Receive output streams STDOUT and STDERR Metasploit module: (use auxiliary/scanner/winrm/winrm_c md)

Two different payloads PowerShell 2.0  Checks if PowerShell 2.0 is available  Enables unrestricted script execution  Necessary to run unsigned script files VBS CmdStager  Activated if PowerShell 2.0 fails Metasploit Module: use exploit/windows/winrm/winrm_scr ipt_exec Problem: Shells expire after 5 minutes 9 Getting Shells

Writes payload into script file using Append-Content cmdlet and executes it Not flagged by any known AV solutions Pick correct architecture for payload Must migrate before shell expires Migrate –f doesn’t work because child processes also expire New smart_migrate module Migrates into existing winlogon.exe and explorer.exe Not child processes, so don’t expire Metasploit Module: use post/windows/manage/smart_migr ate 10 PowerShell 2.0

Is initiated if PowerShell 2.0 checks fail Writes two files to the file system Base64-encoded version of payload Vbscript to decode executable and launch the payload Less stealthy because it writes executable to file system Same migration needed – shell times out! 11 VBS CmdStager

Live Demo Abusing WinRM/WinRS with Metasploit 12

From command prompt: winrm quickconfig Default quickconfig setup is broken Will set AllowUnencrypted to False, i.e. non-SSL traffic will be refused However, will not set up HTTPS listener To fix Either set AllowUnencrypted to True Or set up HTTPS listener How To Set Up WinRM for Your Demo Environment (1) 13

If listener is HTTPS Set SSL to True Set SSLVersion to correct SSL Version Adjust RPORT Listener types WinRM: WMI WinRS: Remote Shell 14 How To Set Up WinRM for Your Demo Environment (2) Default Ports for WinRM Older VersionsNewer Versions HTTP HTTPS

Q&A David Maloney, Metasploit Software Engineer,