cyber security
windows
The system variable for windows directory is %windir%
You can config users by running the lusrmgr.msc utility.
You can config policies by running the secpol.msc utility.
UAC User Account Control was first introduced in Windows Vista and has been included in releases that followed.
When a user with an account type of administrator logs into a system, the current session does not run with administrative privileges
When an operation requiring elevated permissions needs to execute, the user will be prompted to confirm if they permit the operation to run.
UAC, by default, doesn't apply to the local admin account.
You can read more on UAC here.
UserAccountControlSettings.exe is used for UAC
The System Configuration utility (MSConfig) is for advanced troubleshooting, and its main purpose is to help diagnose startup issues.
winver.exe is used to find out info about the sys version and who it is registered to.
compmgmt.msc is used for computer management.
wininfo32.exe can give you info about the system.
to display the help page for commands in cmd use /? e.g netstat /?
For the net command, to display the help manual /? will not work. In this case, you need to use different syntax, which is net help.
The Windows registry is a hierarchical database used to store information necessary to configure the system for one or more users, applications or hardware devices.
The registry contains information that Windows continually references during operation, such as:
can be set by an administrator or a privileged account. These permissions can be applied to: Users and Groups
Permissions that can be set are:
icacls can be used to check and modify file and folder permissions.
Is the process of verifying the identity of a user, service, or object.
The goal is to verify that the user / object / service is not an impostor.
Done using the Local Security Authority subsystem that keeps track of the security policies and accounts that are on a computer system.
LSA maintains info on all aspects of security on a local computer.
On_Rem AD has a record of all users, pcs and servers and authenticates users signing in via network logon.
Authentication can be done via:
NTLM uses a challenge-response sequence of messages between a client and server.
Authentication is based on the challenge-response scheme and thus does not provide data integrity or confidentiality.
LDAPS supports encryption
The DC can be considered a db of users, groups, computers etc.
The user's workstation sends credentials to the DC using an API so as to validate them and be able to login.
Kerberos uses symmetric-key cryptography and requires trusted third party authorization to verify user identities.
Definitions:
Azure AD is a secure online authentication store which can contain users and groups.
Users have a username and password that are used when you log into an app that uses Azure AD for authentication e.g all microsoft cloud services - O365, Dynamics365, Azure.
Azure AD supports the following authentication methods:
Is a type of single sign-on(SSO) standard.
Defines a set of rules that allows users to access web apps with a single login.
This works because those service providers all trust the identity provider.
Service providers: systems and apps that users access.
Identity provider: the system that performs the authentication.
Is a standard apps use to provide access to clients.
The specification has 4 important roles:
An authentication standard built on top of OAUTH2.0
Adds an additional token - ID Token
Uses JWT - Json Web tokens
OAUTH2.0 is about resource access and sharing while OpenIDConnect is about user authentication only.
CMD is the command line interpreter for Windows and is used to automate various system related tasks using scripts and batch files. CMD can only intepret batch commands.
Powershell is mainly used by sysadmins to manage the network and domain they handle. Powershell is a scripting language and can interpret batch commands and powershell commands.
CMD has limited administration capabilities when compared to powershell.
can be considered a database that contains low-level settings for Microsoft Windows settings and applications. The registries are structured as follows:
You can use powershell to browse the registries by cd [REG DB] e.g cd HKLM:\
Windows also has a builtin tool named "reg" which can be used from the command line to add, remove, query, import, export, etc registry keys.
Active directory is the directory service for windows domain networks.
Components of AD:
Allows for the control and monitoring of users' computers through a single domain controller.
Allows for any user in a company to use any machine that the company owns, without having to set up multiple users on a machine.
Is a windows server that has the ADDS(Active Directory Domain Services) installed on it and has been promoted to a domain controller in the forest.
DC controls the rest of the domain.
Functions:
holds the databases and processes needed to store and manage directory information e.g users, groups and services.
x-tics:
A forest is a collection of one or more domain trees inside an AD network.
Components:
Help the domain and trees communicate with each other and maintain security inside of the network.
They define:
Trusts are a mechanism for users in the network to gain access to other resources in the domain.
Types of trust:
Trusts can be abused for lateral movement within a network.
Policies dictate how a server operates and the rules it will or will not follow. e.g of policies:
Are the core functions of an AD network.
Allow for the management of the domain, security certificates, LDAPS, etc.
Is how the DC decides what it wants to do and the services it wants to provide for the domain.
Are services the DC provides to the rest of the domain / tree. The default ones are:
Authentication protocols in place can make this vulnerable and thus a good target.
The maintypes of authentication are NTLM and kerberos.
Windows Server AD | Azure AD |
---|---|
LDAP | REST APIs |
NTLM | 0AUTH / SAML |
Kerberos | OpenID |
OU Tree | Flat Structure |
Domains and Forests | Tenants |
Trusts | Guests |
Download powerview and navigate to the directory it is in.
# load a powershell shell with execution policy bypassed
powershell -ep bypass
# import the PowerView module
. .\PowerView.ps1
# list all operating systems on the domain
Get-NetComputer -fulldata | select operatingsystem
# list all users on the domain
Get-NetUser | select cn
# list group names
Get-NetGroup -GroupName *
# list services that run as domain admins
Get-NetUser -SPN | ?{$_.memberof -match 'Domain Admins'}
Read how to use powerview to exploit AD
You can get tips for the windows command line interface here