hellsgopher

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

README

hellsgopher

Go library for malware development

⚠️ THIS IS CURRENTLY UNDER DEVELOPMENT ⚠️

To add to your project

go get github.com/deranged0tter/hellsgopher

Functions

Command Line Functions

CmdReturn(command string) (string, error)
    will run a command with either `bash -c` or `cmd /C` and return the output

CmdSTDOUT(command string)
    will run a command with either `bash -c` or `cmd /C` and print output and error to STDOUT

CmdNoOut(command string)
    will run a command with either `bash -c` or `cmd /C` and will provide no output

PSReturn(command string) (string, error)
    runs a command with `powershell.exe` and returns the output as a string

PSSTDOUT(command string)
    runs a command with `powershell.exe` and prints the output and error to STDOUT

PSNoOut(command string)
    runs a command with `powershell.exe` and will provide no output

File Manipulation

CopyFile(source string, destination string) error
    copy a file

MoveFile(source string, destination string) error
    move a file

DeleteFile(filepath string) error
    delete a file

Chmod(filepath string, permissions os.FileMode) error
    change the permissions of a file

ZipFiles(files []string, zipFileName string) error
    takes a slice of file paths and creates a zip archive. zipFileName should not include ".zip"

DoesFileExist(filepath string) bool
    check if a file exists. return true if it does

ListFiles(directory string) ([]string, error)
    returns a slice of files in a given directory

ListFilesInPWD() ([]string, error)
    returns a slice of files in the present working directory

ListFilesR(directory string) ([]string, error)
    returns a slice of files in a given directory recursivley

ListFilesInPWDR() ([]string, error)
    returns a slice of iles in the present working directory recursivley

DownloadFile(source string, destination string) error
    download a file from a source url to destination

ReadFileToSlice(filepath string) ([]string, error)
    read a file line by line and return a slice with each line as a value

ReadFileToStr(filepath string) (string, error)
    read a file and return a string of its content

ClearFile(filepath string)
    wipe the contents of a file

PrependToFile(filepath string, content string)
    prepend text to a file (will create a new first line)

AppendToFile(filepath string, content string)
    append text to a file (will create a new last line)

Encryption

RandomInt(min int64, max int64) int64
    return a random integer between min and max

RandomStr(length int) string
    generates a random strength of length (uses a-zA-Z)

Base64EncodeStr(message string) string
    encode a string to base64 and return a string

Base64DecodeStr(message string) (string, error)
    decode a string from base64 and return a string

MD5SumStr(message string) string
    get the md5 hash of a string

MD5SumFile(filepath string) string
    get the md5 hash of a file

Sha1Str(message string) string
    get the sha1 hash of a string

Sha1File(filepath string) string
    get the sha1 hash of a file

Sha256Str(message string) string
    get the sha256 hash of a string

Sha256File(filepath string) string
    get the sha256 hash of a file

Sha512Str(message string) string
    get the sha512 hash of a string

Sha512File(filepath string) string
    get the sha512 hash of a file

Caesar(message string, shift int) (string, error)
    caesar cipher

User Enumeration

GetUsername() (string, error)
    returns the username of the user the process is running under

GetDisplayName() (string, error)
    returns the display name of the user the process is running under

GetUID() (string, error)
    returns the user id of the user the process is running under

GetGID() (string, error)
    returns the group id of the user the process is running under

ListUsers() ([]string, error)
    list all the users on the systen

System Enumeration

GetHostname() string
    returns the computer's hostname

GetDomainName() string
    return the domain name of the computer

GetOS() string
    return the operating system of the computer

GetOSBuild() string
    return the OS build of the computer

GetOSVersion() string
    return the OS version of the computer

Logging Functions

Warn(message string)
    output a warning message to STDOUT ("[!] message")

Error(message string)
    output an error message to STDOUT ("[-] message")

Okay(message string)
    output a success message to STDOUT ("[+] message")

Info(message string)
    output an information message to STDOUT ("[*] message")

Process Enumeration

ListProcesses() (map[int]string, error)
    returns a map of all process currently running

GetCurrentProcessID() int
    return the PID of the current process

GetCurrentParentProcessID() int
    return the PPID of the current process

GetCurrentProcessPath() (string, error)
    return the process path of the current process

GetCurrentProcessName() string
    return the name of the current process

GetCurrentProcessArch() string
    return the arch of the current process

Network Enumeration

GetInternalIP() string
    get the internal IP of the computer

GetAllInterfaces() []string
    return a slice of all interfaces on computer

Other

GenerateName() string
    return a string equaling to "adj_noun"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotExist         = errors.New("file does not exist")
	ErrUnknownGOOS      = errors.New("unknown GOOS")
	ErrNotWin           = errors.New("only works on windows")
	ErrFuncNotSupported = errors.New("this function is not supported")
	ErrBindAccept       = errors.New("unable to accept bind connection")
)

Functions

func AppendToFile

func AppendToFile(filepath string, content string)

append a string to a file

func Base64DecodeStr

func Base64DecodeStr(message string) (string, error)

decode a string from base64 and return a string

func Base64EncodeStr

func Base64EncodeStr(message string) string

encode a string to base64 and return a string

func BindShell

func BindShell(port int) error

start a listener for a bind shit shell. This is not secure by defualt

