Active Directory Security
Step-by-Step Guide
Part One

Buy Paperback $79.99

Active Directory Security
user
Kindle Customer

“This is probably the best OSCP book for privilege escalation out there. I love the step-by-step approach along with his easy-to-follow screenshots. Based on the level of difficulty the author laid out at the beginning of each chapter, I downloaded the setup scripts from the book website and worked with them to give me a feel of how Windows Privilege Escalation works at my own pace. Even though I don't have a strong programming background, with the detail of the screenshots and the clearly written instructions, this is something I feel comfortable doing without worrying about running out of lab time. ”

user
Cecil Elmore

“The author does a fantastic job of explaining and illustrating the steps hackers use to compromise systems and elevate privileges. And the author’s use of step-by-step instructions combined with ample screenshots makes the process clear - definitely a good reference book to have on hand throughout a pen testing engagement. Although the purpose of the book is to help readers pass the OSCP, any cybersecurity professional will benefit from stepping through the chapters of this book. Offense informs defense – and understanding how hackers break into systems enables us to be more effective at implementing defensive controls. I’m enjoying this book and can’t wait for the next in the series to come out!”

user
DORIS

“The book is nicely laid out and easy to understand. As other reviews mentioned, this book has tons of screenshots included and gave me a visual representation of what outputs are expected after each step. I was stuck in the scheduled tasks because there are so many Windows system tasks. The author provides a Powershell command in the book to narrow down the outputs and easily identify misconfigured tasks. Personally, I prefer to purchase a book to learn about pen testing than lab time. Can’t wait to read the next book in the series! ”

Active Directory Security: Part One

This book is the third of a series of How To Pass OSCP books and focuses on techniques used in Windows Active Directory (AD) and Privilege Escalation.

This book is a step-by-step guide that walks you through the whole process of how to identify active directory security issues and escalate privilege in the Windows environment using many common techniques. We start by gathering as much information about the target as possible either manually or using third-party tools, such as Responder, mitm6, PowerView, BloodHound, etc. Next, we search for misconfigurations in user rights, Kerberoasting, AS-REP Roasting, built-in vulnerabilities, generating Golden and Silver tickets, creating backdoor using DCShadow and DCSync, and many more.

Linux Privilege Escalation

About the Author

Alan Wang has over 20 years of experience in IT security and developing the standardized methodologies for the enterprise to drive business enabling cybersecurity programs and promote industry standards and risk-based investments to maximize business opportunity and minimize risk. He created a Digital Risk platform that enables enterprises across industries to manage business and cyber risks based on a foundation of good governance as well as risk optimization. Throughout his career, he also conducts and directs information security risk assessment efforts as well as provides risk assessment expertise on complex systems, and help organizations adopt a focused and business-driven approach when managing and mitigating cyber risks and threats.

About the Author

Active Directory Security: Part Two

This book is the fourth of a series of How To Pass OSCP books and focuses on techniques used in Windows Active Directory (AD) and Privilege Escalation.

Part two of the Active Directory (AD) Security will walk you through step-by-step how to identify active directory security issues and escalate privilege in the Windows environment using many common techniques. We start by gathering as much information about the target as possible either manually or using third-party tools, such as Responder, mitm6, PowerView, BloodHound, etc. Next, we search for misconfigurations in user rights and delegated permissions. The delegated permissions include unconstrained delegation, constrained delegation, and Resource-based Constrained delegation.

As more and more Domain Controllers (DC) run as a print server, we can implement RPC API calls and impersonate the DC to carry a DCYSnc attack and dump domain members’ hashes. On top of that, we can also exploit the Windows Print System Remote Protocol (MS-RPRN) vulnerability, known as Print Nightmare, to trick the print spooler to install a new driver from a DLL on an unc path. Once the DLL file is successfully loaded and give us the System privilege on the target machine.

Active Directory Security: Part Two

Windows Privilege Escalation

This book is the first of a series of How To Pass OSCP books and focus on techniques used in Windows Privilege Escalation.

