SlideShare uma empresa Scribd logo
1 de 41
PENTEST PREPPERS
WHOAMI
• Beau Bullock
• Pentester at Black Hills
Information Security
• OSCP, OSWP, GPEN,
GCIH, GCFA, and GSEC
• Previously an enterprise
defender
• Blogger
• Guitarist/Audio Engineer
• Homebrewer
BACKGROUND
• Privilege escalation has
been too easy
• No detection
• Unprivileged user to DA in <
60 seconds = Pentest
Apocalypse
• Fix the common issues and
low hanging fruit first
• Who needs a zero-day?
WHAT ARE YOU BUYING?
• Penetration test vs.
vulnerability
assessment
• If your scanner
results look like this
you don’t need a
pentest.
VULNERABILITY ASSESSMENT
• Help identify low-hanging fruit
• Typically broader in scope
• Locate and identify assets
• Opportunity to tune detection
devices
• Helps an organization
improve overall security
posture
PENETRATION TEST
• Goal driven
• Targeted escalation tactics
• Typically try to avoid
detection
• Can your security posture
withstand an advanced
attacker?
LET’S TALK ABOUT SOME COMMON
ISSUES
10 COMMON ISSUES
• 1. Missing Patches
• 2. Group Policy Preference Passwords
• 3. Widespread Local Administrator Accounts
• 4. Weak Password Policy
• 5. Overprivileged Users (admin of local host)
• 6. Overprivileged Users (admin of other hosts)
• 7. Sensitive Files on Shares
• 8. Information Disclosure on Intranet Sites
• 9. NetBIOS and LLMNR Poisoning
• 10. Local Workstation Privilege Escalation
PATCHES
• MS08-067
• MS14-068
• PsExec Patch
• ColdFusion Patches
• ShellShock
• Heartbleed
PATCHES WON’T FIX EVERYTHING
GROUP POLICY PREFERENCES (GPP)
• Extensions of Active Directory
• Configurable settings for use
with Group Policy Objects
• Advanced settings for folders,
mapped drives, and printers.
• Deploy applications
• Create a local administrator
account
http://www.dannyeckes.com/create-local-admin-group-policy-gpo/
GPP (CONTINUED)
• May 13, 2014 – MS14-025
• Passwords of accounts set by
GPP are trivially decrypted!
• …by ANY authenticated user
on the domain
• Located in groups.xml file on
SYSVOL
https://msdn.microsoft.com/en-us/library/2c15cbf0-f086-4c74-8b70-1f2fa45dd4be.aspx
http://blogs.technet.com/b/srd/archive/2014/05/13/ms14-025-an-update-for-group-policy-preferences.aspx
https://dirteam.com/sander/2014/05/23/security-thoughts-passwords-in-group-policy-preferences-cve-2014-1812/
GPP (WHAT DOES THE PATCH DO?)
• MS14-025 removes the ability
to create local accounts with
GPP
• Doesn’t remove previous
entries!
• You need to manually delete
these accounts
GPP (SUMMARY)
• First thing I check for on an
internal assessment
• Almost always find an admin
password here
• Find it with:
• PowerSploit - Get-GPPPassword
• Metasploit GPP Module
• Or…
C:>findstr /S cpassword %logonserver%sysvol*.xml
https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-GPPPassword.ps1
http://www.rapid7.com/db/modules/post/windows/gather/credentials/gpp
WIDESPREAD LOCAL ADMINISTRATOR ACCOUNT
• Makes it easy to pivot from workstation to workstation
• Using creds found via GPP:
• SMB_Login Metasploit Module
http://www.rapid7.com/db/modules/auxiliary/scanner/smb/smb_login
WIDESPREAD LOCAL ADMIN (CONTINUED)
• What’s next?
• Hunt for Domain Admins –
JoeWare NetSess, Veil-PowerView
UserHunter
• PsExec_psh Metasploit Module
• RDP?
• If we don’t have cleartext
creds:
• Pass-the-hash
http://www.joeware.net/freetools/tools/netsess/index.htm
https://www.veil-framework.com/hunting-users-veil-framework/
http://www.rapid7.com/db/modules/exploit/windows/smb/psexec_psh
PASSWORDS
• Default Passwords
• admin:admin
• tomcat:tomcat
• Pwnedlist
• Credentials from previous data
breaches
• Default 8 character password
policy?
• Password spraying
http://splashdata.com/press/worst-passwords-of-2014.htm
PASSWORD SPRAYING
• Domain locks out accounts after
a certain number of failed logins
• Can’t brute force a single users
password
• Solution:
• Try a number of passwords
less than the domain lockout
policy against EVERY
account in the domain
PASSWORD SPRAYING (CONTINUED)
• Lockout Policy = Threshold of
five
• Let’s try three or four passwords
• What passwords do we try?
• Password123
• Companyname123
• Etc.
@FOR /F %n in (users.txt) DO @FOR /F %p in (pass.txt) DO @net use
DOMAINCONTROLLERIPC$ /user:DOMAIN%n %p 1>NUL 2>&1 && @echo [*]
%n:%p && @net use /delete DOMAINCONTROLLERIPC$ > NUL
http://www.lanmaster53.com/
https://github.com/lukebaggett/powerspray
PASSWORD SPRAYING (CONTINUED)
PASSWORDS (CONTINUED)
• Increase password length
• Don’t make ridiculous policies
• Remember…
correcthorsebatterystaple
• Check PwnedList
• Password spray
http://xkcd.com/936/
OVERPRIVILEGED USERS
• Are your standard users
already local admins?
• This takes out a major
step of privilege escalation
• Only grant admin access
where necessary, not
globally
OVERPRIVILEGED USERS (OTHER HOSTS)
• Scenario:
• Unprivileged user wants to run
some software on their system
• User calls helpdesk
• Helpdesk attempts to get it
working for the user
• Fails
• Decides adding “Domain Users”
group to the local administrators
group is a good idea
OVERPRIVILEGED USERS (OTHER HOSTS)
• This means EVERY domain user is now is an administrator of
that system
• Veil-PowerView Invoke-FindLocalAdminAccess
• Veil-PowerView Invoke-ShareFinder
http://www.harmj0y.net/blog/penetesting/finding-local-admin-with-the-veil-framework/
WHAT INFORMATION CAN YOU LEARN FROM
USERS ON THE NETWORK?
FILES ON SHARES
• Sensitive files on shares?
• Find them with more PowerView
awesomeness…
• Use list generated by
ShareFinder with FileFinder
• FileFinder will find files with the
following strings in their title:
• ‘*pass*’, ‘*sensitive*’, ‘*admin*’,
‘*secret*’, ‘*login*’,
‘*unattend*.xml’, ‘*.vmdk’,
‘*creds*’, or ‘*credential*’
https://www.veil-framework.com/hunting-sensitive-data-veil-framework/
INFORMATION DISCLOSURE ON INTRANET
• Knowledge Bases are helpful
to employees… and attackers
• Helpdesk tickets
• How-to articles
• Emails
• Search functionality is our
best friend
• Search for <insert critical
infrastructure name, sensitive data
type, or ‘password’>
NETBIOS AND LLMNR POISONING
• LLMNR = Link-Local Multicast Name Resolution
• NBT-NS = NetBIOS over TCP/IP Name Service
• Both help hosts identify each other when DNS fails
http://www.sternsecurity.com/blog/local-network-attacks-llmnr-and-nbt-ns-poisoning
NETBIOS AND LLMNR (CONTINUED)
• SpiderLabs Responder
• Poisons NBT-NS and LLMNR
• The result is we obtain NTLM challenge/response hashes
• Crack hashes
https://github.com/Spiderlabs/Responder
https://www.trustwave.com/Resources/SpiderLabs-Blog/Introducing-Responder-1-0/
LOCAL WORKSTATION PRIVILEGE ESCALATION
• PowerUp!
• Another awesome Veil tool
• Invoke-AllChecks looks for potential privilege escalation vectors
http://www.verisgroup.com/2014/06/17/powerup-usage/
SUMMARY (10 COMMON ISSUES)
• 1. Missing Patches
• 2. Group Policy Preference Passwords
• 3. Widespread Local Administrator Accounts
• 4. Weak Password Policy
• 5. Overprivileged Users (admin of local host)
• 6. Overprivileged Users (admin of other hosts)
• 7. Sensitive Files on Shares
• 8. Information Disclosure on Intranet Sites
• 9. NetBIOS and LLMNR Poisoning
• 10. Local Workstation Privilege Escalation
NOW TO PREP YOUR PENTEST BUG OUT BAG
TUNE DETECTION DEVICES
• Test your network security
devices prior to a pentest for
common pentester activities
• Meterpreter shells
• Portscans
• Password spraying
PERFORM EGRESS FILTERING
• Block outbound access
except where needed
• Implement an authenticated
web proxy and force all web
traffic through it
THINGS THAT MAKE OUR JOB HARD
• Application Whitelisting
• Disabling PowerShell
• Network Access Control
• Network segmentation
• Fixing the items mentioned
earlier
THINGS NOT TO DO DURING A PENTEST
• Inform your teams that the
test is happening
• Monitor, but don’t interfere during
a pentest
• Enforce different policies on
the pentester than “normal”
users
• Alert users to an upcoming
phishing test
PENTEST PREPARATION GUIDE
PENTEST PREP GUIDE
• May help organizations
prepare for an upcoming
penetration test
• Details of the 10 issues I
talked about today
• How to identify
• How to remediate
CHECKLIST!
DOWNLOAD HERE
http://bit.ly/1FF33nH
QUESTIONS?
• Contact me
• Personal - beau@dafthack.com
• Work – beau@blackhillsinfosec.com
• Twitter - @dafthack
• Blog – www.dafthack.com