func Caesar

func Caesar(message string, shift int) (string, error)

caesar cipher

func Chmod

func Chmod(filepath string, permissions os.FileMode) error

change the permissions of a file

func ClearFile

func ClearFile(filepath string)

clears the content of a file

func CmdNoOut

func CmdNoOut(command string)

will run a command with either `bash -c` or `cmd /C` and will provide no output

func CmdReturn

func CmdReturn(command string) (string, error)

will run a command with either `bash -c` or `cmd /C` and return the output

func CmdSTDOUT

func CmdSTDOUT(command string)

will run a command with either `bash -c` or `cmd /C` and print output and error to STDOUT

func CopyFile

func CopyFile(source string, destination string) error

copy a file

func DeleteFile added in v0.1.2

func DeleteFile(filepath string) error

delete a file

func DoesFileExist

func DoesFileExist(filepath string) bool

check if a file exists. return true if it does

func DownloadFile

func DownloadFile(source string, destination string) error

download a file from source url to destination. if destination is left blank, will default to current directory with same filename from url

func Error

func Error(message string)

output error message to STDOUT

func GenerateName added in v0.1.1

func GenerateName() string

return a string equaling to "adj_noun"

func GetAllInterfaces

func GetAllInterfaces() []string

return a slice of all interfaces on the computer

func GetCurrentParentProcessID

func GetCurrentParentProcessID() int

get the ppid of the current process

func GetCurrentProcessArch

func GetCurrentProcessArch() string

return the arch of the running process

func GetCurrentProcessID

func GetCurrentProcessID() int

get the pid of the current process

func GetCurrentProcessName

func GetCurrentProcessName() string

return the name of the current process

func GetCurrentProcessPath

func GetCurrentProcessPath() (string, error)

return the proesses path of the current process

func GetDisplayName

func GetDisplayName() (string, error)

returns the display name of the user the process is running under

func GetDomainName

func GetDomainName() string

get the domain name of the computer

func GetGID

func GetGID() (string, error)

returns the group id of the user the process is running under

func GetHostname

func GetHostname() string

return the computer's hostname

func GetInternalIP

func GetInternalIP() string

get the internal ip of the computer

func GetOS

func GetOS() string

get the current operating system

func GetOSBuild

func GetOSBuild() string

get the os build

func GetOSVersion

func GetOSVersion() string

func GetUID

func GetUID() (string, error)

returns the user id of the user the process is running under

func GetUsername

func GetUsername() (string, error)

returns the username of the user the process is running under

func Info

func Info(message string)

output info message to STDOUT

func ListFiles

func ListFiles(directory string) ([]string, error)

list files in a given directory

func ListFilesInPWD

func ListFilesInPWD() ([]string, error)

list files in current directory

func ListFilesInPWDR

func ListFilesInPWDR() ([]string, error)

list files in current directory recursivley

func ListFilesR

func ListFilesR(directory string) ([]string, error)

list files in a given directory recursivley

func ListProcesses

func ListProcesses() (map[int]string, error)

return a map of all the current running processes

func ListUsers

func ListUsers() ([]string, error)

list all the users on the systen

func MD5SumFile

func MD5SumFile(filepath string) string

get the md5 hash of a file

func MD5SumStr

func MD5SumStr(message string) string

get the md5 hash of a string

func MoveFile

func MoveFile(source string, destination string) error

move a file

func Okay added in v0.1.2

func Okay(message string)

output success mesage to STDOUT

func PSNoOut

func PSNoOut(command string)

runs a command with `powershell -Command "& {}"` and will provide no output

func PSReturn

func PSReturn(command string) (string, error)

runs a command with `powershell -Command "& {}"` and returns the output as a string

func PSSTDOUT

func PSSTDOUT(command string)

runs a command with `powershell -Command "& {}"` and prints the output and error to STDOUT

func PrependToFile

func PrependToFile(filepath string, content string)

prepends a string to a file

func RandomInt

func RandomInt(min int64, max int64) int64

return a random integer between min and max (both inclusive)

func RandomStr

func RandomStr(length int) string

generate a random string of length length (Uses a-zA-Z)

func ReadFileToSlice

func ReadFileToSlice(filepath string) ([]string, error)

read a file line by line, putting each line into a slice

func ReadFileToStr

func ReadFileToStr(filepath string) (string, error)

read a file and return a string of its content

func ReverseShell

func ReverseShell(rhost string, rport int) error

spawn a reverse shit shell. Connects to a given host over tcp. Not secure by default

func Sha1File

func Sha1File(filepath string) string

get the sha1 hash of a file

func Sha1Str

func Sha1Str(message string) string

get the sha1 hash of a string

func Sha256File

func Sha256File(filepath string) string

get the sha256 hash of a file

func Sha256Str

func Sha256Str(message string) string

get the sha256 hash of a string

func Sha512File

func Sha512File(filepath string) string

get the sha512 hash of a file

func Sha512Str

func Sha512Str(message string) string

get the sha512 hash of a string

func Warn

func Warn(message string)

output a warning message to STDOUT

func ZipFiles

func ZipFiles(files []string, zipFileName string) error

takes a slice of file paths and creates a zip archive. zipFileName should not include ".zip"

Types

This section is empty.

Jump to

Keyboard shortcuts

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