phantomtcp

package
v0.0.0-...-8ea0116 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPT_NONE  = 0x0
	OPT_TTL   = 0x1 << 0
	OPT_MSS   = 0x1 << 1
	OPT_WMD5  = 0x1 << 2
	OPT_WACK  = 0x1 << 3
	OPT_WCSUM = 0x1 << 4
	OPT_HTTPS = 0x1 << 5
	OPT_STRIP = 0x1 << 6
	OPT_NAT64 = 0x1 << 7
	OPT_IPV4  = 0x1 << 8
	OPT_IPV6  = 0x1 << 9
	OPT_MODE2 = 0x1 << 10
)
View Source
const (
	SO_ORIGINAL_DST      = 80
	IP6T_SO_ORIGINAL_DST = 80
)

Variables

View Source
var ConnInfo4 [65536]*ConnectionInfo
View Source
var ConnInfo6 [65536]*ConnectionInfo
View Source
var ConnSyn4 [65536]bool
View Source
var ConnSyn6 [65536]bool
View Source
var DNS string = ""
View Source
var DNS64 string = ""
View Source
var DNSCache map[string]Answer
View Source
var DomainMap map[string]Config
View Source
var Forward bool = false
View Source
var LogLevel = 0
View Source
var Logger *log.Logger
View Source
var MethodMap = map[string]uint32{
	"none":   OPT_NONE,
	"ttl":    OPT_TTL,
	"mss":    OPT_MSS,
	"w-md5":  OPT_WMD5,
	"w-ack":  OPT_WACK,
	"w-csum": OPT_WCSUM,
	"https":  OPT_HTTPS,
	"strip":  OPT_STRIP,
	"nat64":  OPT_NAT64,
	"ipv4":   OPT_IPV4,
	"ipv6":   OPT_IPV6,
	"mode2":  OPT_MODE2,
}
View Source
var Nose []string
View Source
var SubdomainDepth = 2

Functions

func BuildLie

func BuildLie(request []byte, id int, qtype int) []byte

func ConnectionMonitor

func ConnectionMonitor(devices []string)

func DevicePrint

func DevicePrint()

func Dial

func Dial(addresses []net.IP, port int, b []byte, conf *Config) (net.Conn, error)

func DialStrip

func DialStrip(host string, fronting string) (*tls.Conn, error)

func GetHost

func GetHost(b []byte) (offset int, length int)

func GetLocalAddr

func GetLocalAddr(name string, port int, ipv6 bool) (*net.TCPAddr, error)

func GetOriginalDST

func GetOriginalDST(conn *net.TCPConn) (*net.TCPAddr, error)

func GetPAC

func GetPAC(address string) string

func GetQName

func GetQName(buf []byte) (string, int, int)

func GetSNI

func GetSNI(b []byte) (offset int, length int)

func HTTP

func HTTP(client net.Conn, addresses []net.IP, port int, b []byte, conf *Config) (net.Conn, error)

func HttpMove

func HttpMove(conn net.Conn, host string, b []byte) bool

func Init

func Init()

func IsAddressInUse

func IsAddressInUse(err error) bool

func IsNormalError

func IsNormalError(err error) bool

func LoadConfig

func LoadConfig(filename string) error

func LoadHosts

func LoadHosts(filename string) error

func NSLookup

func NSLookup(name string, qtype uint16) (int, []net.IP)

func PackQName

func PackQName(name string) []byte

func PackRequest

func PackRequest(name string, qtype uint16) []byte

func Proxy

func Proxy(client net.Conn)

func SNIProxy

func SNIProxy(client net.Conn)

func SendFakePacket

func SendFakePacket(connInfo *ConnectionInfo, payload []byte, config *Config, count int) error

func SocksProxy

func SocksProxy(client net.Conn)

func TCPlookup

func TCPlookup(request []byte, address string) ([]byte, error)

func TCPlookupDNS64

func TCPlookupDNS64(request []byte, address string, offset int, prefix []byte) ([]byte, error)

func TLSlookup

func TLSlookup(request []byte, address string) ([]byte, error)

Types

type Answer

type Answer struct {
	Index     int
	Addresses []net.IP
}

type Config

type Config struct {
	Option uint32
	TTL    byte
	MAXTTL byte
	MSS    uint16
	Device string
}

func ConfigLookup

func ConfigLookup(name string) (Config, bool)

type ConnectionInfo

type ConnectionInfo struct {
	Link gopacket.LinkLayer
	IP   gopacket.NetworkLayer
	TCP  layers.TCP
}

func DialConnInfo

func DialConnInfo(laddr, raddr *net.TCPAddr) (*net.TCPConn, *ConnectionInfo, error)

Jump to

Keyboard shortcuts

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