Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/An00bRektn/gopher47
/ functions
Functions
81 in github.com/An00bRektn/gopher47
⨍
Functions
81
◇
Types & classes
21
↓ 11 callers
Method
add_data
( self, data: str )
havoc/agent.py:37
↓ 10 callers
Method
builder_send_message
(self, client_id: str, msg_type: str, message: str)
havoc/agent.py:252
↓ 6 callers
Function
Strip
* Removes null bytes at end of string, then whitespace, and casts to string */
pkg/utils/parsing.go:10
↓ 6 callers
Method
console_message
( self, agent_id: str, type: str, message: str, output: str )
havoc/agent.py:177
↓ 3 callers
Function
checkIn
(dat string, checkInType string)
gopher47.go:163
↓ 2 callers
Function
FindNotLoopback
because of how weird interfaces get named, it's a lot easier to get all of the IPs, and then find the first one that isn't loopback or IPv6 might ruin
pkg/utils/parsing.go:33
↓ 2 callers
Function
JsonEscape
https://stackoverflow.com/questions/51691901/how-do-you-escape-characters-within-a-string-json-format * Escapes characters that would otherwise break
pkg/utils/parsing.go:20
↓ 2 callers
Function
build_request
(head_type, body: dict)
havoc/service.py:13
↓ 2 callers
Method
builder_send_payload
( self, client_id: str, filename: str, payload: bytes )
havoc/agent.py:274
↓ 2 callers
Function
checkError
this will probably never get used but I'm too lazy to get rid of it
gopher47.go:43
↓ 2 callers
Function
getProcUID
(pid int)
pkg/agentfuncs/ps_linux.go:40
↓ 1 callers
Function
GetConfig
* Returns config to agent. Make modifications here. We're defining the config here so it's more "malleable", although this isn't a one-to-one */
pkg/utils/config.go:22
↓ 1 callers
Function
RunCommand
(command string)
gopher47.go:231
↓ 1 callers
Function
WriteMemory
WriteMemory writes the provided memory to the specified memory address. Does **not** check permissions, may cause panic if memory is not writable etc.
pkg/agentfuncs/inject_windows.go:62
↓ 1 callers
Function
build_request
(head_type, body: dict)
havoc/agent.py:14
↓ 1 callers
Method
download_file
( self, agent_id: str, file_name: str, size: int, content: str )
havoc/agent.py:152
↓ 1 callers
Function
fixVersion
Fixes version output from go-sysinfo to suit the teamserver's parsing as of 1-1-2024
gopher47.go:61
↓ 1 callers
Function
genHeader
Generates an Agent ID of 4 lowercase letters See: https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2/third-par
gopher47.go:51
↓ 1 callers
Method
generate
( self, config: dict )
havoc/agent.py:149
↓ 1 callers
Function
getCmdLine
(pid int)
pkg/agentfuncs/ps_linux.go:30
↓ 1 callers
Function
getProcPPID
(pid int)
pkg/agentfuncs/ps_linux.go:67
↓ 1 callers
Function
getProcUser
(pid int)
pkg/agentfuncs/ps_linux.go:55
↓ 1 callers
Method
get_buffer
( self )
havoc/agent.py:27
↓ 1 callers
Method
get_dict
( self )
havoc/agent.py:117
↓ 1 callers
Method
get_task_queue
( self, AgentInfo: dict )
havoc/agent.py:200
↓ 1 callers
Method
job_generate
( self, arguments: dict )
havoc/agent.py:114
↓ 1 callers
Function
main
()
handler.py:425
↓ 1 callers
Function
newUnixProcess
(pid int)
pkg/agentfuncs/ps_linux.go:80
↓ 1 callers
Method
parse_bytes
( self )
havoc/agent.py:72
↓ 1 callers
Method
parse_int
( self )
havoc/agent.py:65
↓ 1 callers
Function
processes
()
pkg/agentfuncs/ps_linux.go:112
↓ 1 callers
Method
register
( self, agent_header: dict, register_info: dict )
havoc/agent.py:231
↓ 1 callers
Function
registerAgent
Sends the initial check-in to register the agent Forms and sends a POST request to teamserver with all required information Heavily reliant on elastic
gopher47.go:82
↓ 1 callers
Method
register_agent
( self, agent_type: AgentType )
havoc/service.py:86
↓ 1 callers
Method
response
( self, response: dict )
havoc/agent.py:249
↓ 1 callers
Method
task_prepare
( self, arguments: dict )
havoc/agent.py:143
↓ 1 callers
Function
validateArgs
with how the handler works right now, if someone just sends a command like `shell` the teamserver will send it, and we need to reject that
gopher47.go:219
↓ 1 callers
Function
worker
Based off of Blackhat Go: https://github.com/blackhat-go/bhg/blob/master/ch-2/tcp-scanner-final/main.go
pkg/agentfuncs/portscan.go:12
Function
CheckIn
A call to get some info in case you wanted to see that
pkg/agentfuncs/checkin.go:16
Function
Download
(path string)
pkg/agentfuncs/upload.go:29
Function
ExecuteAssembly
(assemblyEnc string, params []string)
pkg/agentfuncs/execute-assembly_linux.go:5
Function
ExecuteAssembly
Ne0nd0g is my goat don't have to put this together myself pog takes the raw bytes from a .NET PE and uses Ne0nd0g's go-clr to host the CLR and run it
pkg/agentfuncs/execute-assembly_windows.go:16
Function
Kill
Kill finds a process from a PID and terminates it.
pkg/agentfuncs/ps_windows.go:56
Function
Kill
Kill finds a process from a PID and terminates it.
pkg/agentfuncs/ps_linux.go:172
Function
Ls
(dir string)
pkg/agentfuncs/shell_linux.go:25
Function
Ls
TODO: Make a Windows version that looks nice We need to parse ACLs and stuff and that's hard :( This looks relevant but idk: https://github.com/
pkg/agentfuncs/shell_windows.go:42
Function
PortScanTCP
(addr string, targets []int, workers int)
pkg/agentfuncs/portscan.go:25
Function
PowerShell
Currently unused - I want to try and do some unmanaged powershell stuff, but I need to learn how to do that first
pkg/agentfuncs/shell_windows.go:27
Function
Ps
TODO: This works very well on windows, not so well on Linux maybe we use a different package? specifically, it only works on linux with sudo per
pkg/agentfuncs/ps_windows.go:17
Function
Ps
()
pkg/agentfuncs/ps_linux.go:150
Function
SelfInject
TODO: Consider possibly doing that trick to run shellcode from the commandline? Maybe just do what OffensiveNotion does and make it a dropper?
pkg/agentfuncs/inject_linux.go:7
Function
SelfInject
Credit: https://github.com/chvancooten/maldev-for-dummies/blob/main/Exercises/Exercise%201%20-%20Basic%20Shellcode%20Loader/solutions/golang/BasicShel
pkg/agentfuncs/inject_windows.go:17
Function
Shell
Execute via system shell so we have access to shell internal commands
pkg/agentfuncs/shell_linux.go:17
Function
Shell
(cmd []string)
pkg/agentfuncs/shell_windows.go:13
Function
Upload
(path string, fileb64 string)
pkg/agentfuncs/upload.go:9
Method
__init__
( self, buffer, length )
havoc/agent.py:58
Method
__init__
( self, name: str, is_file_path: bool, is_optional: bool )
havoc/agent.py:96
Method
__init__
(self, endpoint: str, password: str)
havoc/service.py:31
Method
__ws_on_error
(self, wsapp, error)
havoc/service.py:58
Method
__ws_on_message
( self, ws, data )
havoc/service.py:74
Method
__ws_on_open
(self, socket)
havoc/service.py:61
Method
add_int
( self, data )
havoc/agent.py:30
Method
dump
( self )
havoc/agent.py:47
Method
generate
( self, config: dict )
handler.py:287
Method
get_dict
( self )
havoc/agent.py:291
Method
job_generate
( self, arguments: dict )
handler.py:26
Method
job_generate
( self, arguments: dict )
handler.py:39
Method
job_generate
( self, arguments: dict )
handler.py:58
Method
job_generate
( self, arguments: dict )
handler.py:77
Method
job_generate
( self, arguments: dict )
handler.py:90
Method
job_generate
(self, arguments:dict)
handler.py:114
Method
job_generate
(self, arguments:dict)
handler.py:139
Method
job_generate
(self, arguments:dict)
handler.py:171
Method
job_generate
(self, arguments:dict)
handler.py:191
Method
job_generate
(self, arguments:dict)
handler.py:216
Method
job_generate
( self, arguments: dict )
handler.py:234
Function
main
()
gopher47.go:348
Method
parse_pad
( self, length: int )
havoc/agent.py:81
Method
parse_str
( self )
havoc/agent.py:88
Method
response
(self, response: dict)
handler.py:382
Method
service_dispatch
( self, data: dict )
havoc/service.py:109