Chapter 4 Hacking Windows Part 2. Authenticated Attacks Privilege Escalation Pilfering –Grabbing the Password Hashes –Cracking Passwords –LSADump –Previous.

Slides:



Advertisements
Similar presentations
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 7: Troubleshoot Security Settings and Local Security.
Advertisements

1 Chapter 8 Fundamentals of System Security. 2 Objectives In this chapter, you will: Understand the trade-offs among security, performance, and ease of.
Securing. Agenda  Hard Drive Encryption  User Account Permissions  Root Level Access  Firewall Protection  Malware Protection.
Module 6: Configuring Windows XP Professional to Operate in a Microsoft Network.
Password CrackingSECURITY INNOVATION © Sidebar – Password Cracking We have discussed authentication mechanisms including authenticators. We also.
Configuring Windows Vista Security Chapter 3. IE7 Pop-up Blocker Pop-up Blocker prevents annoying and sometimes unsafe pop-ups from web sites Can block.
Chapter 7 HARDENING SERVERS.
Chapter 6: Configuring Security. Options for Managing Security Configurations LGPO (Local Group Policy Object) –Used if Computer is not part of a domain.
Chapter 6: Configuring Security. Group Policy and LGPO Setting Options Software Installation not available with LGPOs Remote Installation Services Scripts.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 10: Server Administration.
7-Access Control Fundamentals Dr. John P. Abraham Professor UTPA.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 14: Problem Recovery.
Hacking Windows 2K, XP. Windows 2K, XP Review: NetBIOS name resolution. SMB - Shared Message Block - uses TCP port 139, and NBT - NetBIOS over TCP/IP.
Principles of Computer Security: CompTIA Security + ® and Beyond, Second Edition © 2010 Baselines Chapter 14.
Working with Applications Lesson 7. Objectives Administer Internet Explorer Secure Internet Explorer Configure Application Compatibility Configure Application.
MS systems use one of the following: LanManager Hash (LM) LanManager Hash (LM) NT LanManager (NTLM) NT LanManager (NTLM) Cached passwords Cached passwords.
70-270: MCSE Guide to Microsoft Windows XP Professional Chapter 5: Users, Groups, Profiles, and Policies.
Chapter 6 Enumeration Modified Objectives  Describe the enumeration step of security testing  Enumerate Microsoft OS targets  Enumerate NetWare.
Forensic Artifacts From A Pass The Hash (PtH) Attack
WARNING! Sample chapter -Materials in this sample chapter is selected advanced penetration from
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.1 ISP Responsibility Working at a Small-to-Medium Business or ISP – Chapter 8.
Securing Windows 7 Lesson 10. Objectives Understand authentication and authorization Configure password policies Secure Windows 7 using the Action Center.
Windows This presentation is an amalgam of presentations by Mark Michael, Randy Marchany and Ed Skoudis. I have edited and added material. Dr. Stephen.
Chapter-4 Windows 2000 Professional Win2K Professional provides a very usable interface and was designed for use in the desktop PC. Microsoft server system.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 9: Implementing and Using Group Policy.
70-270: MCSE Guide to Microsoft Windows XP Professional Second Edition, Enhanced Chapter 6: Windows XP Security and Access Controls.
Enforcing Concurrent Logon Policies with UserLock.
Chapter 4 System Hacking: Password Cracking, Escalating Privileges, & Hiding Files.
System Hacking Techniques
Chapter 4 Hacking Windows Last modified: Reasons for Windows Security Problems Popularity & Complexity Backward Compatibility –Very important.
Week #7 Objectives: Secure Windows 7 Desktop
Chapter Six Windows XP Security and Access Controls.
CIS 450 – Network Security Chapter 16 – Covering the Tracks.
Troubleshooting Windows Vista Security Chapter 4.
Module 14: Configuring Server Security Compliance
Section 1: Introducing Group Policy What Is Group Policy? Group Policy Scenarios New Group Policy Features Introduced with Windows Server 2008 and Windows.
Module 7: Fundamentals of Administering Windows Server 2008.
CSAS 2009 Running Windows as a Non- Administrator or how I learned to love “User” By: Kasey Dennler.
Computer Security and Penetration Testing Chapter 16 Windows Vulnerabilities.
1 Chapter Overview Configuring Account Policies Configuring User Rights Configuring Security Options Configuring Internet Options.
Chapter 13 Users, Groups Profiles and Policies. Learning Objectives Understand Windows XP Professional user accounts Understand the different types of.
COEN 250 Computer Forensics Windows Life Analysis.
Lesson 17-Windows 2000/Windows 2003 Server Security Issues.
70-270: MCSE Guide to Microsoft Windows XP Professional 1 Windows XP Professional User Accounts Designed for use as a network client for: Windows NT Windows.
Windows Vista Inside Out Ch 10: Ch 10: Security Essentials Last modified
System Hacking Active System Intrusion. Aspects of System Hacking System password guessing Password cracking Key loggers Eavesdropping Sniffers Man in.
Planning a Microsoft Windows 2000 Administrative Structure Designing default administrative group membership Designing custom administrative groups local.
Chapter 4 Hacking Windows Last modified: Reasons for Windows Security Problems Popularity & Complexity Backward Compatibility –Very important.
Hacking Windows and Windows Security Lesson 10. Windows 9X/Me/NT There are still some folks out there using Windows 95 and 98, ME, 2000, and NT. Remote.
Guide to MCSE , Second Edition, Enhanced1 The Windows XP Security Model User must logon with: Valid user ID Password User receives access token Access.
Module 14: Securing Windows Server Overview Introduction to Securing Servers Implementing Core Server Security Hardening Servers Microsoft Baseline.
Ch 17 Securing the File System. Three Ways to Protect Files NTFS Permissions Encrypting File Service BitLocker full-disk encryption – BitLocker ToGo.
COEN 250 Computer Forensics Windows Life Analysis.
Hacking Windows 9X/ME. Hacking framework Initial access physical access brute force trojans Privilege escalation Administrator, root privileges Consolidation.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory, Enhanced Chapter 11: Group Policy for Corporate Policy.
Hacking Windows What to do first?  Patch : of course the first thing to do is apply SP3 and the critical updates. More will come …critical updates.
Module 4 Planning for Group Policy. Module Overview Planning Group Policy Application Planning Group Policy Processing Planning the Management of Group.
TCOM Information Assurance Management System Hacking.
Hands-On Ethical Hacking and Network Defense
Ethical Hacking: Defeating Logon Passwords. 2 Contact Sam Bowne Sam Bowne Computer Networking and Information Technology Computer Networking and Information.
Securing a Host Computer BY STEPHEN GOSNER. Definition of a Host  Host  In networking, a host is any device that has an IP address.  Hosts include.
By the end of this lesson you will be able to: 1. Determine the preventive support measures that are in place at your school.
Hacking Windows.
Enumeration.
Working at a Small-to-Medium Business or ISP – Chapter 8
I have edited and added material.
Configuring Windows Firewall with Advanced Security
Lesson 16-Windows NT Security Issues
Windows Vista Inside Out
Presentation transcript:

