Lab‐9 ‐ AppLocker - jacobwilliams100/sec-440 GitHub Wiki

Prerequisites:

  • AD01 is running Active Directory and DNS

  • WKS01 is domain-joined

On my setup, these were done from a previous lab.

Part 1 - Installation

On ad01 log in as Administrator and go to Serve Manager->Group Policy Management

Under your domain in the left panel, create a new Organizational Unit called AppLocker

image

image

Now switch to Active Directory Users and Computers and move your normal domain user (jake in my case) and the WKS01 computer in the AppLocker OU

image

Back in Group Policy Management we want to create a new GPO

image

We will call it Applocker

image

Rclick AppLocker GPO -> Edit

image Then go to Computer Configuration->Policies->Windows Settings->Security Settings->Application Control Policies->AppLocker->Executable Rules->Rclick->Create Default Rules

image

Now Rclick->Create New Rule

image

On the second page, select Deny

image

Leave the Conditions page as-is, on Publisher

image

On the Publisher page, set Putty.exe in the Downloads folder as the Reference.

If you don't have it, download it from chiark.greenend.org.uk/~sgtatham/putty/latest.html

image

image

We need to designate an exception as well. We will use Internet Explorer (published by Microsoft).

image

Name it "Block EXEs" and click Create

image

Deliverable #1: Submit a screenshot showing your default rules and the deny .EXE rule added, as seen in the screenshot below:

image

Now, in the left panel, click "AppLocker" and then "Configure rule enforcement"

image

Check the box for "Configured" at the top, and click "OK"

image

Lastly, make sure to Enforce the new GPO

image

Last thing before you leave Group Policy Management Editor - Go to Computer Configuration->Policies->Windows Settings->Security Settings->System Services, right click Application Identity, Properties and select Automatic and Apply

image

image

You can now exit Group Policy Editor

Part #2 - Enable Application Identity Service

Still in Server Manager, go to Tools->Services

and start the Application Identity Service

image

It should be working now. Switch over to wks01 and log in as your named domain user (jake)

open a command prompt and run gpupdate /force

image

Try downloading from https://notepad-plus-plus.org/downloads/v7.8.8/

image

Then try running the installer

Deliverable #2: Submit a screenshot showing your test of installing Notepad++ being blocked on your Windows client.

image

At this point I encountered some unusual issues with GPO blocking normal actions on wks1 like using the start menu, and blocking the execution of any program no matter the location, even after I disabled the rules. So I ended up rolling back to snapshot and doing most of the lab again.

Deliverable #3: Create a rule that will block all applications running from a certain path (e.g. C:\Users<user>\Downloads). Provide the screenshots for the work done and tested on your Windows client.

This took me a long time to figure out.

Go back to Group Policy Management Editor->...->Applocker->Executable Rules

Since Applocker applies an implicite Deny All, we must first create an Allow All rule to make sure the rule doesn't affect executables outside downloads.

image

image

THEN we can create a Deny Rule for the path %OSDRIVE%\Users\*\Downloads\*

The * represents wildcard meaning anything can be in that space. Therefore, we are blocking execution from the Downloads folder for all users.

image

Then we must make some other tweaks to keep the rest of the system working properly.

Go to each of the other applocker Folders (Windows Installer Rules, Packaged app Rules, etc) and Create Default Rules for those too.

image

Then go back to AppLocker and Configure Role enforcement. Enable the Enforcement of all types of rules

image

Make sure Application identity services is running on both AD01 and WKS1

image

Then on WKS1 use an Administrator Command Prompt to run gpupdate /force again

image

Now it should be working. Running an exe from Downloads will result in this screen:

image

However, running it from a different directory such as Documents should be allowed (but possibly require elevation depending on your settings)

image

Deliverable #4: Create a rule that will block an application from running based on its hash value. Provide the screenshots for the work done and tested on your Windows client.

Let's say that due to company policy, we do not want users to run version 4.6 of Rufus (a utility for creating bootable USB drives)

On AD01 we will go back into Group Policy Management Editor and we will create a New Execution Rule based on Hash and select rufus-4.6p.exe

image

image

Now, back on WKS1, force a group policy update again

image

Now, if we try to run Rufus-4.6p it will outright deny it

image

However, if we try to run a different version such as Rufus-4.5p it will allow it (but may require elevation depending on settings)

image

image

Part #3 – Reflection

This lab was much more challenging than I thought it would be. The initial setup seemed to work as expected, however, starting in deliverbale 2, I began encountering unexpected issues, such as Applocker blocking executables in almost my entire system. I could not even open the start menu on WKS01. It took me a long time to realize that AppLocker would apply a "Deny All" rule by default, and if I only wanted to block a few things, then I needed to create an "Allow all" rule first, as the default rules only cover a few directories. I wish that it had been easier to find documentation on effective AppLocker policy and best practices, maybe it is something I will write about in the future. Through troubleshooting and figuring out how to configure AppLocker, I certainly learned a lot about Windows Group Policy, which I have not worked with as much as I would like. Despite all of the difficulties, I definitely enjoyed the challenge.

⚠️ **GitHub.com Fallback** ⚠️