Online Library:
Inquery Tool:
WMI Explorer (https://wmie.codeplex.com/)
An example of manipulating WMI through Perl
------------------------------ --------------
#!/usr/bin/perl -w
#use strict;
#Execute a command:
#wmic /node:remote_computer process call create "netstat.exe -ano"
use Win32::OLE;
$|=1;
print("Target IP: ");
$target=<STDIN>;
chop($target);
#my ( $ServiceSet, $Service );
eval { $NetworkAdapters = Win32::OLE->GetObject(" winmgmts:{impersonationLevel= impersonate}!\\\\".$target."\\ Root\\CIMv2")->ExecQuery(" SELECT * FROM Win32_NetworkAdapter"); };
unless($@){
print "\n";
foreach $Adapter (in $NetworkAdapters){
}
}else{
print STDERR Win32::OLE->LastError, "\n";
}
------------------------------ --------------
No comments:
Post a Comment