Chapter 4 Hacking Windows Part 2

Authenticated Attacks Privilege Escalation Pilfering –Grabbing the Password Hashes –Cracking Passwords –LSADump –Previous Logon Cache Dump Remote Control and Back Doors Port Redirection Countermeasures Covering Tracks

Privilege Escalation Once a user can log on to a Windows machine as a Guest or Limited User, the next goal is to escalate privileges to Administrator or SYSTEM –Getadmin was an early exploit (link Ch 4r) –There have been many others, including a buffer overrun MS (link Ch 4s)

SYSTEM status The SYSTEM account is more powerful than the Administrator account The Administrator can schedule tasks to be performed as SYSTEM –It's more complicated in Vista, but still possible

Making a SYSTEM Task in Vista Start, Task Scheduler Action, Create Task Change User or Group, select SYSTEM Fill in wizard, notepad.exe You can see it in Task Manager, but it's not interactive (see link Ch 4t)

Preventing Privilege Escalation Keep machines patched Restrict interactive logon to trusted accounts –Start, secpol.msc –Deny log on locally

Pilfering Once Administrator-equivalent status has been obtained on one machine Attackers try to gather important information – pilfering Common Targets –Password hashes –LSA Secrets –Previous Logon Cache

Grabbing the Password Hashes Stored in in the Windows Security Accounts Manager (SAM) under NT4 and earlier, and In the Active Directory on Windows 2000 and greater domain controllers (DCs) The SAM contains the usernames and hashed passwords of all users –The counterpart of the /etc/passwd file from the UNIX world

