svr

package
v0.0.0-...-8735c4a Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DestinationServer

type DestinationServer struct {
	// sni is the exact text from the SNI extension in ClientHello.
	SNI string
	// port is the destination port. Typically 443.
	Port int
	// An array of IP addresses for the server.
	IPs []string
}

DestinationServer represents a target server for the application.

func (DestinationServer) HostsString

func (s DestinationServer) HostsString(redirectIP string) (string, error)

HostsString is the representation of the svr. It can be pasted into the hosts file to redirect the endpoint to redirectIP. It does no format validation on redirectIP.

func (*DestinationServer) Lookup

func (s *DestinationServer) Lookup(server string) error

Lookup does a DNS lookup on the server and populates the IPs field.

func (DestinationServer) String

func (s DestinationServer) String() string

String is the stringer for the server.

type Servers

type Servers map[string]DestinationServer

Servers is an alias for map[string]DestinationServer.

func ReadPCAP

func ReadPCAP(pcapFile string, useIP bool) (Servers, error)

ReadPCAP reads a pcap file and returns a map of unpopulated servers. If useIP is false then we are going to use the IP addresses from the pcap and skip DNS lookups later.

func (Servers) Burp

func (servers Servers) Burp(listenerIP string) (string, error)

Burp creates and returns a Burp config string that can be loaded into Burp.

func (Servers) Hosts

func (servers Servers) Hosts(redirectIP string) string

Hosts creates the hosts file output for servers. Be sure to call PopulateServers() first if you have passed a DNS server to the app.

func (Servers) PopulateServers

func (servers Servers) PopulateServers(dns string)

PopulateServers calls Populate on a map of servers.

Jump to

Keyboard shortcuts

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