This book is a step-by-step guide that walks you through the whole process of how to escalate privilege in Windows environment using many common techniques. We start by gathering as much information about the target as possible either manually or using automated scripts. Next, we search for misconfigured services or scheduled tasks, insufficient file permission on binaries or services, vulnerable kernel, vulnerable software running with high privileges, sensitive information stored on local files, credential saved in the memory, registry settings that always elevate privileges before executing a binary, hard-coded credential contained in the application configuration files, and many more.

Windows Privilege Escalation

Linux Privilege Escalation

This book is the second of a series of How To Pass OSCP books and focus on techniques used in Linux Privilege Escalation.

This book will walk you through the whole process of how to escalate privilege in a Linux environment using many common techniques. We start by gathering as much information about the target as possible either manually or using automated scripts. Next, we search for misconfigured Cron jobs, suid misconfiguration, bad path configuration, vulnerable kernel, vulnerable software running with high privileges, writable scripts invoked by root, sensitive information stored on local files, credentials saved in the memory, hard-coded credential contained in the application configuration files, and many more.

Linux Privilege Escalation

Table of Contents

Disclaimer: The author does not take responsibility for the way in which anyone uses this book as it made the purposes of the book very clear and it should not be used maliciously. The author has given warnings and provided recommendations to users that do not install and practice on the externally facing computers. If your computer is compromised via the installation of the script that come with this book, it is not the author's responsibility, it is the responsibility of the person/s who downloaded and installed it.

How to Read This Book: Since everyone's background and experience are different, the author wrote this book in the way that you can pick any chapter that sounds interesting to you and flip to it, rather than starting at the very beginning.

Please use howtopassoscp as the password to unzip the download files

If you have any questions, please contact us at support@howtopassoscp.com.

01

By default, Windows is configured to search for a Proxy Auto-Config (PAC) file via the Web Proxy Auto-Discovery (WPAD). Automatic discovery of the PAC file is useful in an organization without doing any configuration on the client. However, requesting a PAC file through WPAD does not require authentication of the user who is sending the proxying file, which allows an adversary to send a spoofed answer and ask for the user’s credential.

Download Exercise File
02

Password Spraying is a technique that brute-forcing the system using commonly used usernames and passwords. In a traditional brute force attack, the adversary attempts to gain unauthorized access to a single account by guessing the password repeatedly in a very short period of time. However, most organizations have employed countermeasures through their domain policy to lock out accounts after three to five failed attempts. By using the password spraying technique, the adversary can circumvent these common countermeasures, such as the account lockout, by spraying the same password across many accounts before trying another password.

Download Exercise File
03

PowerView is a PowerShell tool to enumerate and test security on Windows domains. It contains a set of pure-PowerShell replacements for various windows "net *" commands, which utilize PowerShell AD hooks and underlying Win32 API functions to perform useful Windows domain functionality. The recon module within PowerView toolset is a collection of PowerShell scripts that can be used to enumerate, update and create Active Directory objects during penetration testing.

Download Exercise File
04

An access control list (ACL) is a list of access control entries (ACE). Each ACE in an ACL identifies a trustee and specifies the access rights allowed, denied, or audited for that trustee. The security descriptor for a securable object can contain two types of ACLs: a DACL and a SACL. Windows uses structured and associated data known as Security Descriptor to identify the object's owner and primary group. The security descriptor contains the security information for a securable object. It may also contain a Discretionary Access Control List (DACL) that controls access to a user object, and a System Access Control List (SACL) that controls the logging of attempts to access the object.

05

An access control list (ACL) is a list of access control entries (ACE). Each ACE in an ACL identifies a trustee and specifies the access rights allowed, denied, or audited for that trustee. The security descriptor for a securable object can contain two types of ACLs: a DACL and a SACL. Windows uses structured and associated data known as Security Descriptor to identify the object's owner and primary group. The security descriptor contains the security information for a securable object. It may also contain a Discretionary Access Control List (DACL) that controls access to a group object, and a System Access Control List (SACL) that controls the logging of attempts to access the object.

