ms-scmr 0.1.0

Pure-Rust MS-SCMR (Service Control Manager Remote) client — the psexec primitive: open the remote SCM over an authenticated `\PIPE\svcctl` SMB pipe, create a transient service, start it (LocalSystem), delete it, and capture its output off `C$`. No Windows runtime dependency.
Documentation
  • Coverage
  • 36.84%
    7 out of 19 items documented1 out of 8 items with examples
  • Size
  • Source code size: 30.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 240.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • icedracon

ms-scmr

Pure-Rust client for MS-SCMR (Service Control Manager Remote) — the wire protocol behind sc.exe, remote service inventory, and the psexec-style "create a service whose binary is your command, start it, delete it" primitive.

Layered over the dcerpc crate (which provides the authenticated \PIPE\svcctl SMB transport, NDR marshaling, and RpcError / Syntax types). Together they let a Rust program do everything sc.exe / services.msc do remotely, without a Windows runtime.

Dual-use

SCMR is one of the everyday tools of a Windows admin: fleet service inventory, remote debugger start/stop, IR containment (sc stop wuauserv), routine automation. It's also the psexec primitive. This crate is published on that dual-use footing — the same wire surface serves defenders, DFIR, admin tooling, and offensive tooling.

Status

v0.1.0 — the CreateService → StartService → DeleteService cycle for command execution, plus the [exec] output-capture wrapper. Query/enum service state, RControlService, richer service-config, and the DACL surface are follow-ups on the 0.1 line (all additive).

Example

# use smb2_client::SmbClient;
# async fn demo(client: &mut SmbClient) -> Result<(), Box<dyn std::error::Error>> {
let res = ms_scmr::exec(client, "10.0.0.10", "whoami /all").await?;
println!("ran as LocalSystem: {}", res.ran);
if let Some(out) = res.output { println!("{out}"); }
# Ok(()) }

License

MIT.