Mais conteúdo relacionado

Mais procurados

[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
CODE BLUE
 
Attack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration TestingAttack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration Testing
NetSPI
 

Mais procurados (20)

Red Team Apocalypse (RVAsec Edition)
Red Team Apocalypse (RVAsec Edition)Red Team Apocalypse (RVAsec Edition)
Red Team Apocalypse (RVAsec Edition)
 
Getting Started in Pentesting the Cloud: Azure
Getting Started in Pentesting the Cloud: AzureGetting Started in Pentesting the Cloud: Azure
Getting Started in Pentesting the Cloud: Azure
 
Travelocalypse: It's Dangerous Business, Hacker, Going Out Your Front Door
Travelocalypse: It's Dangerous Business, Hacker, Going Out Your Front DoorTravelocalypse: It's Dangerous Business, Hacker, Going Out Your Front Door
Travelocalypse: It's Dangerous Business, Hacker, Going Out Your Front Door
 
Security vulnerabilities decomposition
Security vulnerabilities decompositionSecurity vulnerabilities decomposition
Security vulnerabilities decomposition
 
BlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure AD
BlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure ADBlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure AD
BlueHat Seattle 2019 || I'm in your cloud: A year of hacking Azure AD
 
Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for Pentesting
 
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t HappenShopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
Shopify’s $25k Bug Report, and the Cluster Takeover That Didn’t Happen
 
Red Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite PerimeterRed Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite Perimeter
 
Attacker's Perspective of Active Directory
Attacker's Perspective of Active DirectoryAttacker's Perspective of Active Directory
Attacker's Perspective of Active Directory
 
Fade from Whitehat... to Black
Fade from Whitehat... to BlackFade from Whitehat... to Black
Fade from Whitehat... to Black
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNED
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
OAuth 2.0 Security Reinforced
OAuth 2.0 Security ReinforcedOAuth 2.0 Security Reinforced
OAuth 2.0 Security Reinforced
 
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
Top Security Challenges Facing Credit Unions Today
Top Security Challenges Facing Credit Unions TodayTop Security Challenges Facing Credit Unions Today
Top Security Challenges Facing Credit Unions Today
 
Automating Attacks Against Office365 - BsidesPDX 2016
Automating Attacks Against Office365 - BsidesPDX 2016Automating Attacks Against Office365 - BsidesPDX 2016
Automating Attacks Against Office365 - BsidesPDX 2016
 
DevSecCon Singapore 2019: Workshop - Burp extension writing workshop
DevSecCon Singapore 2019: Workshop - Burp extension writing workshopDevSecCon Singapore 2019: Workshop - Burp extension writing workshop
DevSecCon Singapore 2019: Workshop - Burp extension writing workshop
 
All You Need is One - A ClickOnce Love Story - Secure360 2015
All You Need is One -  A ClickOnce Love Story - Secure360 2015All You Need is One -  A ClickOnce Love Story - Secure360 2015
All You Need is One - A ClickOnce Love Story - Secure360 2015
 
Attack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration TestingAttack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration Testing
 

Semelhante a Pentest Apocalypse

Facing enterprise specific challenges – utility programming in hadoop
Facing enterprise specific challenges – utility programming in hadoopFacing enterprise specific challenges – utility programming in hadoop
Facing enterprise specific challenges – utility programming in hadoop
fann wu
 
SQL Server Clustering for Dummies
SQL Server Clustering for DummiesSQL Server Clustering for Dummies
SQL Server Clustering for Dummies
Mark Broadbent
 
Releasing To Production Every Week India
Releasing To Production Every Week   IndiaReleasing To Production Every Week   India
Releasing To Production Every Week India
exortech
 
Why internal pen tests are still fun
Why internal pen tests are still funWhy internal pen tests are still fun
Why internal pen tests are still fun
pyschedelicsupernova
 

Semelhante a Pentest Apocalypse (20)

Заполучили права администратора домена? Игра еще не окончена
Заполучили права администратора домена? Игра еще не оконченаЗаполучили права администратора домена? Игра еще не окончена
Заполучили права администратора домена? Игра еще не окончена
 
PENETRATION TESTING FROM A HOT TUB TIME MACHINE
PENETRATION TESTING FROM A HOT TUB TIME MACHINEPENETRATION TESTING FROM A HOT TUB TIME MACHINE
PENETRATION TESTING FROM A HOT TUB TIME MACHINE
 
System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Application
 
Blog World 2010 - How to Keep Your Blog from Being Hacked
Blog World 2010 - How to Keep Your Blog from Being HackedBlog World 2010 - How to Keep Your Blog from Being Hacked
Blog World 2010 - How to Keep Your Blog from Being Hacked
 
Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)Metasploitation part-1 (murtuja)
Metasploitation part-1 (murtuja)
 