06

BloodHound is a single-page Javascript web application, built on top of Linkurious, compiled with Electron, with a Neo4j database fed by a C# data collector. It is an application used to visualize active directory environments and reveal the hidden and often unintended relationships in an Active Directory environment.

Download Exercise File
07

A DC Sync exploit is a post-exploitation attack technique in which adversaries impersonate an Active Directory Domain Controller to obtain authentication credentials from other Domain Controllers. It requires adversaries to have replication privileges to a Domain Controller or domain administrator credentials.

Download Exercise File
08

Kerberoasting attack is a technique that allows an adversary to extract password hashes for the target’s active directory user accounts through their Service Principal Name (SPN) ticket. The technique can be carried out by any user on a domain, not just administrators. The Kerberos uses the New Technology LAN Manager (NTLM) hash of the requested service to encrypt the KRB_TGS ticket for a forgiven Service Principal Names (SPNs). When a domain user sent a request for a Ticket Granting Service (TGS) ticket to a Domain Controller Key Distribution Center (KDC) for any service that has registered SPN, the KDC generates the KRB_TGS without validating whether the user has access to the service.

Download Exercise File
09

AS-REP is a Kerberos message type that refers to an "Authentication Service" (AS) response message. It is transmitted between a Kerberos server and client as part of the exchange of credentials needed to access a service. To generate an AS-REP message, first, the Kerberos client asks Kerberos Domain Controller (KDC) for a Ticket Granting Ticket (TGT) and a session key that is needed to obtain credentials for other services.

Download Exercise File
10

The Golden Ticket is the Kerberos authentication token for the KRBTGT account, a special default account with the job of encrypting all the authentication tokens for the DC. Domain Controllers use the KRBTGT account password to decrypt Kerberos tickets for validation. This account password never changes, and the account name is the same in every domain. Once the adversaries obtained the KRBTGT account password hash, they can use it to forge valid Kerberos Ticket Granting Tickets (TGTs). This gives the adversary access to any resource on an Active Directory Domain, thus called “Golden Ticket”.

Download Exercise File
11

A Silver Ticket is a forged authentication ticket that allows you to log into some accounts. Adversaries who have the password hash of a target service account such as CIFS, SMB, MSSQL may forge Kerberos ticket granting service (TGS) tickets, also known as silver tickets. The reason adversaries can forge silver tickets is that Kerberos allows services (low-level Operating System programs) to log in without double-checking that their token is actually valid.

Download Exercise File
12

The Skeleton Key attack allows adversaries with physical access to the target system to gain control over the system by entering the injected password into the LSASS process. Once the password is injected successfully, it allows adversaries to bypass the standard authentication system to use the injected password for all accounts authenticating to that Domain Controller. And this is one of the attacks that is packaged and very easy to perform using Mimikatz.

13

A DC Shadow exploit is a post-exploitation attack technique in which adversaries register a rogue Active Directory Domain Controller and use that to inject malicious Active Directory objects, such as accounts or access control lists, into other Domain Controllers that are part of the same Active Directory infrastructure. It requires adversaries to obtain initial local administrator access to a Domain Controller, or domain administrator credentials.

14

ZeroLogon is an authentication bypass vulnerability (CVE-2020-1472) in the Netlogon Remote Protocol (MS-NRPC) that allows an adversary with a foothold on your internal network to essentially become Domain Admin by subverting Netlogon cryptography. Netlogon Remote Protocol is an interface that Windows uses to authenticate users and computers on domain-based networks and update their passwords in the Active Directory.

Download Exercise File
15

Group Policy preferences (GPP) allow administrators to create domain policies with embedded credentials and install Windows and application settings that were previously unavailable using Group Policy. These policies allow administrators to enable local accounts to make configuration changes to machines, such as creating local users, changing local administrator passwords, scheduling tasks and creating/updating services, etc.

Download Exercise File