Documentation ¶
Index ¶
- Constants
- Variables
- func Checksum(payload []byte) []byte
- func DecodeOnion(addr []byte) (string, error)
- func EncodeOnion(onion string) ([]byte, error)
- func Hash256(payload []byte) [32]byte
- func ReadCompactSize(input []byte) (uint64, int)
- func SendPacket(conn net.Conn, msgstart []byte, pkt *Packet) error
- type BitcoinProtocolScanner
- func (rps *BitcoinProtocolScanner) HandleAddr(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, ...) error
- func (rps *BitcoinProtocolScanner) HandlePing(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, ...) error
- func (rps *BitcoinProtocolScanner) HandleVerAck(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, ...) error
- func (rps *BitcoinProtocolScanner) HandleVersion(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, ...) error
- func (rps *BitcoinProtocolScanner) MessageLoop(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService) error
- func (rps *BitcoinProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, ...)
- func (rps *BitcoinProtocolScanner) SendVersion(conn net.Conn, osc *config.OnionScanConfig, hiddenService string) error
- type FTPProtocolScanner
- type HTTPProtocolScanner
- type IRCProtocolScanner
- type MongoDBProtocolScanner
- type Packet
- type RicochetProtocolScanner
- type SMTPProtocolScanner
- type SSHProtocolScanner
- type Scanner
- type TLSProtocolScanner
- type VNCProtocolScanner
- type XMPPProtocolScanner
Constants ¶
const MAX_ADDR = 1000
Maximum number of addresses in addr packet
const MAX_PACKET_LENGTH = 1000*30 + 3
Maximum payload length of packet we expect to receive
const MAX_SUBVERSION_LENGTH = 256
Maximum length of user agent
const MSG_ADDR = "addr"
const MSG_FEEFILTER = "feefilter"
const MSG_GETADDR = "getaddr"
const MSG_PING = "ping"
const MSG_PONG = "pong"
const MSG_VERACK = "verack"
const MSG_VERSION = "version"
Message types
Variables ¶
var AddrStartOnion = []byte{0xfd, 0x87, 0xd8, 0x7e, 0xeb, 0x43}
P2P-encoded onion addresses start with this prefix
Functions ¶
func DecodeOnion ¶
Extract .onion from 16-byte "IPv6" address used by Bitcoin P2P
func EncodeOnion ¶
Encode .onion address into 16-byte "IPv6" address used by Bitcoin P2P
func ReadCompactSize ¶
Read "compact size" varint. Return value and size of value read. The latter will be 0 on error, which happens if there was not enough space to read it.
Types ¶
type BitcoinProtocolScanner ¶
type BitcoinProtocolScanner struct {
// contains filtered or unexported fields
}
func NewBitcoinProtocolScanner ¶
func NewBitcoinProtocolScanner(protocolName string) *BitcoinProtocolScanner
func (*BitcoinProtocolScanner) HandleAddr ¶
func (rps *BitcoinProtocolScanner) HandleAddr(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, pkt *Packet) error
Handle incoming addr message, and parse message payload into report
func (*BitcoinProtocolScanner) HandlePing ¶
func (rps *BitcoinProtocolScanner) HandlePing(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, pkt *Packet) error
Handle incoming ping message
func (*BitcoinProtocolScanner) HandleVerAck ¶
func (rps *BitcoinProtocolScanner) HandleVerAck(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, pkt *Packet) error
Handle incoming verack message
func (*BitcoinProtocolScanner) HandleVersion ¶
func (rps *BitcoinProtocolScanner) HandleVersion(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService, pkt *Packet) error
Handle incoming version message, and parse message payload into report
func (*BitcoinProtocolScanner) MessageLoop ¶
func (rps *BitcoinProtocolScanner) MessageLoop(conn net.Conn, osc *config.OnionScanConfig, report *report.BitcoinService) error
Receive messages and handle them
func (*BitcoinProtocolScanner) ScanProtocol ¶
func (rps *BitcoinProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
func (*BitcoinProtocolScanner) SendVersion ¶
func (rps *BitcoinProtocolScanner) SendVersion(conn net.Conn, osc *config.OnionScanConfig, hiddenService string) error
Build and send version message
type FTPProtocolScanner ¶
type FTPProtocolScanner struct { }
func (*FTPProtocolScanner) ScanProtocol ¶
func (sps *FTPProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type HTTPProtocolScanner ¶
func (*HTTPProtocolScanner) ScanProtocol ¶
func (hps *HTTPProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type IRCProtocolScanner ¶
type IRCProtocolScanner struct { }
func (*IRCProtocolScanner) ScanProtocol ¶
func (rps *IRCProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type MongoDBProtocolScanner ¶
type MongoDBProtocolScanner struct { }
func (*MongoDBProtocolScanner) ScanProtocol ¶
func (rps *MongoDBProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type RicochetProtocolScanner ¶
type RicochetProtocolScanner struct { }
func (*RicochetProtocolScanner) ScanProtocol ¶
func (rps *RicochetProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type SMTPProtocolScanner ¶
type SMTPProtocolScanner struct { }
func (*SMTPProtocolScanner) ScanProtocol ¶
func (sps *SMTPProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type SSHProtocolScanner ¶
type SSHProtocolScanner struct { }
func (*SSHProtocolScanner) ScanProtocol ¶
func (sps *SSHProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type Scanner ¶
type Scanner interface {
ScanProtocol(hiddenService string, onionscanConfig *config.OnionScanConfig, report *report.OnionScanReport)
}
type TLSProtocolScanner ¶
type TLSProtocolScanner struct { }
func (*TLSProtocolScanner) ScanProtocol ¶
func (sps *TLSProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type VNCProtocolScanner ¶
type VNCProtocolScanner struct { }
func (*VNCProtocolScanner) ScanProtocol ¶
func (vncps *VNCProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)
type XMPPProtocolScanner ¶
type XMPPProtocolScanner struct { }
func (*XMPPProtocolScanner) ScanProtocol ¶
func (rps *XMPPProtocolScanner) ScanProtocol(hiddenService string, osc *config.OnionScanConfig, report *report.OnionScanReport)