Defcon 25 Packet Hacking Village - Finding Your Way to Domain Access
Defcon 25 Packet Hacking Village - Finding Your Way to Domain AccessDefcon 25 Packet Hacking Village - Finding Your Way to Domain Access
Defcon 25 Packet Hacking Village - Finding Your Way to Domain Access
 
Facing enterprise specific challenges – utility programming in hadoop
Facing enterprise specific challenges – utility programming in hadoopFacing enterprise specific challenges – utility programming in hadoop
Facing enterprise specific challenges – utility programming in hadoop
 
SQL Server Clustering for Dummies
SQL Server Clustering for DummiesSQL Server Clustering for Dummies
SQL Server Clustering for Dummies
 
Securing Windows with Group Policy
Securing Windows with Group PolicySecuring Windows with Group Policy
Securing Windows with Group Policy
 
WordPress Server Security
WordPress Server SecurityWordPress Server Security
WordPress Server Security
 
Elite Bug Squashing
Elite Bug SquashingElite Bug Squashing
Elite Bug Squashing
 
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
 
Releasing To Production Every Week India
Releasing To Production Every Week   IndiaReleasing To Production Every Week   India
Releasing To Production Every Week India
 
Breadcrumbs to Loaves: BSides Austin '17
Breadcrumbs to Loaves: BSides Austin '17Breadcrumbs to Loaves: BSides Austin '17
Breadcrumbs to Loaves: BSides Austin '17
 
