exec

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 1 Imported by: 0

README

Execution examples

Commands

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/src/exec"
)

func main(){
  out := exec.ExecuteCommand("uname -a") // With bash or cmd
  fmt.Println(out)
}

Powershell Commands

package main

import (
  "fmt"

  "github.com/D3Ext/maldev/src/exec"
)

func main(){
  out := exec.ExecutePowershell("Get-Process -Name notepad") // Using powershell
  fmt.Println(out)
}

Execute Commands with Token

package main

import (
  "fmt"
  "log"

  "github.com/D3Ext/maldev/src/exec"
  "github.com/D3Ext/maldev/src/redteam"
)

func main(){
  // get a valid Windows token (e.g. impersonating a PID)
  token, err := redteam.Impersonate(1312)
  if err != nil {
    log.Fatal(err)
  }

  out := exec.ExecuteWithToken("whoami", token)
  fmt.Println(out)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(comm string) string

func ExecutePowershell

func ExecutePowershell(comm string) string

func ExecuteWithToken

func ExecuteWithToken(comm string, token windows.Token) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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