-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display os version with the info command #108
Comments
Yea, I was already running into this when thinking of how to apply https://j00ru.vexillium.org/syscalls/nt/64/ |
I actually ended up using https://godoc.org/github.com/shirou/gopsutil/host#PlatformInformation for that purpose, works well and supports Windows, Darwin and a bunch of Linux distros |
@capnspacehook thanks for the suggestion, I started a PoC with Gonna check gopsutil, see if I can get something working reliably. |
Yeah it really is a mess, and gopsutil is pretty reliable |
Alright,
Since this code will be inside the agent, I don't really want to embed more packages, especially for small tasks like this. |
Makes sense, and no problem! |
Alright, got something working for windows, kernel version for Linux, but nothing for macos right now:
Basic implementation is here |
Huh, unix.Uname doesn't work for MacOS? |
No idea, it should, but I don't have a mac os box to test that =/ |
Not to worry, I am of the acended MacOS clan: Code package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main() {
foo := &unix.Utsname{}
unix.Uname(foo)
fmt.Printf(" Sysname: %s\n", foo.Sysname)
fmt.Printf(" Nodename: %s\n", foo.Nodename)
fmt.Printf(" Release: %s\n", foo.Release)
fmt.Printf(" Version: %s\n", foo.Version)
fmt.Printf(" Machine: %s\n", foo.Machine)
} Output
|
Closed by 23e7987 |
Is your feature request related to a problem? Please describe.
The current
info
command does display a lot of useful stuff, but not the actual OS version the Sliver is running on. It could be useful to have that information.Describe the solution you'd like
Implement some kind of
GetVersion
function to fill out the gap here. As far as I'm aware, there is currently no cross-platform feature in the standard library to do that, so we would need platform specific code for each.The windows version could rely on GetVersion, whereas the Linux and Darwin ones could rely on unix.Uname.
Describe alternatives you've considered
Right now the only alternative I can think of is using the
shell
command to useuname
orsysinfo
, which is not really OPSEC friendly.The text was updated successfully, but these errors were encountered: