Windows notes

Minhas anotações para sistemas baseados em Windows

Note

Essas notas são baseadas em outros artigos, folhas de dicas e guias, etc.

Enumeration

Basics

net users
net users /domain
net localgroup
net groups /domain
net groups /domain "Domain Admins"

Get-ADUser
Get-Domain
Get-DomainUser
Get-DomainGroup
Get-DomainGroupMember -identity "Domain Admins" -Domain m0chanAD.local -DomainController 10.10.14.10
Find-DomainShare


#Host Discovery
netdiscover -r subnet/24
nbtscan -r [range]
for /L %i in (1,1,255) do  @ping.exe -n 1 -w 50 <10.10.10>.%i | findstr TTL


#Reverse DNS Lookup
$ComputerIPAddress = "10.10.14.14"
[System.Net.Dns]::GetHostEntry($ComputerIPAddress).HostName

https://github.com/tevora-threat/SharpView

Users with SPN

Kerberos Enumeration

Red-Team CSharp Scripts

Active Directory

AD Enumeration from Linux Box - AD Tool

SharpView Enumeration

SMB Enumeration

SNMP Enumeration

MySQL Enumeration

DNS Zone Transfer

LDAP

RPC Enumeration

Remote Desktop

File Transfer

TFTP

FTP

VBS Script

Powershell

Powershell Base64

Secure Copy / pscp.exe

BitsAdmin.exe

Remote Desktop

WinHTTP Com Object

CertUtil

Curl (Windows 1803+)

SMB

Exploit

Code Execution with MSHTA

LLMNR / NBT-NS Spoofing

Responder WPAD Attack

mitm6

SCF File Attack

NTLM-Relay

Priv Exchange

Exchange Password Spray

ExchangeRelayX

Exchange Mailbox Post-Compromise

CrackMapExec

Mail Sniper

Read Exchange Emails with PowerShell

Kerberos Stuff

MSSQL Exploiting (PowerUpSQL)

Malicious Macro with MSBuild

ClickOnce MSBuild Payload

WeirdHTA - Undetectable HTA

EvilWinRM

GetVulnerableGPO

Invoke-PSImage

Meterpreter + Donut - Shellcode Injection .NET

DemiGuise - Encrypted HTA

Grouper2

Microsoft SQL Stuff

CrackMapExec Stuff

SharePoint Stuff

IIS Stuff

Easy ASMI Bypass (AMSI-Fail)

Privilege Escalation

Reference: https://www.absolomb.com/2018-01-26-Windows-Privilege-Escalation-Guide/

Run this script: https://github.com/M4ximuss/Powerless/blob/master/Powerless.bat

Basics

PowerUp.ps1 (Sometimes a Quick Win)

SharpUp

If It’s AD Get Bloodhound Imported…

Bloodhound-Python

Cleartext Passwords

View Installed Software

Weak Folder Permissions

Scheduled Tasks

Powershell History

View Connected Drives

View Privs

Is Anyone Else Logged In?

View Registry Auto-Login

View Stored Creds in Credential Manager

View Unquoted Service Paths

View Startup Items

Check for AlwaysInstalledElevated Reg Key

Any Passwords in Registry?

Any Sysrep or Unattend Files Left Over

GPP (Group Policy Preferences) Passwords

Dump Chrome Passwords (Also Post Exploit)

Dump KeePass

Token Impersonation

Juicy Potato

Kerberoasting

Kerberoast with Python

AS Rep Roasting

DCSync (Also Post Exploit)

Elevate to System Shell from Admin Account using Windows Terminal

Post Exploitation

Useful Commands

Esenutl.exe Dump Locked File

Check if Powershell Logging is Enabled

Run Seatbelt (ABSOLUTELY MUST)

Dump Creds

Dump Creds #2

Dump SAM Remotely with WinRM

Running Mimikatz with GadgetToJScript or VBS

SessionGopher

Dump Chrome Passwords (Also Post Exploit)

Dump Process Memory w/ Mimikittenz

Dump KeePass

pypykatz

SafetyKatz

SharpDPAPI

SharpSniper

SharpLocker

Check for Missing KB’s

Decrypt EFS Files with Mimikatz if Admin/System

UAC Bypass

Golden Ticket Attack

DCSync & Golden Ticket in One

Child Domain to Forest Compromise

Dump NTDS.dit

SeBackupPrivlege - Dump NTDS.dit

SecretsDumper Windows

Persistance

SSH Shuttle

SharPersist

SharpDoor

AutoRun Registry

Run & Run Once

Scheduled Tasks

Windows Startup Folder

EXE/DLL Hijacking

Add User Account

Persistence with Kerberos

Lateral Movement

Highly recommened starting by reading this article which covers lateral movement in great depth by SpectreOps- https://posts.specterops.io/offensive-lateral-movement-1744ae62b14f

Plink

Powershell Port Forward

Invoke-SocksProxy

Socat for Windows

SharpExec

Secure Sockets Funneling

Chisel (Fast TCP Tunnel over HTTP secured by SSH)

CrackMapExec

WMIC Spawn Process

WinRS

Invoke-WMIExec.ps1

Powershell Invoke-Command (Requires Port 5985)

PSExec

Powershell Remoting

Configure Remote Service over SMB (Requires Local Admin on Target Machine)

Pass-The-Hash

Pass-The-Ticket

Microsoft SQL Proxy

Obfuscation / Evasion Techniques

Invoke-Obfusaction

Invoke-CradleCraft

Invoke-DOSfuscation

Unicorn

https://github.com/trustedsec/unicorn

AppLocker / Constrained Mode Bypasses

Verify If You Are in Constrained Mode

PowerShDLL - Powershell with no Powershell.exe via DLL’s

PowershellVeryLess Bypass

World Writable Folders (By Default on Windows 10 1803)

Downgrade Attack

AppLocker COR Profile Bypass

MSBuild Powershell/CMD Bypass

PSAttack

NoPowerShell

runDLL32 Bypass

PSByPassCLM

Last updated