httpservefile

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// The local filename to read in
	FileToServe string
	// A randomly generated filename to serve
	FileName string
	// The file data to send to the client
	FileData []byte
	// The HTTP address to bind to
	HTTPAddr string
	// The HTTP port to bind to
	HTTPPort int
	// Set to the Server field in HTTP response
	ServerField string
}

The httpservefile Server spawns an HTTP server and hosts a single user provided file. The normal use case is for an exploit to curl/wget the file and execute it. This is useful to spawn connections to other tools (e.g. Metasploit, nc, etc.). This is not a traditional "c2" but serves as a useful backend that logically plugs into our c2 design.

func GetInstance

func GetInstance() *Server

A basic singleton interface for the c2.

func (*Server) CreateFlags

func (httpServer *Server) CreateFlags()

User options for serving a file over HTTP as the "c2".

func (*Server) Init

func (httpServer *Server) Init(rhostAddr string, rhostPort int, isClient bool) bool

load the provided file into memory. Generate the random filename.

func (*Server) Run

func (httpServer *Server) Run(timeout int)

start the HTTP server and listen for incoming requests for `httpServer.FileName`.

Jump to

Keyboard shortcuts

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