Practical Windows Commands
Become VeryLazyTech member! ๐
Follow us on:
โ Twitter @VeryLazyTech.
๐พ Github @VeryLazyTech.
๐ Medium @VeryLazyTech.
๐บ YouTube @VeryLazyTech.
๐ฉ Telegram @VeryLazyTech.
๐ต๏ธโโ๏ธ My Site @VeryLazyTech.
Visit our shop for e-books and courses. ๐
Basic Recon: System & Patch Info
Before launching privilege escalation or lateral movement, always enumerate the target machine:
systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" #Get only that information
wmic os get osarchitecture || echo %PROCESSOR_ARCHITECTURE% #Get architecture
wmic computersystem LIST full #Get PC info
wmic qfe list brief #Updates
wmic qfe get Caption,Description,HotFixID,InstalledOn #Patches
hostname
DRIVERQUERY #3rd party driver vulnerable?Check patch levels:
wmic qfe get Caption,Description,HotFixID,InstalledOnGet only OS name/version:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
๐ Environment Variables Worth Checking
Key variables:
%USERNAME%,%COMPUTERNAME%,%HOMEPATH%%LOGONSERVER%,%USERDNSDOMAIN%,%USERDOMAIN%%TEMP%,%windir%
Some env variables to highlight:
COMPUTERNAME: Name of the computer
TEMP/TMP: Temp folder
USERNAME: Your username
HOMEPATH/USERPROFILE: Home directory
windir: C:\Windows
OS:Windos OS
LOGONSERVER: Name of domain controller
USERDNSDOMAIN: Domain name to use with DNS
USERDOMAIN: Name of the domain
โก๏ธ Identify the domain controller:
Drives and Disk Info
Windows Defender & Recycle Bin
Defender Status: (PowerShell-based commands are preferred for Defender bypass โ covered in other posts.)
Check for deleted data:
Processes, Services & Installed Software
Installed programs:
Active Directory Enumeration
Basic Domain Info
Enumerate Users
Check domain user details:
Enumerate Groups
List Domain Computers
Logs & Sessions
Password Policy
Credentials
Persistence with users
Local & Domain Users / Groups
โก๏ธ Add local user to admin:
Network Enumeration
View DNS cache:
Windows Firewall Control
Check current config:
Disable firewall:
Allow port:
Full list:
Persistence & RDP Access
Enable RDP:
Create RDP-ready admin:
Shares, SNMP, and Wi-Fi Access
Wifi
SNMP
File Downloading Tricks
Using built-in tools:
Certutil:
Bitsadmin:
More download techniques: https://lolbas-project.github.io
Extra Tricks
Alternate Data Streams (ADS)
Hide malware in alternate data streams:
List ADS:
Execute ADS:
๐คฏ CMD Obfuscation & DNS Exfiltration
Bypass blacklists:
Use DNS as a covert exfiltration channel:
Run CMD from C (Persistence Example)
Compile:
Misc.
Bypass Char Blacklisting
DOSfuscation
Generates an obfuscated CMD line
Listen address ACLs
You can listen on http://+:80/Temporary_Listen_Addresses/ without being administrator.
Manual DNS shell
Attacker (Kali) must use one of these 2 options:
Victim
for /f tokens technique: This allows us to execute commands, get the first X words of each line and send it through DNS to our server
You can also redirect the output, and then read it.
Learn & practice For the Bug Bounty
Last updated
Was this helpful?