mirror of
https://github.com/trickster0/OffensiveRust
synced 2026-06-08 17:54:47 +00:00
wmi
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "wmi_execute"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
author = "trickster0"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
wmi = "0.9.0"
|
||||
@@ -0,0 +1,15 @@
|
||||
use wmi::{COMLibrary, WMIConnection};
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let _initialized_com = COMLibrary::new()?;
|
||||
|
||||
let wmi_con = unsafe { WMIConnection::with_initialized_com(Some("ROOT\\securitycenter2"))? };
|
||||
let results: Vec<HashMap<String, String>> = wmi_con.raw_query("SELECT displayName FROM AntiVirusProduct").unwrap();
|
||||
for av in results {
|
||||
println!("{:?}",av.get("displayName").unwrap());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user