Smart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSSmart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWS
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 
Why internal pen tests are still fun
Why internal pen tests are still funWhy internal pen tests are still fun
Why internal pen tests are still fun
 
Harnessing the Power of AI in AWS Pentesting.pdf
Harnessing the Power of AI in AWS Pentesting.pdfHarnessing the Power of AI in AWS Pentesting.pdf
Harnessing the Power of AI in AWS Pentesting.pdf
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Pentest Apocalypse

  • 2. WHOAMI • Beau Bullock • Pentester at Black Hills Information Security • OSCP, OSWP, GPEN, GCIH, GCFA, and GSEC • Previously an enterprise defender • Blogger • Guitarist/Audio Engineer • Homebrewer
  • 3. BACKGROUND • Privilege escalation has been too easy • No detection • Unprivileged user to DA in < 60 seconds = Pentest Apocalypse • Fix the common issues and low hanging fruit first • Who needs a zero-day?
  • 4. WHAT ARE YOU BUYING? • Penetration test vs. vulnerability assessment • If your scanner results look like this you don’t need a pentest.
  • 5. VULNERABILITY ASSESSMENT • Help identify low-hanging fruit • Typically broader in scope • Locate and identify assets • Opportunity to tune detection devices • Helps an organization improve overall security posture
  • 6. PENETRATION TEST • Goal driven • Targeted escalation tactics • Typically try to avoid detection • Can your security posture withstand an advanced attacker?
  • 7. LET’S TALK ABOUT SOME COMMON ISSUES
  • 8. 10 COMMON ISSUES • 1. Missing Patches • 2. Group Policy Preference Passwords • 3. Widespread Local Administrator Accounts • 4. Weak Password Policy • 5. Overprivileged Users (admin of local host) • 6. Overprivileged Users (admin of other hosts) • 7. Sensitive Files on Shares • 8. Information Disclosure on Intranet Sites • 9. NetBIOS and LLMNR Poisoning • 10. Local Workstation Privilege Escalation
  • 9. PATCHES • MS08-067 • MS14-068 • PsExec Patch • ColdFusion Patches • ShellShock • Heartbleed
  • 10. PATCHES WON’T FIX EVERYTHING
  • 11. GROUP POLICY PREFERENCES (GPP) • Extensions of Active Directory • Configurable settings for use with Group Policy Objects • Advanced settings for folders, mapped drives, and printers. • Deploy applications • Create a local administrator account http://www.dannyeckes.com/create-local-admin-group-policy-gpo/
  • 12. GPP (CONTINUED) • May 13, 2014 – MS14-025 • Passwords of accounts set by GPP are trivially decrypted! • …by ANY authenticated user on the domain • Located in groups.xml file on SYSVOL https://msdn.microsoft.com/en-us/library/2c15cbf0-f086-4c74-8b70-1f2fa45dd4be.aspx http://blogs.technet.com/b/srd/archive/2014/05/13/ms14-025-an-update-for-group-policy-preferences.aspx https://dirteam.com/sander/2014/05/23/security-thoughts-passwords-in-group-policy-preferences-cve-2014-1812/
  • 13. GPP (WHAT DOES THE PATCH DO?) • MS14-025 removes the ability to create local accounts with GPP • Doesn’t remove previous entries! • You need to manually delete these accounts
  • 14. GPP (SUMMARY) • First thing I check for on an internal assessment • Almost always find an admin password here • Find it with: • PowerSploit - Get-GPPPassword • Metasploit GPP Module • Or… C:>findstr /S cpassword %logonserver%sysvol*.xml https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-GPPPassword.ps1 http://www.rapid7.com/db/modules/post/windows/gather/credentials/gpp
  • 15. WIDESPREAD LOCAL ADMINISTRATOR ACCOUNT • Makes it easy to pivot from workstation to workstation • Using creds found via GPP: • SMB_Login Metasploit Module http://www.rapid7.com/db/modules/auxiliary/scanner/smb/smb_login
  • 16. WIDESPREAD LOCAL ADMIN (CONTINUED) • What’s next? • Hunt for Domain Admins – JoeWare NetSess, Veil-PowerView UserHunter • PsExec_psh Metasploit Module • RDP? • If we don’t have cleartext creds: • Pass-the-hash http://www.joeware.net/freetools/tools/netsess/index.htm https://www.veil-framework.com/hunting-users-veil-framework/ http://www.rapid7.com/db/modules/exploit/windows/smb/psexec_psh
  • 17. PASSWORDS • Default Passwords • admin:admin • tomcat:tomcat • Pwnedlist • Credentials from previous data breaches • Default 8 character password policy? • Password spraying http://splashdata.com/press/worst-passwords-of-2014.htm
  • 18. PASSWORD SPRAYING • Domain locks out accounts after a certain number of failed logins • Can’t brute force a single users password • Solution: • Try a number of passwords less than the domain lockout policy against EVERY account in the domain
  • 19. PASSWORD SPRAYING (CONTINUED) • Lockout Policy = Threshold of five • Let’s try three or four passwords • What passwords do we try? • Password123 • Companyname123 • Etc. @FOR /F %n in (users.txt) DO @FOR /F %p in (pass.txt) DO @net use DOMAINCONTROLLERIPC$ /user:DOMAIN%n %p 1>NUL 2>&1 && @echo [*] %n:%p && @net use /delete DOMAINCONTROLLERIPC$ > NUL http://www.lanmaster53.com/ https://github.com/lukebaggett/powerspray
  • 21. PASSWORDS (CONTINUED) • Increase password length • Don’t make ridiculous policies • Remember… correcthorsebatterystaple • Check PwnedList • Password spray http://xkcd.com/936/
  • 22. OVERPRIVILEGED USERS • Are your standard users already local admins? • This takes out a major step of privilege escalation • Only grant admin access where necessary, not globally
  • 23. OVERPRIVILEGED USERS (OTHER HOSTS) • Scenario: • Unprivileged user wants to run some software on their system • User calls helpdesk • Helpdesk attempts to get it working for the user • Fails • Decides adding “Domain Users” group to the local administrators group is a good idea
  • 24. OVERPRIVILEGED USERS (OTHER HOSTS) • This means EVERY domain user is now is an administrator of that system • Veil-PowerView Invoke-FindLocalAdminAccess • Veil-PowerView Invoke-ShareFinder http://www.harmj0y.net/blog/penetesting/finding-local-admin-with-the-veil-framework/
  • 25. WHAT INFORMATION CAN YOU LEARN FROM USERS ON THE NETWORK?
  • 26. FILES ON SHARES • Sensitive files on shares? • Find them with more PowerView awesomeness… • Use list generated by ShareFinder with FileFinder • FileFinder will find files with the following strings in their title: • ‘*pass*’, ‘*sensitive*’, ‘*admin*’, ‘*secret*’, ‘*login*’, ‘*unattend*.xml’, ‘*.vmdk’, ‘*creds*’, or ‘*credential*’ https://www.veil-framework.com/hunting-sensitive-data-veil-framework/
  • 27. INFORMATION DISCLOSURE ON INTRANET • Knowledge Bases are helpful to employees… and attackers • Helpdesk tickets • How-to articles • Emails • Search functionality is our best friend • Search for <insert critical infrastructure name, sensitive data type, or ‘password’>
  • 28. NETBIOS AND LLMNR POISONING • LLMNR = Link-Local Multicast Name Resolution • NBT-NS = NetBIOS over TCP/IP Name Service • Both help hosts identify each other when DNS fails http://www.sternsecurity.com/blog/local-network-attacks-llmnr-and-nbt-ns-poisoning
  • 29. NETBIOS AND LLMNR (CONTINUED) • SpiderLabs Responder • Poisons NBT-NS and LLMNR • The result is we obtain NTLM challenge/response hashes • Crack hashes https://github.com/Spiderlabs/Responder https://www.trustwave.com/Resources/SpiderLabs-Blog/Introducing-Responder-1-0/
  • 30. LOCAL WORKSTATION PRIVILEGE ESCALATION • PowerUp! • Another awesome Veil tool • Invoke-AllChecks looks for potential privilege escalation vectors http://www.verisgroup.com/2014/06/17/powerup-usage/
  • 31. SUMMARY (10 COMMON ISSUES) • 1. Missing Patches • 2. Group Policy Preference Passwords • 3. Widespread Local Administrator Accounts • 4. Weak Password Policy • 5. Overprivileged Users (admin of local host) • 6. Overprivileged Users (admin of other hosts) • 7. Sensitive Files on Shares • 8. Information Disclosure on Intranet Sites • 9. NetBIOS and LLMNR Poisoning • 10. Local Workstation Privilege Escalation
  • 32. NOW TO PREP YOUR PENTEST BUG OUT BAG
  • 33. TUNE DETECTION DEVICES • Test your network security devices prior to a pentest for common pentester activities • Meterpreter shells • Portscans • Password spraying
  • 34. PERFORM EGRESS FILTERING • Block outbound access except where needed • Implement an authenticated web proxy and force all web traffic through it
  • 35. THINGS THAT MAKE OUR JOB HARD • Application Whitelisting • Disabling PowerShell • Network Access Control • Network segmentation • Fixing the items mentioned earlier
  • 36. THINGS NOT TO DO DURING A PENTEST • Inform your teams that the test is happening • Monitor, but don’t interfere during a pentest • Enforce different policies on the pentester than “normal” users • Alert users to an upcoming phishing test
  • 38. PENTEST PREP GUIDE • May help organizations prepare for an upcoming penetration test • Details of the 10 issues I talked about today • How to identify • How to remediate
  • 41. QUESTIONS? • Contact me • Personal - beau@dafthack.com • Work – beau@blackhillsinfosec.com • Twitter - @dafthack • Blog – www.dafthack.com