Obtaining the Hashes NT4 and earlier stores password hashes in %systemroot%\system32\config\SAM –It's locked as long as the OS is running –It's also in the Registry key HKEY_LOCAL_MACHINE\ SAM On Windows 2000 and greater domain controllers, password hashes are kept in the Active Directory –%windir%\WindowsDS\ntds.dit

How to Get the Hashes Boot the target system to an alternate OS and copy the files to removable media Copy the backup of the SAM file created by the Repair Disk Utility –But this file is protected by SYSKEY encryption, which makes it harder to crack (perhaps impossible) –Note: SYSKEY also protects the original SAM But if you have Administrator access, SYSKEY can be cracked, unless you have moved the key off the computer –Links Ch 4u, 4v, 4w

How to Get the Hashes Sniff Windows authentication exchanges Extract the password hashes from a running system with pwdump2 –Can bypass SYSKEY protection –Injects a DLL into a highly privileged process in a running system –Link Ch 4x We'll use Ophcrack to do it

pwdump2 Countermeasures There is no defense against pwdump2, 3, 4, … But the attacker needs local Administrative rights to use them

Cracking Passwords The hash is supposed to be really difficult to reverse –NTLM hashes are really hard to break –But Windows still uses LM Hashes for backwards compatibility –They are turned off by default in Vista

Brute Force v. Dictionary There are two techniques for cracking passwords –Brute Force Tries all possible combinations of characters –Dictionary Tries all the words in a word list, such as able, baker, cow… May try variations such as ABLE, etc.

Password-Cracking Countermeasures Strong passwords – not dictionary words, long, complex Add non-printable ASCII characters like (NUM LOCK) ALT255 or (NUM LOCK) ALT-129

LSADump Local Security Authority (LSA) Secrets –Contains unencrypted logon credentials for external systems –Available under the Registry subkey of HKEY_LOCAL_MACHINE\SECURITY\Policy\ Secrets –Encrypted when the machine is off, but decrypted and retained in memory after login

Contents of LSA Secrets Service account passwords in plaintext. –Accounts in external domains Cached password hashes of the last ten users to log on to a machine FTP and web-user plaintext passwords Remote Access Services (RAS) dial-up account names and passwords Computer account passwords for domain access

Scary Demo Boot Win XP, log in with your usual Admin acct Change your password Use Cain to dump the LSA Secrets – your password is just right there in the DefaultPassword Log in as a different Administrator user The LSA Secrets show your other account's password! –Link Ch 4z01

Win XP Password in LSA Secrets

LSA Secrets Countermeasures There's not much you can do—Microsoft offers a patch but it doesn't help much –Microsoft KB Article ID Q (link Ch 4z02) Vista seems far less vulnerable Local Admin rights can lead to compromise of other accounts that machine has logged in to

Previous Logon Cache Dump If a domain member cannot reach the domain controller, it performs an offline logon with cached credentials The last ten domain logons are stored in the cache, in an encrypted and hashes form The tool CacheDump can reverse the encryption and get the hashed passwords –Download it at link Ch 4z03 –More info at links Ch 4z04, 4z05

CacheDump Results John the Ripper can crack these hashes with brute-force and dictionary attacks –Another cracking tool is cachebf (link Ch z06)

Previous Logon Cache Dump Countermeasures You need Administrator or SYSTEM privileges to get the hashes You can also adjust the Registry to eliminate the cached credentials –But then users won't be able to log in when a when a domain controller is not accessible

Remote Control and Back Doors Command-line Remote Control Tools Netcat for Windows –Download it at link Ch 3d –Use this syntax to listen on port 8080, and execute cmd –Add –d for stealth mode (no interactive console) –Obviously this is very dangerous—remote control with no logon

