Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
github.com/bi-zone/wmi
Package wmi provides a WMI Query Language (WQL) interface for Windows Management Instrumentation (WMI) on Windows.
This package uses COM API for WMI therefore it's only usable on the Windows machines.
Package reference is available at https://godoc.org/github.com/bi-zone/wmi
Fork is fully compatibly with the original repo. If not - please open an issue.
New features introduced in fork:
float32
,
string
, bool
, uintptr
and time.Time
IDispatch
objectSWbemServices.Get
+ auto dereference of REF fieldsSWbemServices.ExecNotificationQuery
supportPrint names of the currently running processes
package main
import (
"fmt"
"log"
"github.com/bi-zone/wmi"
)
type win32Process struct {
PID uint32 `wmi:"ProcessId"`
Name string
UserField int `wmi:"-"`
}
func main() {
var dst []win32Process
q := wmi.CreateQueryFrom(&dst, "Win32_Process", "")
fmt.Println(q)
if err := wmi.Query(q, &dst); err != nil {
log.Fatal(err)
}
for _, v := range dst {
fmt.Printf("%6d\t%s\n", v.PID, v.Name)
}
}
A more sophisticated examples are located at in examples
folder.
Using DefaultClient
, SWbemServices
or SWbemServicesConnection
differ in a number
of setup calls doing to perform each query (from the most to the least).
Estimated overhead is shown below:
BenchmarkQuery_DefaultClient 5000 33529798 ns/op
BenchmarkQuery_SWbemServices 5000 32031199 ns/op
BenchmarkQuery_SWbemConnection 5000 30099403 ns/op
You could reproduce the results on your machine running:
go test -run=NONE -bench=Query -benchtime=120s
Project uses semantic versioning for version numbers, which is similar to the version contract of the Go language. Which means that the major version will always maintain backwards compatibility with minor versions. Minor versions will only add new additions and changes. Fixes will always be in patch.
This contract should allow you to upgrade to new minor and patch versions without breakage or modifications to your existing code. Leave a ticket, if there is breakage, so that it could be fixed.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.