MCPcopy Create free account

hub / github.com/An00bRektn/gopher47 / functions

Functions81 in github.com/An00bRektn/gopher47

↓ 11 callersMethodadd_data
( self, data: str )
havoc/agent.py:37
↓ 10 callersMethodbuilder_send_message
(self, client_id: str, msg_type: str, message: str)
havoc/agent.py:252
↓ 6 callersFunctionStrip
* Removes null bytes at end of string, then whitespace, and casts to string */
pkg/utils/parsing.go:10
↓ 6 callersMethodconsole_message
( self, agent_id: str, type: str, message: str, output: str )
havoc/agent.py:177
↓ 3 callersFunctioncheckIn
(dat string, checkInType string)
gopher47.go:163
↓ 2 callersFunctionFindNotLoopback
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 callersFunctionJsonEscape
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 callersFunctionbuild_request
(head_type, body: dict)
havoc/service.py:13
↓ 2 callersMethodbuilder_send_payload
( self, client_id: str, filename: str, payload: bytes )
havoc/agent.py:274
↓ 2 callersFunctioncheckError
this will probably never get used but I'm too lazy to get rid of it
gopher47.go:43
↓ 2 callersFunctiongetProcUID
(pid int)
pkg/agentfuncs/ps_linux.go:40
↓ 1 callersFunctionGetConfig
* 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 callersFunctionRunCommand
(command string)
gopher47.go:231
↓ 1 callersFunctionWriteMemory
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 callersFunctionbuild_request
(head_type, body: dict)
havoc/agent.py:14
↓ 1 callersMethoddownload_file
( self, agent_id: str, file_name: str, size: int, content: str )
havoc/agent.py:152
↓ 1 callersFunctionfixVersion
Fixes version output from go-sysinfo to suit the teamserver's parsing as of 1-1-2024
gopher47.go:61
↓ 1 callersFunctiongenHeader
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 callersMethodgenerate
( self, config: dict )
havoc/agent.py:149
↓ 1 callersFunctiongetCmdLine
(pid int)
pkg/agentfuncs/ps_linux.go:30
↓ 1 callersFunctiongetProcPPID
(pid int)
pkg/agentfuncs/ps_linux.go:67
↓ 1 callersFunctiongetProcUser
(pid int)
pkg/agentfuncs/ps_linux.go:55
↓ 1 callersMethodget_buffer
( self )
havoc/agent.py:27
↓ 1 callersMethodget_dict
( self )
havoc/agent.py:117
↓ 1 callersMethodget_task_queue
( self, AgentInfo: dict )
havoc/agent.py:200
↓ 1 callersMethodjob_generate
( self, arguments: dict )
havoc/agent.py:114
↓ 1 callersFunctionmain
()
handler.py:425
↓ 1 callersFunctionnewUnixProcess
(pid int)
pkg/agentfuncs/ps_linux.go:80
↓ 1 callersMethodparse_bytes
( self )
havoc/agent.py:72
↓ 1 callersMethodparse_int
( self )
havoc/agent.py:65
↓ 1 callersFunctionprocesses
()
pkg/agentfuncs/ps_linux.go:112
↓ 1 callersMethodregister
( self, agent_header: dict, register_info: dict )
havoc/agent.py:231
↓ 1 callersFunctionregisterAgent
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 callersMethodregister_agent
( self, agent_type: AgentType )
havoc/service.py:86
↓ 1 callersMethodresponse
( self, response: dict )
havoc/agent.py:249
↓ 1 callersMethodtask_prepare
( self, arguments: dict )
havoc/agent.py:143
↓ 1 callersFunctionvalidateArgs
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 callersFunctionworker
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
FunctionCheckIn
A call to get some info in case you wanted to see that
pkg/agentfuncs/checkin.go:16
FunctionDownload
(path string)
pkg/agentfuncs/upload.go:29
FunctionExecuteAssembly
(assemblyEnc string, params []string)
pkg/agentfuncs/execute-assembly_linux.go:5
FunctionExecuteAssembly
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
FunctionKill
Kill finds a process from a PID and terminates it.
pkg/agentfuncs/ps_windows.go:56
FunctionKill
Kill finds a process from a PID and terminates it.
pkg/agentfuncs/ps_linux.go:172
FunctionLs
(dir string)
pkg/agentfuncs/shell_linux.go:25
FunctionLs
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
FunctionPortScanTCP
(addr string, targets []int, workers int)
pkg/agentfuncs/portscan.go:25
FunctionPowerShell
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
FunctionPs
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
FunctionPs
()
pkg/agentfuncs/ps_linux.go:150
FunctionSelfInject
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
FunctionSelfInject
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
FunctionShell
Execute via system shell so we have access to shell internal commands
pkg/agentfuncs/shell_linux.go:17
FunctionShell
(cmd []string)
pkg/agentfuncs/shell_windows.go:13
FunctionUpload
(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
Methodadd_int
( self, data )
havoc/agent.py:30
Methoddump
( self )
havoc/agent.py:47
Methodgenerate
( self, config: dict )
handler.py:287
Methodget_dict
( self )
havoc/agent.py:291
Methodjob_generate
( self, arguments: dict )
handler.py:26
Methodjob_generate
( self, arguments: dict )
handler.py:39
Methodjob_generate
( self, arguments: dict )
handler.py:58
Methodjob_generate
( self, arguments: dict )
handler.py:77
Methodjob_generate
( self, arguments: dict )
handler.py:90
Methodjob_generate
(self, arguments:dict)
handler.py:114
Methodjob_generate
(self, arguments:dict)
handler.py:139
Methodjob_generate
(self, arguments:dict)
handler.py:171
Methodjob_generate
(self, arguments:dict)
handler.py:191
Methodjob_generate
(self, arguments:dict)
handler.py:216
Methodjob_generate
( self, arguments: dict )
handler.py:234
Functionmain
()
gopher47.go:348
Methodparse_pad
( self, length: int )
havoc/agent.py:81
Methodparse_str
( self )
havoc/agent.py:88
Methodresponse
(self, response: dict)
handler.py:382
Methodservice_dispatch
( self, data: dict )
havoc/service.py:109