Sysadmin Magazine March 2022 FR
Sysadmin Magazine March 2022 FR
Sysadmin Magazine March 2022 FR
Password Security:
Top Tips and Tactics
Contents SysAdmin Magazine March 2022
SysAdmin
Magazine Contents
70
3 5 Top Local Administrator Password Solution (LAPS) Tips
March ‘22
№
9 How to Set and Manage Active Directory Password Policy
2
Contents SysAdmin Magazine March 2022
5 Top Local
You can have the most complex password in the world, but Microsoft Local Administrator Password Solution (LAPS) is
once it is compromised on one machine, it is open season a Microsoft tool that gives AD administrators the ability to
for all other devices using the same local admin credentials. manage the local account password of domain-joined com-
Password Solution
tials for every Windows device, but that can prove highly When implemented via Group Policy, LAPS creates a ran-
time-consuming not to mention the task of inventorying dom password of a defined length and complexity that is
the many credential sets. The process becomes virtually cryptographically secure and different every time, on every
3
Contents SysAdmin Magazine March 2022
4
Contents SysAdmin Magazine March 2022
The next step is to create a computer side GPO. For this exam-
ple, I will call it LAPS Policy. The LAPS settings will now appear
Once configured, simply deploy the LAPS client-side-ex-
tension software via your desired software deployment
Tip 3: Getting Passwords
under Computer Configuration > Administrative Templates > method, like PDQ Deploy. You only need the “GPO Exten- when needed via LAPS
LAPS where 4 settings are available as is shown below. sion” part if you’re going to do an initial test by hand. You
can see this here. So, the day comes that you need to know what the current
generated password is for one of your Windows machines.
How do you do it? There are several ways. On is to use the
following PowerShell command.
You can use your LAPS GPO to manage the password for
Get-AdmPwdPassword -Computername “name of
either the default local admin or a custom local admin ac-
computer”
count. Below I have enabled the “Enable local admin pass-
word management ”setting.”
If you installed the LAPS Fat Client, you can access the LAPS
UI application in your start menu.
You can also use PolicyPak to gain more control over the
deployment process. More on that in just a minute.
5
Contents SysAdmin Magazine March 2022
Level Targeting If you are familiar with Group Policy Preferences, then
you already know how ILT provides a lot more granularity
PolicyPak offers all of the ADMX template settings in its PolicyPak Admin Templates Manager and we update them at the time of
concerning policy assignment. For instance, let’s say that
every new ADMX release. There’s a lot of advantages to using Admin Templates Manager versus standard Group Policy.
all of the local admin accounts residing on your servers are
named ServAdm1n and you want to create a separate LAPS
PolicyPak uses Group Policy Editor as is shown below but adds a secret superpower.
policy for those admins. Since those aren’t admin domain
accounts, you can’t target them using group policy but you
can use ILT to target those machines running Windows
Server 2016.
6
Contents SysAdmin Magazine March 2022
Now let’s make a LAPS policy for C-Level executive laptops. Naturally, we would want to have a strong password for those local
admin accounts. In this case, I want to enforce 20-character passwords using the strongest complexity. Then I will use ILT to
target the C-Level security group. As you can see in the screenshot below, there are many targetable options including computer As a bonus, while traditional GPOs created within the Group
name, OU Match, Site Match, computer form factor (Laptop vs. Desktop) and more! Policy Editor can normally only be deployed using Group
Policy, PolicyPak settings can be deployed using a number
of ways such as SCCM, KACE or your preferred MDM service.
You can learn more about that process by watching this video
that demonstrates the process of delivering Group Policy
settings, without the Group Policy engine itself.
7
Contents SysAdmin Magazine March 2022
from Home
Together, you could enforce LAPS on all of your enterprise
machines … since you won’t be needing local admin access
Employees
any longer.
8
Contents SysAdmin Magazine March 2022
Password Policy
corporate passwords, including the following: Active Directory password policy. Password policies define
different rules for password creation, such as minimum
▪ Brute force attack — Hackers run programs that enter
length, details about the complexity (like whether a special
various potential password combinations until they hit
character is required), and the length of time the password
upon the right one.
lasts before it must be changed.
▪ Dictionary attack — This is a specific form of brute force
Default Domain Policy is a Group Policy object (GPO) that
attack that involves trying words found in the dictionary
contains settings that affect all objects in the domain. To
Jeff Melnick as possible passwords.
IT Security Expert, Blogger
view and configure a domain password policy, admins can
▪ Password spraying attack — Hackers enter a known use the Group Policy Management Console (GPMC). Expand
username or other account identifier and try multiple the Domains folder and choose the domain whose policy
common passwords to see if they work. you want to access, and then choose Group Policy Objects.
With cyberattacks exploding around the world, it’s more
Right-click the Default Domain Policy folder and select
important than ever for organizations to have a robust ▪ Credential stuffing attack — Hackers use automated
Edit. Navigate to Computer Configuration -> Policies ->
password policy. Hackers often gain access to corporate tools to enter lists of credentials against various company
Windows Settings -> Security Settings -> Account Policies
networks through legitimate user or admin credentials, login portals.
-> Password Policy.
leading to security incidents and compliance failures. In this
▪ Spidering — Malicious users collect as much information
article, we will explore how to create and maintain a strong
as possible about a hacking target, and then try out Alternatively, you can access your domain password policy
and effective Active Directory password policy.
password combinations created using that data. by executing the following PowerShell command:
9
Contents SysAdmin Magazine March 2022
password expiration period. You can check this setting of at least 8; this makes it harder for brute force attacks
Get-ADDefaultDomainPasswordPolicy through PowerShell by executing the command net user to succeed. Complexity requirements typically require
USERNAME/domain. Keep in mind that forcing frequent the password to include a mix of:
password changes can lead to users writing their
Remember, any changes you make to the default domain • Upper or lowercase letters (A through Z and a
passwords down or adopting practices like appending
password policy apply to every account within that domain. through z)
the month to a stem word they reuse, which actually
You can create and manage fine-grained password policies • Numeric characters (0–9)
increase security risks. Setting “Maximum password
using the Active Directory Management Center (ADAC) in • Non-alphanumeric characters like $, # or %
age” to 0 means that passwords never expire (which is
Windows Server. • No more than two symbols from the user’s account
generally not recommended).
name or display name
10
Contents SysAdmin Magazine March 2022
NIST SP 800-63 Password because they forget their new passwords. Accordingly,
the latest NIST 800-63B standards call for using password
Default Domain Policy settings.
• Use banned password lists.
Guidelines expiration policies carefully. More recent research • Use password management tools to store multiple
suggests that better alternatives include using banned passwords.
The National Institute of Standards (NIST) is a federal agency password lists, using longer passphrases and enforcing
charged with issuing controls and requirements around multi-factor authentication for additional security.
11
Contents SysAdmin Magazine March 2022
12
Contents SysAdmin Magazine March 2022
How to Create,
Once RSAT is installed, start the PowerShell console as a
Windows 10 Version 1809
local administrator and enable the AD PowerShell module
If you are using Windows 10 version 1809, RSAT is included using this PowerShell command:
Passwords Using
1809, run the following command in an elevated Power- Enable-WindowsOptionalFeature -Online
Shell console: -FeatureName RSATClient-Roles-AD-Power-
shell
Russell Smith
Microsoft followed the same method for all following OS Create credential
IT Consultant, PowerShell Expert
versions, including Windows 11.
with password using
PowerShell
Automation is the key to streamlining Active Directory man-
agement tasks. In this article, I’ll show you how to create,
Earlier Versions of Windows 10 To create a new user account, use the New-ADUser cmdlet.
change and test user passwords with PowerShell scripts. If you are using an earlier version of Windows 10, download In the example below, I have hardcoded the ad.contoso.
the appropriate RSAT package from Microsoft’s website: com domain in the $UPN variable. You should change this
to match the UPN suffix you want to assign to users.
Installing the AD ▪ If you are managing Windows Server version 1803 or
1709, download and install the WS_1803 package.
PowerShell module ▪ If you are managing Windows Server 2016 or earlier
Provide the user’s first name and last name. The UPN and
SamAccountName will then be created by adding a period
Before you can use PowerShell to manage Active Directory, versions of Windows Server, download and install the between the first and last name. Use the following Power-
you need to install the Active Directory PowerShell module. WS2016 package. Shell script:
If you are using Windows 10 to manage AD, first install the
Remote Server Administration Tools (RSAT).
13
Contents SysAdmin Magazine March 2022
Password" -AsSecureString)
$GivenName = (Read-Host -Prompt "First Set-ADAccountPassword -Identity $User
Name") -NewPassword $NewPassword -Reset
$Surname = (Read-Host -Prompt "Last
Name") Change a local user’s password
$User = $GivenName+"."+$Surname To change a local user’s password, you need to use the Force a user to change their
$UPN = $User+"@ad.contoso.com" Get-LocalUser and Set-LocalUser cmdlets:
$Password = (Read-Host -Prompt "Pass- password at next logon
word" -AsSecureString)
The Set-LocalUser cmdlet doesn’t support setting a local
New-ADUser -Name $User -SamAccountName $Password = (Read-Host -Prompt "New
user account to force a password change at next logon.
$User -UserPrincipalName $UPN -Account- Password" -AsSecureString)
However, you can achieve the same goal by forcing the
Password $Password -GivenName $GivenName $User = (Read-Host -Prompt "Username")
password to expire:
-Surname $Surname -Enabled $True $UserAccount = Get-LocalUser -Name $User
$UserAccount | Set-LocalUser -Password
$Password $User = (Read-Host -Prompt "Username")
$Usrstring = "WinNT://localhost/"+$User
$usr=[ADSI] $Usrstring
The following code will prompt you to specify a username username of an existing AD account and then a new pass- But you can force users to change their AD account pass-
and password. You must enter a username that already word, which must meet the domain’s password complexity words using Set-ADAccountPassword:
exists in AD and a password that meets the domain’s pass- requirements.
14
Contents SysAdmin Magazine March 2022
To change the AD administrator password, type administra- expires” attribute parameter is supported only in PowerShell 6 and later.
tor when you are prompted for a username using the code To set the “password never expires” attribute on a local user
below: account, use Set-LocalUser:
$credential = Get-Credential
Set-Service -Name "AppReadiness" -Credential
$User = (Read-Host -Prompt "Username") $User = (Read-Host -Prompt "Username") $credential
$NewPassword = (Read-Host -Prompt "New Pass- Set-LocalUser -Name $User -PasswordNeverEx-
word" -AsSecureString) pires $true
Set-ADAccountPassword -Identity $User -New-
Password $NewPassword -Reset
Change a password’s expiration date
To set the “password never expires” attribute on an Ac-
tive Directory user account, use Set-ADUser: in Active Directory
To change a local administrator password, type administra- If you need to extend the time a user can keep their current
tor when prompted for a username: password, set the pwsLastSet attribute to the current date,
$User = (Read-Host -Prompt "Username")
giving them extra time until Active Directory forces them to
Set-ADUser -Identity $User -PasswordNeverEx-
$Password = (Read-Host -Prompt "New Password" change their password. Clearing the attribute and then set-
pires $true
-AsSecureString) ting it to -1 will set it to the current date and time.
15
Contents SysAdmin Magazine March 2022
for Beginners
Testing a user’s credentials
Free Download
If you want to test if a user’s credentials are working, all you
need to do is start a process using their username and pass-
word. The code below starts cmd.exe using the credentials
entered when prompted.
16
Contents SysAdmin Magazine March 2022
What Is Password Citrix is far from the only enterprise that falls short with
password security. When a threat research team scanned
Password spraying flips the conventional strategy by
attempting to log on to multiple user accounts using many
Spraying, and
all Microsoft user accounts in early 2019, they discovered common passwords. Trying a single password on many
that 44 million users were using the same usernames and different accounts before attempting another password on
passwords that had already been leaked online after security the same accounts circumvents normal lockout protocols,
How Can You breaches at other online services. This tendency is alarming,
as the 2020 Data Breach Investigations Report reveals that
enabling the attacker to keep trying more and more
passwords.
In 2019, a data heist at Citrix shook the cybersecurity world. What Is a Password While casting a wide net is likely to return at least a few
The attackers stole business documents from a shared
network drive and from a drive associated with a web-
Spraying Attack? successes, today’s savvy hackers rely on a more precise
approach. They set their sights on users who use single sign-
based tool used in Citrix’s consulting practice. The hackers Typical brute-force attacks target a single account, on (SSO) authentication, hoping to guess credentials that
gained this access to Citrix’s IT infrastructure through a testing multiple passwords to try to gain access. Modern will give them access to multiple systems or applications.
password spraying attack, a technique that exploits weak cybersecurity protocols can detect this suspicious activity They also commonly target users that use cloud services
passwords, leading to criticism that the software giant and lock out an account when too many failed login attempts and applications utilizing federated authentication. This
needlessly compromised its clients by failing to establish a occur in a short period of time. approach can enable attackers to move laterally, since
sound password strategy. federated authentication can help mask malicious traffic.
17
Contents SysAdmin Magazine March 2022
How to Detect a Password data can prove devastating. A sound cybersecurity strategy
requires a comprehensive, proactive approach that ensures
auditing, alerting and reporting.
Spraying Attack layered protection to block as many attacks as possible. Be Netwrix Auditor can alert you to a wide variety of suspicious
sure to follow these best practices: activity, including events indicative of a password spraying
Although conventional countermeasures might not
attack, so you can respond immediately to protect your
automatically detect password spraying attacks, there are ▪ Require multi-factor authentication for all users.
systems and data. Moreover, it delivers powerful auditing
several reliable indicators to look for. The most obvious is ▪ Ensure all passwords abide by National Institute of
and reporting. Key features include:
a high number of authentication attempts, especially failed Standards and Technology (NIST) guidelines.
attempts due to incorrect passwords, within a short period ▪ Establish sound policies for resetting passwords after
▪ Active Directory auditing and alerting. Netwrix
of time. Naturally, a closely related indicator is a spike in account lockouts.
Auditor tracks Active Directory logins and other user
account lockouts. ▪ Develop a defensible password strategy for shared
activity, including all successful and failed logon
accounts.
attempts. You can set up alerts on activity you deem
In many cases, password spraying leads to a sudden ▪ Conduct regular user training to ensure all users
suspicious, including single actions like a user gaining
spike in attempted logins involving SSO portals or cloud understand the threat of password spraying and how
admin privileges or a sequence of actions within a
applications. Malicious parties may use automated tools to they can devise and maintain secure passwords.
specified timeframe, such as more than 4 failed login
attempt thousands of logons within a brief period of time.
attempts within 1 minute. You can also easily review
Often, these attempts come from a single IP address or a
the full logon history of any user.
single device.
18
Contents SysAdmin Magazine March 2022
easier to spot compromised accounts and malicious In short, with Netwrix Auditor, it’s possible to catch
insiders early, so you can take action to avoid security malicious players early on — and proactively block them
from getting into your network in the first place.
▪ User behavior and blind spot analysis. Spot
malicious actor sneaking around your environment
by easily scrutinizing user activity outside of standard
hours, logon attempts by multiple users from a single
endpoint, and logon attempts by a single user from HOW-TO GUIDE
multiple endpoints.
Netwrix Auditor also helps you fortify your security posture How to Monitor
User Logоns in a
so you are less vulnerable to password spraying attacks in
the first place. In particular, you can:
19
Contents SysAdmin Magazine March 2022
How-to for IT Pro Specifies accounts where this value exceeded will be
emailed
)
begin {
.PARAMETER EmailServerAddress }
1. Copy, modify and save the following script by using
SMTP relay address try {
PowerShell ISE:
.PARAMETER FailoverEmail $MaxPasswordAge = (Get-ADDefaultDomainPasswordPolicy
20
Contents SysAdmin Magazine March 2022
make sure your account does not get locked out. To } Days
"Change Password". </p> <p>Please review the guide- process { $LastName = $User.Surname
lines below as they are necessary for successfully try { if ($DaysUntilExpire -le $PasswordExpirationThresh-
<dir> <p>Be at least 8 total characters</p> <p>Con- 'Filter' = { (Enabled -eq $True) -and (Password- Write-Log -Message "The user $($User.samAccountNam-
tain at least one uppercase character</p> <p>Con- NeverExpires -eq $false) -and (samAccountName -like e)'s password will expire in $DaysUntilExpire days"
tain at least one numeral</p> <p>Not be the same or $UserSearchString)} $EmailBody = $EmailTemplate.Replace('$FirstName',
similar to the last 5 used passwords</p> <p>Be used 'Properties' = 'PasswordLastSet', 'PasswordExpired', $FirstName).Replace('$LastName', $LastName).Re-
for at least 24 hours before changing again</p> </ 'PasswordNeverExpires','EmailAddress' place('$DaysBeforeExpiration', $DaysUntilExpire).
or more times, your account will be locked and you if ($SearchBase) { Send-MailMessage -To $User.EmailAddress -From $From
will need to contact the Help Desk for assistance. </ $GetAdUserParams.SearchBase = $SearchBase -Subject $Subject -BodyAsHtml $EmailBody -SmtpServer
ing this issue to the IT Help Desk. <BR> For infor- $Today = Get-Date Write-Log -Message "'$($ExpiringUsers.Count)' ac-
mation on how to contact the Help Desk, please visit $Users = Get-ADUser @GetAdUserParams | Where-Object counts found with expiring passwords within $Pass-
<font SIZE="4" COLOR="#0000ff"><u> http://helpdesk. Write-Log -Message "Found '$($Users.Count)' total } catch {
enterprise.com/ </u></font> </dir> </font></b> </ expirable AD user accounts" Write-Log -Message "$($_.Exception.Message) - $($_.
21
Contents SysAdmin Magazine March 2022
STOP WORRYING ABOUT Comply with regulatory requirements for user pass-
words
Password Policy enforcing the use of strong passwords. Easily strike the
right balance between password security and user pro-
Enforcer
ductivity for your organization.
22
Contents SysAdmin Magazine March 2022
[On-Demand Webinar]
Password123456: Hackers love it when we choose weak or leaked passwords for our most important accounts.
What if we could better protect our companies by preventing users from picking over 500
Protecting your million known bad passwords? And better yet, what if we could do this for free?
Active Directory ▪ Download and customize the popular Pwned Passwords list
▪ Incorporate Pwned Passwords into Active Directory for free using the open source
Castle
PwnedPasswordsDLL project
▪ Build customized lists of additional bad passwords
23
About Netwrix
What did you think Netwrix is a software company that enables information security and governance professionals to reclaim control over
of this issue? sensitive, regulated and business-critical data, regardless of where it resides.
What did you think of this content?
Over 11500 organizations worldwide rely on Netwrix solutions to secure sensitive data, realize the full business value of
enterprise content, pass compliance audits with less effort and expense, and increase the productivity of IT teams and
knowledge workers.
300 Spectrum Center Drive 1-949-407-5125 Spain: +34 911 982608 Switzerland: +41 43 508 3472 Hong Kong: +852 5808 1306
Suite 200 Irvine, CA 92618 Toll-free (USA): 888-638-9749 Italy: +39 02 947 53539
Netherlands: +31 858 887 804 France: +33 9 75 18 11 19
5 New Street Square +44 (0) 203 588 3023 SOCIAL: netwrix.com/social
London EC4A 3TW