October 28, 2026
Lateral Movement and Pivoting | WMI Lateral Movement & MSI Install
๐๐๐ ๐ข๐ฉ๐๐ฅ๐ฉ๐๐๐ช

By Masaud Ahmad
5 min read
In this TryHackMe Lateral Movement & Pivoting lab, we explore how Windows Management Instrumentation (WMI) can be used for remote software management and how attackers may abuse this legitimate administrative functionality to move between Windows systems.
The technique demonstrated here combines WMI, DCOM/RPC, SMB file transfer, and a Windows Installer package (MSI).
The objective is to understand the complete attack path: from preparing an MSI package on the attacker machine to staging it on a target Windows host, invoking the installation remotely, and observing the result in an authorized lab environment.
๐๐ข๐ฅ๐ ๐๐ข๐ก๐๐๐ฃ๐ง
WMI is a built-in Windows management technology that enables administrators to query system information and perform management operations on local or remote computers.
The Win32_Product WMI class exposes methods associated with Windows Installer products, including an installation method that accepts an MSI package location.
When an account has sufficient privileges and remote management is permitted, this functionality can be misused to initiate an installation on another machine.
The important distinction is that the MSI file transfer and the remote installation are separate operations:
โข SMB can be used to transfer the MSI to the target. โข WMI over DCOM/RPC can be used to invoke the installation remotely. โข A reverse TCP connection, if configured in the lab payload, follows a separate network path back to the listener.
๐๐๐ ๐ก๐๐ง๐ช๐ข๐ฅ๐ & ๐ง๐๐ฅ๐๐๐ง ๐๐๐ง๐๐๐๐ฆ
The supplied proof of concept uses the following lab details:
โข Attacker machine: Kali Linux / TryHackMe AttackBox
โข Example attacker callback IP: 10.150.74.14
โข Callback port: TCP 4445
โข Jump host: thmjmp2.za.tryhackme.com
โข Target host: thmiis.za.tryhackme.com
โข Target file location: C:\Windows\myinstaller.msi
โข SMB file-transfer port: TCP 445
โข DCOM/RPC endpoint mapper: TCP 135
โข Default Windows dynamic RPC port range on supported modern Windows systems: TCP 49152โ65535
The exact target IP was not included in the original notes. Resolve thmiis.za.tryhackme.com from within the connected lab environment to identify the address assigned to your current session.
Remember that TCP 135 is not necessarily the only port needed for WMI/DCOM. The connection may also require a dynamically assigned RPC port. Firewall rules and network routing determine whether the complete communication path works.
๐ฆ๐ง๐๐ฃ ๐ญ โ ๐ฃ๐ฅ๐๐ฃ๐๐ฅ๐ ๐ง๐๐ ๐ ๐ฆ๐ ๐ฃ๐๐๐๐๐๐
In this stage, the attacker machine prepares an MSI-format package for the authorized lab exercise.
The callback address must be the attacker's lab IP that is reachable from the target, not the target's own IP.
The payload configuration in the supplied proof of concept uses:
LHOST=10.150.74.14
LPORT=4445
Here, LHOST identifies the callback destination, while LPORT identifies the TCP port configured for the receiving handler.
The generated MSI is intended to demonstrate the security implications of remotely invoking an installer. Use this workflow only against systems explicitly included in your authorized lab.
๐ฆ๐ง๐๐ฃ ๐ฎ โ ๐ง๐ฅ๐๐ก๐ฆ๐๐๐ฅ ๐ง๐๐ ๐ ๐ฆ๐ ๐ง๐ข ๐ง๐๐ ๐ง๐๐ฅ๐๐๐ง
The next stage demonstrates file staging over SMB using the lab-provided account.
Windows administrative shares such as ADMIN$ can expose the Windows installation directory to appropriately authorized users. In this lab, the intended destination is:
C:\Windows\myinstaller.msi
The important point is that a successful upload does not mean the MSI has been executed. It only establishes that the package is present on the target.
SMB transfer normally uses TCP port 445. This is separate from the DCOM/RPC communication used for the subsequent WMI operation.
For a public write-up, avoid embedding passwords in commands or publishing working credentials. Use the credentials assigned to your own authorized lab session.
๐ฆ๐ง๐๐ฃ ๐ฏ โ ๐ฃ๐ฅ๐๐ฃ๐๐ฅ๐ ๐ง๐๐ ๐๐๐ฆ๐ง๐๐ก๐๐ฅ
The receiving handler is configured on the attacker machine to observe the lab's expected reverse TCP connection.
The example callback destination is:
10.150.74.14:4445/TCP
For a callback to arrive, the address must be reachable from the target, the listener must be running, and the applicable firewall and routing rules must permit the connection.
A configured listener by itself does not prove that the target is reachable or that the installation succeeded. Those are separate conditions to verify during testing.
๐ฆ๐ง๐๐ฃ ๐ฐ โ ๐๐ฆ๐ง๐๐๐๐๐ฆ๐ ๐ง๐๐ ๐ฅ๐๐ ๐ข๐ง๐ ๐ช๐ ๐ ๐ฆ๐๐ฆ๐ฆ๐๐ข๐ก
The lab uses THMJMP2 as the jump host from which the remote management operation is initiated.
In PowerShell, a PSCredential object represents the credentials supplied for authentication. A CIM session option configured for DCOM specifies the transport used by the remote management session.
The destination is the lab target:
thmiis.za.tryhackme.com
The connection depends on valid lab credentials, sufficient privileges, the appropriate DCOM/WMI permissions, working name resolution, and permitted RPC connectivity.
From a networking perspective, the RPC endpoint mapper initially uses TCP 135 and may then direct the client to a dynamic RPC port. Allowing TCP 135 alone does not guarantee that the remote operation will succeed.
๐ฆ๐ง๐๐ฃ ๐ฑ โ ๐จ๐ก๐๐๐ฅ๐ฆ๐ง๐๐ก๐ ๐ง๐๐ ๐ ๐ฆ๐ ๐๐ก๐ฆ๐ง๐๐๐๐๐ง๐๐ข๐ก
The relevant WMI operation uses the Install method associated with Win32_Product.
Its PackageLocation argument points to the installer package on the computer where the software is being installed. That is why the lab references the target-side path:
C:\Windows\myinstaller.msi
The other arguments specify installation options and whether the software should be made available to all users.
This is the key learning point: the remote management request invokes an installation operation on the target rather than simply copying a file there.
The Microsoft documentation describes the method, its parameters, and the return values that can be used to assess installation errors.
๐ฆ๐ง๐๐ฃ ๐ฒ โ ๐ฉ๐๐ฅ๐๐๐ฌ ๐ง๐๐ ๐๐๐ ๐ฅ๐๐ฆ๐จ๐๐ง
After the remote operation, verify each part of the workflow rather than assuming that one successful step proves the entire chain worked.
Check whether the remote installation completed, whether the target generated the expected network activity, and whether the listener recorded the expected connection.
The lab's final validation involves examining the designated user's Desktop on THMIIS and running the exercise's supplied flag.exe as instructed by the room.
The flag is the proof that the lab objective was completed; a successful file upload alone is not sufficient evidence.
๐ช๐๐๐ง ๐ง๐๐๐ฆ ๐๐๐ ๐ข๐ก๐ฆ๐ง๐ฅ๐๐ง๐๐ฆ
This exercise illustrates several important points about Windows enterprise environments:
โข Legitimate administrative technologies can become attack paths when privileged credentials are misused. โข File transfer and remote execution are distinct stages, each with its own permissions and network requirements. โข DCOM/RPC connectivity involves more than the endpoint mapper port in many Windows configurations. โข A valid management session does not automatically guarantee a successful installation or a working callback.
๐๐๐๐๐ก๐ฆ๐๐ฉ๐ ๐ง๐๐๐๐๐ช๐๐ฌ
From a blue-team perspective, monitor unexpected writes to administrative shares, remote WMI/DCOM activity, unusual MSI installations, and unexpected outbound connections from Windows servers.
Restrict administrative privileges, limit remote management to trusted hosts, protect credentials, and review Windows event logs alongside endpoint and network telemetry.
The goal is not to disable every administrative feature. It is to ensure that legitimate management mechanisms cannot be abused without appropriate authorization and visibility.
๐ง๐๐๐๐ก๐๐๐๐ ๐ฅ๐๐๐๐ฅ๐๐ก๐๐๐ฆ
Microsoft Learn โ Install method of the Win32_Product class: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/msiprov/install-method-in-class-win32-product
Microsoft Learn โ RPC dynamic port allocation and firewall considerations: https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-rpc-dynamic-port-allocation-with-firewalls
๐ ๐๐ฆ๐๐จ๐๐ฆ๐๐ | ๐๐ฌ๐๐๐ฅ๐ฆ๐๐๐จ๐ฅ๐๐ง๐ฌ ๐ฅ๐๐ฆ๐ข๐จ๐ฅ๐๐๐ฆ
Want to learn cybersecurity, ethical hacking, penetration testing, and bug bounty hunting? Explore my courses and free learning resources below.
๐ช๐ต๐ฎ๐๐๐๐ฝ๐ฝ ๐ฆ๐๐ฝ๐ฝ๐ผ๐ฟ๐
For course details, mentorship inquiries, and questions:
๐ข๐ณ๐ณ๐ถ๐ฐ๐ถ๐ฎ๐น ๐ช๐ฒ๐ฏ๐๐ถ๐๐ฒ
๐๐ฟ๐ฒ๐ฒ ๐๐ผ๐บ๐ฝ๐น๐ฒ๐๐ฒ ๐๐ผ๐๐ฟ๐๐ฒ ๐ข๐๐๐น๐ถ๐ป๐ฒ ๐ฃ๐๐
Explore the complete cybersecurity learning roadmap:
https://masaudsec.com/ethical-hacking-complete-roadmap.pdf
๐ฃ๐ฟ๐ฒ๐บ๐ถ๐๐บ ๐จ๐ฑ๐ฒ๐บ๐ ๐๐ผ๐๐ฟ๐๐ฒ
Cybersecurity, Ethical Hacking & Pentesting | All-in-One
Coupon Code: MASAUDSEC1
https://www.udemy.com/.../cybersecurity-ethical.../...
๐๐ถ๐ป๐ธ๐ฒ๐ฑ๐๐ป
Connect for cybersecurity content and professional updates:
https://linkedin.com/in/masaudsec/
๐๐ฟ๐ฒ๐ฒ ๐ญ๐ฎ-๐๐ผ๐๐ฟ ๐๐๐ฏ๐ฒ๐ฟ๐๐ฒ๐ฐ๐๐ฟ๐ถ๐๐ ๐๐ผ๐ผ๐๐ฐ๐ฎ๐บ๐ฝ
Start learning ethical hacking and penetration testing for free:
๐ช๐ฎ๐๐ฐ๐ต ๐บ๐ ๐๐ผ๐๐ฟ๐๐ฒ ๐ข๐๐๐น๐ถ๐ป๐ฒ ๐๐ ๐ฝ๐น๐ฎ๐ป๐ฎ๐๐ถ๐ผ๐ป
Follow MasaudSec for more cybersecurity tutorials, practical learning resources, and ethical hacking content.
๐๐ฒ๐ฎ๐ฟ๐ป ๐ฆ๐บ๐ฎ๐ฟ๐. ๐ฃ๐ฟ๐ฎ๐ฐ๐๐ถ๐ฐ๐ฒ ๐๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐๐น๐. ๐๐ฟ๐ผ๐ ๐ฌ๐ผ๐๐ฟ ๐ฆ๐ธ๐ถ๐น๐น๐.
๐๐๐๐ฅ๐ก ๐๐ฌ๐๐๐ฅ๐ฆ๐๐๐จ๐ฅ๐๐ง๐ฌ ๐๐ฅ๐ข๐ ๐๐๐ฆ๐๐ ๐ง๐ข ๐๐๐ฉ๐๐ก๐๐๐
#CyberSecurity #TryHackMe #LateralMovement #WMI #WindowsSecurity #RedTeam #BlueTeam #Pentesting #CyberSecurityLab