Skip to content
/ Wsman Public

A PHP package for WSMan (WS-Management Protocol)

License

Notifications You must be signed in to change notification settings

webzes/Wsman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wsman - A PHP package for WS-Management Protocol

-- Coming soon!

Installation

You don't (just yet). The package is not quite ready ^_^

Usage

Create a client

use dcone80\Wsman\Wsman;

$client = new Wsman([
        'location' => "http://TARGET-HOST:5985",
        'login' => 'username',
        'password' => 'password',
    ]);

Simple Queries

Identity target

$response = $client->identify();

Get WinRM Config

$config = $client->get('winrm/config');

WMI Queries

Get Volume C:

$response = $client->get('wmicimv2/Win32_logicaldisk', ['DeviceId' => 'C:']);

List Windows Services:

$response = $client->enumerate('wmicimv2/Win32_Service');

Using WQL:

$params = [
	'dialect' => 'WQL',
	'query' => 'select * from Win32_Service WHERE DelayedAutoStart = "true"'
];
$results = $client->enumerate('wmicimv2/*', $params);

Windows Registy Query

$params = [
  'hDefKey' => '2147483650',
  'sSubKeyName' => 'SOFTWARE\Microsoft\Windows NT\CurrentVersion',
  'sValueName' => 'ProductName'
];

$response = $client->invoke('GetStringValue', 'wmi/root/default/StdRegProv', $params);

TODO

  • Support for BASIC Authentication
  • Support for Negotiate Authentication
  • Implement Get Method
  • Implement Identify Method
  • Implement Enumerate Method
  • Implement Invoke Method
  • Implement Put Method
  • Implement Delete Method
  • Handle Errors and failed requests
  • Use Guzzlehttp client instead of plain CURL
  • Test againsts non-Windows based devices
  • Handle/Remove hard-coded language tags in SOAP headers

About

A PHP package for WSMan (WS-Management Protocol)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages