🐲
OSCP Notes
  • 🐲OSCP Notes
  • 🐲OSCP Methodology
  • 💡Misc
    • Metasploit
    • Antivirus Evasion
    • Password attacks
    • Reverse Shells
    • Port Forwarding, Tunneling and Pivoting
      • Local Port Forwarding
      • Remote Port Forwarding
      • Dynamic Port Forwarding
      • Lingolo-ng
    • Information Gathering
      • Passive Reconnaissance
        • Whois
        • Google Dorks
        • NetCraft
        • Git Repository
      • Active Reconnaissance
        • DNS Enumeration
        • Host Discovery
        • Port scanning
        • SMTP - 25
        • SNMP
  • Linux
    • Local Enumeration
    • Local Privileges Escalation
      • Scheduled tasks
      • Password Authentication
      • Monitor Processes
      • SetUID Binaries and Capabilities
      • Sudoers
      • Kernel Exploits
  • Windows
    • 🧠Mindmap
    • 🥝Mimikatz Basics
    • Enumeration
      • External Enumeration
      • Local Enumeration
      • Active Directory
        • PowerView
    • NTLM Hashes
    • Local Privilege Escalation
      • Service Binary Hijacking
      • Service DLL Hijacking
      • Unquoted Service Paths
      • Scheduled Tasks
      • Token impersonation
      • Backup Operators Group
    • Lateral Movement
      • WMI and WinRM
      • PsExec
      • Pass The Hash
      • Overpass The Hash
      • Pass The Ticket
      • DCOM
    • Persistence
      • Golden Ticket
      • Shadow Copy
    • Authentication Attacks
      • AS-REP Roasting
      • Kerberoasting
      • Password Spray
      • Silver Ticket
      • DC Sync
    • Client Side
    • NTLM Authentication
    • Kerberos Authentication
    • Cached Credentials
  • Web attacks
    • WordPress
    • SQL Injection (SQLi)
    • Command Injection
    • Directory Traversal
    • Local File Inclusion (LFI)
    • File Upload
Powered by GitBook
On this page
  • WMI
  • Remote process
  • WinRM
  • WinRS
  • PS-Remoting
  • References
  1. Windows
  2. Lateral Movement

WMI and WinRM

PreviousLateral MovementNextPsExec

Last updated 7 months ago

WMI

(WMI), is an object-oriented feature for task automation. It communicates through RPC over port 135 and capable of creating processes.

WMI is capable of creating processes via the Create method from the Win32_Process class.

Remote process

To create a process on the remote target using WM it is required member of the Administrators local group.

Create a process using wmic:

wmic /node:<target> /user:<username> /password:<password> process call create "<command>"

Create a process using PowerShell:

$username = '<username>';
$password = '<password>';
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;
$options = New-CimSessionOption -Protocol DCOM
$session = New-Cimsession -ComputerName <target> -Credential $credential -SessionOption $Options 
$command = '<command>';
Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine =$Command};

WinRM

WinRS

Windows Remote Shell is a command-line tool used for executing commands remotely on a Windows machine using the WinRM protocol. It allows administrators to manage remote systems securely, similar to SSH in Linux.

Usage:

winrs -r:<target> -u:<username> -p:<password> <command>

PS-Remoting

PowerShell Remoting allows for the remote execution of PowerShell commands and scripts on other Windows machines using the WinRM protocol. It supports interactive sessions.

The following requirements must be met to use PS-Remoting:

  • PS-Remoting must be enabled on the target machine.

  • The user must belong to either the Administrators group or the Remote Management Users group.

Usage:

$username = '<username>';
$password = '<password>';
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;
PSSession -ComputerName <target> -Credential $credential

References

is Microsoft's implementation of the protocol, used for remote host management. It exchanges XML-based messages over HTTP and HTTPS for secure communication.

Windows Management Instrumentation
Windows Remote Management
WS-Management
WS-ManagementWikipedia
WS-Management protocol
Windows Remote Management - Win32 appsMicrosoftLearn
WinRM
Logo
winrsMicrosoftLearn
winrs
Logo
Logo
Windows Management Instrumentation - Win32 appsMicrosoftLearn
WMI
Logo