Skip to the content.

~

~/Security



The Microsoft Windows Command Reference for Security Professionals


Microsoft Windows Operating System and Windows Security

In any organization, non-technical employees are likely using Microsoft Windows. In fact, the overwhelming majority of desktop and laptop systems run Windows.

Because of this, it becomes a prime target for malware(phishing, botnets, ransomware) introduced through these regular users. In rare cases, spear phishing attacks are carried out against administrators because they hold the keys to the kingdom.

Understanding the fundamentals of Microsoft Windows security is essential for any security professional.

microsoft.com- Windows Security

or pdf Version

General System Information

Querying of system information for troubleshooting

use the Get-WmiObject cmdlet to get general information

-Class win32_OperatingSystem(general information on the OS)

Win32_Process

Win32_Service

Win32_BIOS

General Boot Drive Structure

The boot drive(C) is divided into the following on a bare Windows install (some folders may be hidden and not shown, which is the default)

NTFS Permissions

key permission types for NTFS-

list permissions for a directory by using icacls

Share Permissions

Windows Defender/Windows Security Center

use the Get-MpComputerStatus cmdlet to check protection settings

Microsoft Management Console (MMC)

run mmc

Since MMC is centered around the concept of snap-ins, we must add a snap-in first

The Windows Command Line

although GUI tools can be easier to use, the command line offers

Windows Command Reference

PowerShell

to become proficient at administering windows systems with security in mind, it is essential to learn at least the basics of Windows PowerShell and PowerShell scripting

PowerShell utilizes cmdlets, which are small single-function tools built into the shell

Cmdlets are in the form of Verb-Noun

Execution Policy

if not able to run your new script, be sure to check the PowerShell execution policy with

Get-ExecutionPolicy -List

Set to bypass for the current session

Set-ExecutionPolicy Bypass -Scope Process

Windows Management Instrumentation (WMI)

used for-

wmic in PowerShell-

or with the the Get-WmiObject module

the Invoke-WmiMethod module, can be used to call the methods of WMI objects

Services

Windows services can be started automatically at system boot without user intervention, and can continue to run in the background even after user log-out

managed via the Service Control Manager (SCM) system, accessible via the services.msc MMC add-in.

OR

using Get-Service

Processes

Can be viewed in Task Manager or in Powershell with ps(Get-Process)

Task Manager

can be opened with taskmgr from cmd/powershell, or with a Ctrl+Shift+Esc sequence

Security Identifier (SID)

(SID)-(revision level)-(identifier-authority)-(subauthority1)-(subauthority2)-(etc)

  1. SID-identifies this string as an SID
  2. revision level- always 1
  3. identifier authority-48bit string identifying authority that created SID
  4. subauthority1-order the authority created this account
  5. subauthority2- which computer or domain created the number
  6. subauthority3-RID, whether user is normal user, guest, administrator, etc.

get SID of a user with

Get-LocalUser <user> | select sid

get SID of a security group with

Get-LocalGroup <user> | select sid

SAM

Security Account Manager(SAM)…stores user accounts and security descriptors for users on the local computer grants rights to a network to execute specific processes

The access rights themselves are managed by Access Control Entries(ACE) in Access Control Lists(ACL)

security descriptor can be

  1. Discretionary ACL
  2. System ACL

Local Security Authority validates access tokens

User Account Control(UAC)

The working is detailed here

the consent prompt interrupts the execution of scripts or binaries until the user enters the password or confirms execution

Windows Registry

run regedit

Hierarchy

-root keys
  |
  ----subkeys
         |
         ----values

the 11 value types that can be entered in a subkey-

  1. REG_BINARY
  2. REG_DWORD(32bit number)
  3. REG_DWORD_LITTLE_ENDIAN(little-endian computer architectures)
  4. REG_DWORD_BIG_ENDIAN(big-endian architectures)
  5. REG_EXPAND_SZ(unexpanded references to environment variables)
  6. REG_LINK(target path of a symbolic link)
  7. REG_MULTI_SZ(sequence of null-terminated strings)
  8. REG_NONE
  9. REG_QWORD(64bit number)
  10. REG_QWORD_LITTLE_ENDIAN(64-bit number in little-endian format)
  11. REG_SZ(null-terminated string)

root keys all start with HKEY

Application Whitelisting

Related: zero trust principle

AppLocker for whitelisting

Add a User

run netplwiz and it will open up the User Accounts manager

Group Policy