Connecting to the nc Listener On another machine connect with –TELNET IP 8080 –You get a shell on the other machine –Works on Vista

PsExec From SysInternals (now part of Microsoft) Allows remote code execution (with a username and password) –Link Ch 4z07

Graphical Remote Control The Windows Built-in Terminal Services (aka Remote Desktop) listens on port 3389 –It's not on by default VNC is free and very commonly used for graphic remote control –Can easily be installed remotely –Link Ch 4z08

VNC as used in MetaSploit

Remote Access Trojans There are a lot of them, including –Poison Ivy (link Ch 4z09) –GoToMyPC (link Ch 4z10) –LogMeIn Hamachi (link Ch 4z11)

Remote Control Countermeasures Prevent attackers from gaining administrator rights on your machine You can find and stop running remote control clients with malware scans, looking for unusual network connections or traffic –It can be very hard if the connections are hidden by a rootkit

Port Redirection Fpipe is a port redirection tool from Foundstone –Link Ch 4z12

General Countermeasures to Authenticated Compromise Once a system has been compromised with administrator privileges, you should just reinstall it completely –You can never be sure you really found and removed all the backdoors But if you want to clean it, here are techniques:

Suspicious Files Known dangerous filenames like nc.exe Run antivirus software Use Tripwire or other tools that identify changes to system files –Link Ch 4z13

Suspicious Registry Entries Look for registry keys that start known backdoors like" –HKEY_USERS\.DEFAULT\Software\ ORL\WINVNC3 –HKEY_LOCAL_MACHINE\SOFTWARE\ Net Solutions\NetBus Server

A Back-Door Favorite: Autostart Extensibility Points (ASEPs)

Ways to Make a Program Run at Startup in Vista Registry keys –Run or RunOnce or Policies\Explorer\Run –Load value –RunServices or RunServicesOnce –Winlogon or BootExecute Scheduled Tasks Win.ini Group Policy Shell service objects Logon scripts

Suspicious Processes Process Explorer Link Ch 4z14

Suspicious Ports Use netstat -aon to view network connections

FPORT Process Mapper Doesn't work on Vista

Software Explorer Part of Windows Defender in Vista

Covering Tracks Once intruders have Administrator or SYSTEM-equivalent privileges, they will: –Hide evidence of intrusion –Install backdoors –Stash a toolkit to use for regaining control in the future and to use against other systems

Disabling Auditing The auditpol /disable command will stop auditing Auditpol /enable will turn it back on again –Auditpol is included in Vista –Part of the Resource Kit for earlier versions (XP, NT, 2000 Server)

Clearing the Event Log ELsave – command-line log clearing tool –Written for Windows NT –Link Ch 4z15

Hiding Files Attrib +h filename –Sets the Hidden bit, which hides files somewhat Alternate Data Streams –Hide a file within a file –A NT feature designed for compatibility with Macintosh

Demonstration of ADS

ADS With Binary Files You need the cp command (supposedly in the Resource Kit, although I can't find it available free online) To detect alternate data streams, use LADS (link Ch 4z16)

Rootkits Rootkits are the best way to hide files, accounts, backdoors, network connections, etc. on a machine More on rootkits in a later chapter

Windows Security Features Keep Up with Patches Group Policy –Allows customized security settings in domains IPSec filters can be used to block unwanted network traffic –Windows Firewall is easier to use –Windows Firewall With Advanced Security is greatly enhanced in Vista

Least Privilege Most Windows users use an Administrative accout all the time –Very poor for security, but convenient –For XP, 2003, and earlier: log on as a limited user, use runas to elevate privileges as needed –For Vista and Server 2008, this process is automated by User Account Control

Encrypting File System (EFS) Can encrypt files or folders This protects critical files from intruders In Vista, BitLocker Drive Encryption is much stronger –Only on Enterprise and Ultimate Edition –BUT: there is a way to crack BitLocker by taking the key out of RAM (link Ch 4z17)

Video: Hacking BitLocker

Last modified