system

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 6 Imported by: 0

README

System Examples

  • This package provides some functions which can be really useful during system reconnaissance or whatever you want

General info

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/system"
)

func main(){
  home, err := system.Home() // Get home folder
  // handle error
  fmt.Println(home)

  fmt.Println(system.Env()) // Acts as a wrapper of os.Environ()

  cwd, err := system.Pwd() // Get current working directory
  // handle error
  fmt.Println(cwd)

  user, err := system.Whoami() // Get current system username
  // handle error
  fmt.Println(user)

  groups, err := system.GetGroups() // List user groups names
  // handle error
  fmt.Println(groups)

  pipes, err := system.GetPipes() // Returns a []string (only for Windows)
  // handle error
  fmt.Println(pipes)

  software, err := system.GetUsefulSoftware() // Returns a []string with useful installed software (e.g. python.exe)
  // handle error
  fmt.Println(software)

  uptime := system.Uptime() // Only for windows
  fmt.Println(uptime)

  sid, err := system.GetSid() // Returns user SID
  // handle error
  fmt.Println(sid)

  rid, err := system.GetRid() // Returns RID
  // handle error
  fmt.Println(rid)
}

Find installed AVs/EDRs

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/system"
)

func main(){
  all_info := system.GetEdrInfo() // Returns a custom struct see edr_windows.go for help

  fmt.Println(all_info.Format()) // Returns a formatted string with info
}

Get full user information

This functions attemps to be a native Golang "whoami /all"

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/system"
)

func main(){
  user_info, err := system.WhoamiAll()
  // handle error

  fmt.Println(user_info.Username)
  fmt.Println(user_info.IntegrityLevel)
  fmt.Println(user_info.Privileges)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env() []string

func GetGroups added in v0.1.2

func GetGroups() ([]string, error)

func GetHome

func GetHome() (string, error)

func GetUsefulSoftware

func GetUsefulSoftware() ([]string, error)

func List

func List(dir_to_list string) (string, error)

func Pwd

func Pwd() (string, error)

func Whoami

func Whoami() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL