Basics
Core Commands
# List folders and files
dir
dir C:\Users
dir /a
dir /a C:\Users
# Change directory
E: | C:
cd C:\Users
cd ..
cd Desktop
# Create directory
mkdir test
# Remove directory
rmdir test
rmdir /s non-empty-test
# Move files or folders
move file1.txt folder1
move a.txt b.txt
move folder1 folder2
# Print text
echo "Hello World"
echo "test" > file1.txt
# View content of a file
type file1.txt
# Delete file
del file1.txt
# Copy file
copy a.txt b.txt
copy a.txt folder1
# Rename file
ren a.txt newname.txt
# Change attributes of files or folders
attrib +h a.txt
attrib -h a.txt
attrib +h folder
dir /a:h
# List running processes
tasklist
# Kill running process
taskkill /f /pid 1547
# Display network information
ipconfig
ipconfig /all
# Display active connections
netstat
netstat /ano
# Test network connectivity
ping google.com
# Show path to destination
tracert google.com
# Create links
mklink softlink originalfile
mklink /H hardlink originalfile
mklink /D link dir # Soft link onlyFile System
C:\ Top level point that hold all the system files.
C:\Windows\ Contains operating system files.
C:\Program Files\ Contains applications files.
C:\Program Files (x86)\ Contains 32bit applications on 64bit operating system.
C:\Users\ Contains users home directories.
C:\ProgramData\ Contains configuration files of applications (Hidden).
File Permissions
Windows has 5 main permission types:
Full Control
Modify
Read & execute
Read
Write
Each user and group on the system has its own permissions:
User1: Read
User2: Read + Write
Group1: Full Control
Inherited permissions, child inherit parent permissions (This is what happens by default in windows).
Explicit permissions, permission applied specially to a file.
Explicit Deny > Explicit Allow > Inherited Deny > Inherited Allow.

Users & Groups
UAC
UAC gives you administrator access for one command, you trigger it by clicking right click on any file then choose run as administrator.

Runas
Credentials
Credentials (usernames & passwords) are stored in the SAM file.
SAM file location: C:\Windows\System32\config\SAM.
Mostly stores the users' passwords in the NTLM hash.
Security Policy
Audit policy: Control logs through event viewer.
User rights: Control permissions on the OS (change time, backup, shutdown).
Security options: Rename administrator account, Account policy Password length, complexity, expiration period. Account lockout threshold, duration.
Registry
Registry stores configuration settings and there are 5 types of registry hives:
HKEY_Classes_Root (HKCR): settings for applications
HKEY_Current_User (HKCU): settings for the current user
HKEY_Local_Machine (HKLM): local machine settings
HKEY_USERS (HKU): Settings for every user
HKEY_Current_Config (HKCC): settings for hardware
Windows Sharing (SMB)
Services
Processes
Task Scheduling
Last updated