cdncheck

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: AGPL-3.0, MIT Imports: 10 Imported by: 0

README

修改自:https://github.com/projectdiscovery/cdncheck 增加了国内CDN IP判断,及大部分主流CDN 域名判断、主流云资产识别

  • Baidu-加速乐 (创宇云盾)

  • 网宿 CDN

  • 腾讯云CDN

  • 阿里云 CDN

  • 百度智能云CDN

    如要增加其它CDN或WAF 请更新: sources_data.json 文件并重新编译

后面仅更新sources_data.json 不再更新Releases,请自行编译

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCDNProviders   string
	DefaultWafProviders   string
	DefaultCloudProviders string
)
View Source
var DefaultResolvers = []string{

	"114.114.114.114:53",
}

DefaultResolvers trusted (taken from fastdialer)

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.Once
	// contains filtered or unexported fields
}

Client checks for CDN based IPs which should be excluded during scans since they belong to third party firewalls.

func New

func New() *Client

New creates cdncheck client with default options NewWithOpts should be preferred over this function

func NewWithOpts

func NewWithOpts(MaxRetries int, resolvers []string) (*Client, error)

NewWithOpts creates cdncheck client with custom options

func (*Client) Check

func (c *Client) Check(ip net.IP) (matched bool, value string, itemType string, err error)

Check checks if ip belongs to one of CDN, WAF and Cloud . It is generic method for Checkxxx methods

func (*Client) CheckCDN

func (c *Client) CheckCDN(ip net.IP) (matched bool, value string, err error)

CheckCDN checks if an IP is contained in the cdn denylist

func (*Client) CheckCloud

func (c *Client) CheckCloud(ip net.IP) (matched bool, value string, err error)

CheckCloud checks if an IP is contained in the cloud denylist

func (*Client) CheckDNSResponse

func (c *Client) CheckDNSResponse(dnsResponse *retryabledns.DNSData) (matched bool, value string, itemType string, err error, dnsData *retryabledns.DNSData)

CheckDNSResponse is same as CheckDomainWithFallback but takes DNS response as input

func (*Client) CheckDomainWithFallback

func (c *Client) CheckDomainWithFallback(domain string) (matched bool, value string, itemType string, err error, dnsData *retryabledns.DNSData)

Check Domain with fallback checks if domain belongs to one of CDN, WAF and Cloud . It is generic method for Checkxxx methods Since input is domain, as a fallback it queries CNAME records and checks if domain is WAF

func (*Client) CheckSuffix

func (c *Client) CheckSuffix(fqdns ...string) (isCDN bool, provider string, itemType string, err error)

CheckFQDN checks if fqdns are known cloud ones

func (*Client) CheckWAF

func (c *Client) CheckWAF(ip net.IP) (matched bool, value string, err error)

CheckWAF checks if an IP is contained in the waf denylist

func (*Client) CheckWappalyzer

func (c *Client) CheckWappalyzer(data map[string]struct{}) (isCDN bool, provider string, err error)

CheckWappalyzer checks if the wappalyzer detection are a part of CDN

type InputCompiled

type InputCompiled struct {
	// CDN contains a list of ranges for CDN cidrs
	CDN map[string][]string `yaml:"cdn,omitempty" json:"cdn,omitempty"`
	// WAF contains a list of ranges for WAF cidrs
	WAF map[string][]string `yaml:"waf,omitempty" json:"waf,omitempty"`
	// Cloud contains a list of ranges for Cloud cidrs
	Cloud map[string][]string `yaml:"cloud,omitempty" json:"cloud,omitempty"`
	// Common contains a list of suffixes for major sources
	Common map[string][]string `yaml:"common,omitempty" json:"common,omitempty"`
}

InputCompiled contains a compiled list of input structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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