Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page

Was this helpful?

  1. Pentesting Process
  2. Local Enumeration

Windows

HELP

help help <COMMAND> <COMMAND> ? <COMMAND> /?

Hostname

hostname

Sistema Operativo, Versione, Architettura

systeminfo [environment]::OSVersion.Version

Username

echo %USERNAME% whoami whoami /user (also SID) whoami /groups

SID

wmic useraccount get domain,name,sid

wmic useraccount where name="<NAME>" get sid wmic group get name,sid

Privileges

Users

net user net user <USER> (user info, also groups he/she is in) Get-LocalUser Create new user net user <USER> <PASSWORD> /add New-LocalUser -Name "<USER>" -Password (ConvertTo-SecureString "<PASSWORD>" -AsPlainText -Force)

Groups

net localgroup net localgroup <GROUP> (info on who is part of it) Get-LocalGroup Get-LocalGroupMember <GROUP> whoami /groups Create new group net localgroup <GROUP> /add New-LocalGroup -Name "<GROUP>" Assigning a user to a group net localgroup <GROUP> <USER> /add Add-LocalGroupMember -Group "Administrators" -Member "<USER>"

Descriptions

Get-LocalUser (users) Get-WmiObject -Class Win32_UserAccount (domain users) Get-WmiObject -Class Win32_OperatingSystem | select Description (machine)

Other connected users

query user qwinsta

File/Directory permissions

Execution Policy

Get-ExecutionPolicy -List Change the execution policy for the current process (session) Set-ExecutionPolicy Bypass -Scope Process (No blocks)

Defenses enabled

sc query windefend (Windows Defender da cmd) netsh advfirewall show allprofiles Get-MpComputerStatus | findstr "True" Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections (AppLocker blocks, path bypassing?)

systeminfo wmic qfe wmic qfe list brief Get-HotFix | ft -AutoSize

LAPS

Find-LAPSDelegatedGroups Find-AdmPwdExtendedRights Get-LAPSComputers

Network information

ipconfig /all route print arp -a netstat -ano (Active Network Connections, for service name see PID and then tasklist /SVC | findstr <PID>)

Pipe

Installed applications

wmic product get name Get-WmiObject -Class Win32_Product | select Name, Version str32BIT = HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall str64BIT = HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall reg query "<str32BIT>" /s /f "DisplayName" | findstr /i "DisplayName” reg query "<str64BIT>" /s /f "DisplayName" | findstr /i "DisplayName” Get-ItemProperty "<str32BIT>\*" | select displayname Get-ItemProperty "<str64BIT>\*" | select displayname $INSTALLED = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, InstallLocation $INSTALLED += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, InstallLocation

$INSTALLED | ?{ $_.DisplayName -ne $null } | sort-object -Property DisplayName -Unique | Format-Table -AutoSize

Or look in C:\Program Files

Service list

wmic service get name,pathname,state,startmode,<OTHER_FIELDS> | findstr /i /v "<STRING>" (/i caseInsensitive, /v NOT) Get-CimInstance -ClassName win32_service | Select <FIELDS> | ? {$_.<FIELDS> -like '<STRINGS>'} Get-Service | ? {$_.Status -eq "Running"} | select -First 2 |fl GUI: Services

Running processes

tasklist tasklist /SVC Get-Process

Task Manager

Scheduled tasks

schtasks /query /fo LIST /v Get-ScheduledTask

Environment variables

set Get-ChildItem Env: | ft key,value

Variable PATH

$env:path

Alias

get-alias New-Alias -Name "<NAME>" <COMMAND>

View Share/Drive

net share net use net use x: \<COMPUTER>\<SHARE>

Logs

GUI: Event Viewer

Various info

GUI: Computer Management GUI: Local Security Policy GUI: Local Group Policy Editor

Warnings

  • To access a user with RDP, they must be part of the Remote Desktop Users group.

  • To access a user with WinRM, they must be part of the Remote Management Users group.

  • Use the runas command to execute commands on behalf of another user on the same host. runas /user:<USER> <COMMAND, ex. cmd> Start-Process cmd.exe -Verb runAs

  • Startup scripts in:

    • For all users (requires administrator privileges):

      • %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\

      • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\

    • For single user:

      • %APPDATA%\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\

      • C:\Users\Marco\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Last updated 4 days ago

Was this helpful?

whoami /priv (also with System cmd) To enable privileges () .\EnableAllTokenPrivs.ps1

icacls icacls <PATH> /grant <USER>:f icacls <PATH> /remove <USER>:f (: f= FullAccess, W=Write, R=Read)

/accepteula gci \\.\pipe\ /accepteula <PIPE> [/v] (enumerate permissions assigned to a pipe) <PIPE> = \pipe\ to see all, otherwise <PATH>, ex. \\.\Pipe\lsass)

taskmgr GUI: Task Manager GUI: (to download, also shows DLLs used for each process)

You can also use Import-Module .\Invoke-RunasCs.ps1 Invoke-RunasCs <USER> <PASS> "cmd /c whoami /all"

RunasCs.ps1
DOWNLOAD
DOC
Hotfix
pipelist.exe
accesschk.exe
Process Explorer