tcpioneer

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPT_NONE  = 0x0
	OPT_TTL   = 0x1 << 0
	OPT_MD5   = 0x1 << 1
	OPT_WMD5  = 0x1 << 2
	OPT_WACK  = 0x1 << 3
	OPT_WCSUM = 0x1 << 4
	OPT_BAD   = 0x1 << 5
	OPT_IPOPT = 0x1 << 6
	OPT_SEQ   = 0x1 << 7
	OPT_HTTPS = 0x1 << 8
	OPT_MSS   = 0x1 << 9
	OPT_WTFO  = 0x1 << 10
	OPT_WULEN = 0x1 << 11

	OPT_MODE2  = 0x10000 << 0
	OPT_DF     = 0x10000 << 1
	OPT_TFO    = 0x10000 << 2
	OPT_SYN    = 0x10000 << 3
	OPT_NOFLAG = 0x10000 << 4
	OPT_SSEG   = 0x10000 << 5
	OPT_QUIC   = 0x10000 << 6
	OPT_FILTER = 0x10000 << 7
	OPT_SAT    = 0x10000 << 8
	OPT_NORST  = 0x10000 << 9
)
View Source
const (
	TCP_FIN = byte(0x01)
	TCP_SYN = byte(0x02)
	TCP_RST = byte(0x04)
	TCP_PSH = byte(0x08)
	TCP_ACK = byte(0x10)
	TCP_URG = byte(0x20)
	TCP_ECE = byte(0x40)
	TCP_CWR = byte(0x80)
)

Variables

View Source
var BadIPMap map[string]bool
View Source
var CookiesMap map[string][]byte
View Source
var DNS string = ""
View Source
var DetectEnable = false
View Source
var DomainMap map[string]Config
View Source
var Forward bool = false
View Source
var IPBlock = false
View Source
var IPMap map[string]IPConfig
View Source
var IPMode = 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,
	"md5":    OPT_MD5,
	"w-md5":  OPT_WMD5,
	"w-ack":  OPT_WACK,
	"w-csum": OPT_WCSUM,
	"bad":    OPT_BAD,
	"ipopt":  OPT_IPOPT,
	"seq":    OPT_SEQ,
	"https":  OPT_HTTPS,
	"w-tfo":  OPT_WTFO,
	"w-ulen": OPT_WULEN,

	"mode2":   OPT_MODE2,
	"df":      OPT_DF,
	"tfo":     OPT_TFO,
	"syn":     OPT_SYN,
	"no-flag": OPT_NOFLAG,
	"s-seg":   OPT_SSEG,
	"quic":    OPT_QUIC,
	"filter":  OPT_FILTER,
	"sat":     OPT_SAT,
	"no-rst":  OPT_NORST,
}
View Source
var PortList4 [65536]*ConnInfo
View Source
var PortList6 [65536]*ConnInfo
View Source
var ProxyList4 [65536]*ProxyInfo
View Source
var ProxyList6 [65536]*ProxyInfo
View Source
var RSTFilterEnable = false
View Source
var ScanTimeout uint = 0
View Source
var ScanURL string = ""
View Source
var SubdomainDepth = 2
View Source
var SynOption []byte
View Source
var TFOEnable = false

Functions

func AddECS added in v0.5.3

func AddECS(request []byte, ecs net.IP) []byte

func CheckServer added in v0.5.1

func CheckServer(URL string, ip net.IP, timeout uint)

func DNSDaemon

func DNSDaemon()

func DNSRecvDaemon

func DNSRecvDaemon()

func LoadConfig

func LoadConfig() error

func LoadHosts added in v0.5.3

func LoadHosts(name string) error

func NAT64

func NAT64(ipv4 net.IP, ipv6 net.IP, forward bool)

func ProxyRedirect added in v0.4.2

func ProxyRedirect(forward bool)

func Scan added in v0.5.1

func Scan(ipRange string, speed int)

func SendFakePacket

func SendFakePacket(winDivert *godivert.WinDivertHandle, info *ConnInfo, packet *godivert.Packet, host_offset int, host_length int, count int) (int, error)

func SocksProxyAddr added in v0.4.2

func SocksProxyAddr(conn net.Conn, ip net.IP, port int, proxy *net.TCPAddr, header []byte)

func SocksProxyHost added in v0.4.2

func SocksProxyHost(conn net.Conn, host string, port int, proxy *net.TCPAddr, header []byte)

func TCPDaemon

func TCPDaemon(address string, forward bool)

func TCPDetection added in v0.3.3

func TCPDetection(winDivert *godivert.WinDivertHandle, winDivertAddr godivert.WinDivertAddress, srcIP []byte, ips []string, port, ttl int) []string

func TCPRecv added in v0.3.3

func TCPRecv(srcPort int, forward bool)

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 UDPDaemon

func UDPDaemon(dstPort int, forward bool)

func Wait

func Wait()

Types

type Config

type Config struct {
	Option   uint32
	TTL      byte
	MAXTTL   byte
	MSS      uint16
	ECS      net.IP
	ANCount4 int16
	ANCount6 int16
	Answers4 []byte
	Answers6 []byte
}
var DefaultConfig *Config = nil

type ConnInfo

type ConnInfo struct {
	Option uint32
	SeqNum uint32
	TTL    byte
	MAXTTL byte
}

type IPConfig

type IPConfig struct {
	Option uint32
	TTL    byte
	MAXTTL byte
	MSS    uint16
}

func IPBlockLookup

func IPBlockLookup(addr string) (IPConfig, bool)

func IPLookup

func IPLookup(addr string) (IPConfig, bool)

type ProxyInfo added in v0.4.2

type ProxyInfo struct {
	SrcIP net.IP
	DstIP net.IP
	Port  uint16
}

Jump to

Keyboard shortcuts

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