custom

package
v0.0.0-...-2dbdbee Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// IndexLen 索引长度
	IndexLen = 7
	// RedirectMode1 国家的类型, 指向另一个指向
	RedirectMode1 = 0x01
	// RedirectMode2 国家的类型, 指向一个指向
	RedirectMode2 = 0x02
)
View Source
const UnknownService = "unknown"

Variables

View Source
var IPData fileData

IPData IP库的数据

Functions

func CheckFile

func CheckFile(data []byte) bool

func GetOnline

func GetOnline() ([]byte, error)

func LoadCustomTaskWorkspace

func LoadCustomTaskWorkspace() (workspace map[string]struct{})

Types

type BlackCheckType

type BlackCheckType int
const (
	CheckIP BlackCheckType = iota
	CheckDomain
	CheckAll
)

type BlackTarget

type BlackTarget interface {
	GetBlackFileName() string
	LoadBlackTargetList() error
	CheckBlackTarget(target string) bool
}

type BlackTargetCheck

type BlackTargetCheck struct {
	// contains filtered or unexported fields
}

func NewBlackTargetCheck

func NewBlackTargetCheck(checkType BlackCheckType) *BlackTargetCheck

NewBlackTargetCheck 创建黑名单检查

func (*BlackTargetCheck) AppendBlackTarget

func (c *BlackTargetCheck) AppendBlackTarget(target string) error

AppendBlackTarget 追加黑名单

func (*BlackTargetCheck) CheckBlack

func (c *BlackTargetCheck) CheckBlack(target string) bool

CheckBlack 检查黑名单

func (*BlackTargetCheck) GetBlackFileName

func (c *BlackTargetCheck) GetBlackFileName() string

GetBlackFileName 获取黑名单文件名

type CDNCheck

type CDNCheck struct {
	// contains filtered or unexported fields
}

func NewCDNCheck

func NewCDNCheck() *CDNCheck

NewCDNCheck 创建CDNCheck对象

func (*CDNCheck) CheckASN

func (c *CDNCheck) CheckASN(ip string) (isCDN bool)

CheckASN 检查IP的ASN判断是否是CDN

func (*CDNCheck) CheckCName

func (c *CDNCheck) CheckCName(domain string) (isCDN bool, CDNName string, CName string)

CheckCName 检查域名的CNAME,判断是否是CDN

func (*CDNCheck) CheckIP

func (c *CDNCheck) CheckIP(ip string) (isCDN bool)

CheckIP 检查IP是否为CDN

type Config

type Config struct {
	Target string `json:"target"`
	OrgId  *int   `json:"orgId"`
}

type DomainTarget

type DomainTarget struct {
	BlackMapList map[string]struct{}
}

func (*DomainTarget) CheckBlackTarget

func (t *DomainTarget) CheckBlackTarget(target string) bool

CheckBlackTarget 检查黑名单

func (*DomainTarget) GetBlackFileName

func (t *DomainTarget) GetBlackFileName() string

GetBlackFileName 获取黑名单文件名

func (*DomainTarget) LoadBlackTargetList

func (t *DomainTarget) LoadBlackTargetList() error

LoadBlackTargetList 加载黑名单列表

type HoneyDef

type HoneyDef struct {
	SystemName string
	PortDef    map[int]string
}

type HoneyPot

type HoneyPot struct {
	// contains filtered or unexported fields
}

func NewHoneyPot

func NewHoneyPot() *HoneyPot

NewHoneyPot 创建HoneyPot对象

func (*HoneyPot) CheckHoneyPot

func (hp *HoneyPot) CheckHoneyPot(domain, ports string) (isChecked bool, systemList []string)

CheckHoneyPot 给定domain/ip和端口,匹配是否是预定义的honeypot

type IPTarget

type IPTarget struct {
	Ipv4BlackMapList map[string]struct{}
	Ipv6BlackMapList []netip.Prefix
}

func (*IPTarget) CheckBlackTarget

func (t *IPTarget) CheckBlackTarget(target string) bool

CheckBlackTarget 检查黑名单

func (*IPTarget) GetBlackFileName

func (t *IPTarget) GetBlackFileName() string

GetBlackFileName 获取黑名单文件名

func (*IPTarget) LoadBlackTargetList

func (t *IPTarget) LoadBlackTargetList() error

LoadBlackTargetList 加载黑名单列表

type Ipv4Location

type Ipv4Location struct {
	// contains filtered or unexported fields
}

func NewIPv4Location

func NewIPv4Location() *Ipv4Location

NewIPv4Location 创建iplocation对象

func (*Ipv4Location) FindCustomIP

func (ipl *Ipv4Location) FindCustomIP(ip string) string

FindCustomIP 查询自定义IP归属地

func (*Ipv4Location) FindPublicIP

func (ipl *Ipv4Location) FindPublicIP(ip string) string

FindPublicIP 查询纯真数据库获取公网IP归属地

type Ipv6Location

type Ipv6Location struct {
	wry.IPDB[uint64]
}

func NewIPv6Location

func NewIPv6Location() (*Ipv6Location, error)

func (*Ipv6Location) Find

func (db *Ipv6Location) Find(query string) string

func (*Ipv6Location) FindByZX

func (db *Ipv6Location) FindByZX(query string, _ ...string) (result *wry.Result, err error)

type QQwry

type QQwry struct {
	Data   *fileData
	Offset int64
}

QQwry 纯真ip库

func NewQQwry

func NewQQwry() QQwry

NewQQwry 新建 qqwry 类型

func (*QQwry) Find

func (q *QQwry) Find(ip string) (res ResultQQwry)

Find ip地址查询对应归属地信息

func (*QQwry) ReadData

func (q *QQwry) ReadData(num int, offset ...int64) (rs []byte)

ReadData 从文件中读取数据

func (*QQwry) SetOffset

func (q *QQwry) SetOffset(offset int64)

SetOffset 设置偏移量

type Response

type Response struct {
	// contains filtered or unexported fields
}

Response 向客户端返回数据的

type ResultQQwry

type ResultQQwry struct {
	IP      string `json:"ip"`
	Country string `json:"country"`
	Area    string `json:"area"`
}

ResultQQwry 归属地信息

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService() Service

NewService 创建service对象

func (*Service) FindService

func (s *Service) FindService(portNumber int, ip string) string

FindService 查找端口服务 如果给定了IP,并且IP是自定义归属地IP就先查找自定义端口服务 否则从nmap定义的服务类型中进行查找

Jump to

Keyboard shortcuts

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