Documentation
¶
Index ¶
- Constants
- Variables
- type ASNInfo
- type ASNIntel
- type Abuse
- type CertIntel
- type CheckCreated
- type CheckHost
- func (c *CheckHost) ASNIntel(asn string) (*ASNIntel, error)
- func (c *CheckHost) CertIntel(sha256 string) (*CertIntel, error)
- func (c *CheckHost) CountryMap(uuid, format, resolution string) ([]byte, error)
- func (c *CheckHost) DNS(target string, options *DNSTargetRequest) (*CheckCreated, error)
- func (c *CheckHost) DomainIntel(domain string) (*DomainIntel, error)
- func (c *CheckHost) Fullscan(target, scope string) (*FullscanJob, error)
- func (c *CheckHost) FullscanResults(uuid string) (*FullscanResults, error)
- func (c *CheckHost) FullscanStatus(uuid string) (*FullscanJob, error)
- func (c *CheckHost) Http(target string, options *MonitoringRequest) (*CheckCreated, error)
- func (c *CheckHost) IPIntel(ip string) (*IPIntel, error)
- func (c *CheckHost) Info(target string) (*MinResponseINFO, error)
- func (c *CheckHost) Locations() (map[string]interface{}, error)
- func (c *CheckHost) MTR(target string, options *MTRMonitoringRequest) (*CheckCreated, error)
- func (c *CheckHost) MyIP() (string, error)
- func (c *CheckHost) MyInfo() (*MinResponseINFO, error)
- func (c *CheckHost) OgImage(uuid string) ([]byte, error)
- func (c *CheckHost) Ping(target string, options *MonitoringRequest) (*CheckCreated, error)
- func (c *CheckHost) PortIntel(port int) (*PortIntel, error)
- func (c *CheckHost) PrefixIntel(net string, mask int) (*PrefixIntel, error)
- func (c *CheckHost) RecentScans(target string) (*ScanRecent, error)
- func (c *CheckHost) Report(uuid string) (map[string]interface{}, error)
- func (c *CheckHost) SoftwareIntel(name, version string) (*SoftwareIntel, error)
- func (c *CheckHost) TCP(target string, port int, options *TCPMonitoringRequest) (*CheckCreated, error)
- func (c *CheckHost) UDP(target string, port int, options *UDPMonitoringRequest) (*CheckCreated, error)
- func (c *CheckHost) WaitForFullscan(uuid string, interval, maxWait time.Duration) (*FullscanJob, error)
- func (c *CheckHost) Whois(target string) (string, error)
- type Company
- type DNSTargetRequest
- type DomainIntel
- type FullscanJob
- type FullscanRequest
- type FullscanResults
- type FullscanStatusResponse
- type IPIntel
- type IntelData
- type MTRMonitoringRequest
- type MinResponseINFO
- type MonitoringRequest
- type PortIntel
- type PrefixIntel
- type Privacy
- type Report
- type ScanRecent
- type SoftwareIntel
- type TCPMonitoringRequest
- type TargetRequest
- type UDPMonitoringRequest
Constants ¶
const ( // ScopeBasic scans the top-100 ports and grabs a banner. ScopeBasic = "basic" // ScopeDeep scans the full port range with TLS, body fetch and // threat-intel. This is the default. ScopeDeep = "deep" // ScopeFull is ScopeDeep plus subdomain enumeration (domains only). ScopeFull = "full" )
FullscanScope values accepted by Fullscan.
const (
DefaultBaseURL = "https://api.check-host.cc"
)
Variables ¶
var ( ErrRateLimit = errors.New("rate limit reached, please provide an API key or slow down your requests") ErrBadRequest = errors.New("problem with your input parameters, please check your payload") ErrServerError = errors.New("internal server error, please try again later") )
CheckHostException mapped as a generic Go error.
Functions ¶
This section is empty.
Types ¶
type ASNInfo ¶
type ASNInfo struct {
ASN string `json:"asn"`
Route string `json:"route"`
Netname string `json:"netname"`
Name string `json:"name"`
CountryCode string `json:"countryCode"`
Domain string `json:"domain"`
Type string `json:"type"`
RIR string `json:"rir"`
}
ASNInfo is the BGP/RIR attribution block of an InfoResponse.
type ASNIntel ¶
type ASNIntel struct {
Success bool `json:"success"`
ASN int `json:"asn"`
ASName string `json:"as_name"`
Data IntelData `json:"data"`
}
ASNIntel is the response of GET /as/{asn}.
type Abuse ¶
type Abuse struct {
Address string `json:"address"`
CountryCode string `json:"countryCode"`
Email string `json:"email"`
Name string `json:"name"`
Network string `json:"network"`
Phone string `json:"phone"`
}
Abuse is the network's abuse contact.
type CertIntel ¶
type CertIntel struct {
Success bool `json:"success"`
SHA256 string `json:"sha256"`
Data IntelData `json:"data"`
}
CertIntel is the response of GET /cert/{sha256}.
type CheckCreated ¶
type CheckCreated struct {
Status int `json:"status"`
Target string `json:"target"`
Method string `json:"method"`
RepeatChecks int `json:"repeatchecks"`
Region []string `json:"region"`
UUID string `json:"uuid"`
ReportURL string `json:"reportURL"`
APIURL string `json:"apiURL"`
OgImageURL string `json:"og-imageURL"`
Autodelete string `json:"autodelete"`
Message string `json:"message"`
Port *int `json:"port"`
Query *string `json:"query"`
Payload *string `json:"payload"`
Success bool `json:"success"`
}
type CheckHost ¶
type CheckHost struct {
// Token is the API token (UUID). It is sent as an
// "Authorization: Bearer <token>" header on every request and never
// appears in a URL or a request body. Optional - leave it empty for
// anonymous access under tighter per-IP rate limits.
Token string
// APIKey is a deprecated alias for Token, kept so code written against
// v1.0 keeps compiling. When Token is empty, APIKey is used instead.
//
// Deprecated: set Token instead.
APIKey string
BaseURL string
HTTPClient *http.Client
}
func NewClient ¶
NewClient creates a new CheckHost client. The token is optional; pass an empty string for anonymous access.
The token is sent as an "Authorization: Bearer <token>" header, so it never lands in a URL, an access log or a request body.
func (*CheckHost) ASNIntel ¶
ASNIntel returns the autonomous-system profile: prefix counts, announced IP totals, peers / providers / customers, IXP memberships, RPKI coverage, GeoIP footprint, top ports and hosted-domain summaries.
Accepts "13335" or "AS13335".
func (*CheckHost) CertIntel ¶
CertIntel returns TLS certificate intelligence by SHA-256 fingerprint: subject, issuer, SANs and validity window, every (ip, port) observed serving it, and the matching CT-log entries.
func (*CheckHost) CountryMap ¶
CountryMap fetches the per-country world map for a check UUID.
- format: "svg" (default) or "png".
- resolution: "low" (800px), "med" (1200px), or "high" (2000px). Ignored when format is "svg".
Returns raw image bytes (UTF-8 text for SVG, binary for PNG).
func (*CheckHost) DNS ¶
func (c *CheckHost) DNS(target string, options *DNSTargetRequest) (*CheckCreated, error)
DNS queries global nameservers for specific DNS records.
func (*CheckHost) DomainIntel ¶
func (c *CheckHost) DomainIntel(domain string) (*DomainIntel, error)
DomainIntel returns domain intelligence: current DNS records plus passive-DNS history, TLS certificates, CT-log evidence, discovered subdomains, tech-stack and origin-leak (Cloudflare-bypass) candidates.
func (*CheckHost) Fullscan ¶
func (c *CheckHost) Fullscan(target, scope string) (*FullscanJob, error)
Fullscan dispatches a scan job and returns immediately with status "pending". Poll FullscanStatus for progress, or use WaitForFullscan.
scope may be ScopeBasic, ScopeDeep or ScopeFull; an empty string means ScopeDeep.
Anonymous CIDR submissions are capped at /24 (v4) and /120 (v6); an API token raises that to /20 and /112.
func (*CheckHost) FullscanResults ¶
func (c *CheckHost) FullscanResults(uuid string) (*FullscanResults, error)
FullscanResults fetches the findings a fullscan produced - open ports, banners, DNS records, BGP context and TLS certificates. Partial results are available while the job is still running.
func (*CheckHost) FullscanStatus ¶
func (c *CheckHost) FullscanStatus(uuid string) (*FullscanJob, error)
FullscanStatus polls a job's progress counters. Workers bump SubjobsDone; the job moves to "complete" (all sub-jobs done) or "partial" (some failed). For the findings themselves, use FullscanResults.
func (*CheckHost) Http ¶
func (c *CheckHost) Http(target string, options *MonitoringRequest) (*CheckCreated, error)
Http executes an HTTP/HTTPS request to the target to measure latency and statuses.
func (*CheckHost) IPIntel ¶
IPIntel returns the full intelligence profile for a single IPv4/IPv6 address: reverse DNS, open ports and banners, TLS certificates, BGP/ASN attribution, GeoIP, tech-stack, co-hosted domains, origin-leak candidates, threat-intel matches and honeypot activity.
func (*CheckHost) Info ¶
func (c *CheckHost) Info(target string) (*MinResponseINFO, error)
Info retrieves detailed geolocation data, ISP information, and ASN details.
func (*CheckHost) Locations ¶
Locations fetches a dynamic list of all currently active monitoring nodes across the globe.
func (*CheckHost) MTR ¶
func (c *CheckHost) MTR(target string, options *MTRMonitoringRequest) (*CheckCreated, error)
MTR initiates an MTR (My Traceroute) diagnostic.
func (*CheckHost) MyInfo ¶
func (c *CheckHost) MyInfo() (*MinResponseINFO, error)
MyInfo returns geolocation + ASN data for the caller's own IP.
Same response shape as Info, resolved against the requesting client's IP. Subject to bot detection - repeated cache misses can return a 429 carrying a captcha verification URL.
func (*CheckHost) OgImage ¶
OgImage fetches the dynamic 1200x630 PNG status map for a previously dispatched check. Returns the raw PNG bytes.
func (*CheckHost) Ping ¶
func (c *CheckHost) Ping(target string, options *MonitoringRequest) (*CheckCreated, error)
Ping dispatches ICMP echo requests to the target from global nodes.
func (*CheckHost) PortIntel ¶
PortIntel reports how widespread a port is across the scanned Internet: open-IP count, most common banners, top countries and ASNs, tech-stack and a sample of recent hosts.
func (*CheckHost) PrefixIntel ¶
func (c *CheckHost) PrefixIntel(net string, mask int) (*PrefixIntel, error)
PrefixIntel returns CIDR prefix intelligence: BGP origin, RPKI validity, GeoIP distribution, open-IP count, top ports and sample scanned hosts.
mask must be in the range [0, 128].
func (*CheckHost) RecentScans ¶
func (c *CheckHost) RecentScans(target string) (*ScanRecent, error)
RecentScans lists the most-recent fullscan jobs submitted for a target (IP, CIDR, domain or ASN), so you can deep-link to a fresh report instead of triggering a redundant scan.
func (*CheckHost) Report ¶
Report fetches the compiled report and real-time statuses from a previously initiated monitoring check via UUID.
func (*CheckHost) SoftwareIntel ¶
func (c *CheckHost) SoftwareIntel(name, version string) (*SoftwareIntel, error)
SoftwareIntel returns tech-stack intelligence for a detected technology: host counts, version breakdown, categories and a sample of hosts.
Pass a non-empty version to pin the stats to a single release.
func (*CheckHost) TCP ¶
func (c *CheckHost) TCP(target string, port int, options *TCPMonitoringRequest) (*CheckCreated, error)
TCP attempts to establish a 3-way TCP handshake on a specific destination port.
func (*CheckHost) UDP ¶
func (c *CheckHost) UDP(target string, port int, options *UDPMonitoringRequest) (*CheckCreated, error)
UDP sends UDP packets to a specified target and port.
func (*CheckHost) WaitForFullscan ¶
func (c *CheckHost) WaitForFullscan( uuid string, interval, maxWait time.Duration, ) (*FullscanJob, error)
WaitForFullscan polls FullscanStatus until the job reaches a terminal status or maxWait elapses.
interval is clamped to at least one second. Passing zero for interval or maxWait selects the defaults (3s and 5min) - fullscans are far slower than node checks, so be patient.
When the deadline passes with the job still pending or running, the last observed job is returned alongside a non-nil error, so callers can inspect the partial state either way.
type Company ¶
type Company struct {
Name string `json:"name"`
Domain string `json:"domain"`
CountryCode string `json:"countryCode"`
Type string `json:"type"`
}
Company is the organisation the IP is registered to.
type DNSTargetRequest ¶
type DomainIntel ¶
type DomainIntel struct {
Success bool `json:"success"`
Domain string `json:"domain"`
Data IntelData `json:"data"`
}
DomainIntel is the response of GET /domain/{domain}.
type FullscanJob ¶
type FullscanJob struct {
Success bool `json:"success"`
UUID string `json:"uuid"`
Target string `json:"target"`
TargetType string `json:"target_type"`
Scope string `json:"scope"`
Status string `json:"status"`
SubjobsTotal int `json:"subjobs_total"`
SubjobsDone int `json:"subjobs_done"`
SubjobsFailed int `json:"subjobs_failed"`
Error string `json:"error"`
CreatedAt string `json:"created_at"`
CompletedAt string `json:"completed_at"`
ReportURL string `json:"report_url"`
APIURL string `json:"api_url"`
}
FullscanJob is the master job row: the shape returned by Fullscan, FullscanStatus, and every entry in RecentScans.
func (FullscanJob) IsFinished ¶
func (j FullscanJob) IsFinished() bool
IsFinished reports whether the job reached a terminal status and will not progress further.
func (FullscanJob) Progress ¶
func (j FullscanJob) Progress() float64
Progress is the completion ratio in [0, 1]. It is 0 while the manager is still fanning out sub-jobs.
type FullscanRequest ¶
FullscanRequest is the payload for POST /fullscan.
type FullscanResults ¶
type FullscanResults struct {
Success bool `json:"success"`
Data struct {
FullscanJob
OpenPorts []map[string]interface{} `json:"open_ports"`
Banners []map[string]interface{} `json:"banners"`
DNSRecords []map[string]interface{} `json:"dns_records"`
BGP map[string]interface{} `json:"bgp"`
TLSCerts []map[string]interface{} `json:"tls_certs"`
} `json:"data"`
}
FullscanResults is the response of GET /fullscan/{uuid}/results: the job row plus the findings aggregated from every sub-job.
type FullscanStatusResponse ¶
type FullscanStatusResponse struct {
Success bool `json:"success"`
Job FullscanJob `json:"job"`
}
FullscanStatusResponse wraps the job row returned by GET /fullscan/{uuid}.
type IPIntel ¶
type IPIntel struct {
Success bool `json:"success"`
IP string `json:"ip"`
Family string `json:"family"`
Data IntelData `json:"data"`
}
IPIntel is the response of GET /ip/{ip}.
Data sections: ptr, open_ports, banners, tls_certs, co_hosted_domains, external_refs, leak_candidates, titles, techs, bgp, geo, probe_findings, threat_matches, threat_count, honeypot, honeypot_recent, honeypot_actor, honeypot_ja, honeypot_classes.
Honeypot passwords are never returned in cleartext - each entry exposes only password_captured (bool) and password_len.
type IntelData ¶
type IntelData map[string]interface{}
IntelData is the free-form section map every Intelligence endpoint returns under "data". Sections we hold no data for come back as empty arrays or null, and the exact key set differs per endpoint, so it stays untyped.
type MTRMonitoringRequest ¶
type MinResponseINFO ¶
type MinResponseINFO struct {
IP string `json:"ip"`
Reverse string `json:"reverse"`
Country string `json:"country"`
CountryCode string `json:"countryCode"`
IsEu bool `json:"isEu"`
City string `json:"city"`
Continent string `json:"continent"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
TimeZone string `json:"timeZone"`
PostalCode string `json:"postalCode"`
Subdivision string `json:"subdivision"`
CurrencyCode string `json:"currencyCode"`
CallingCode string `json:"callingCode"`
Privacy Privacy `json:"privacy"`
ASN ASNInfo `json:"asn"`
Company Company `json:"company"`
Abuse Abuse `json:"abuse"`
Success bool `json:"success"`
}
MinResponseINFO is the geolocation / ASN / privacy / abuse record returned by Info, MyInfo and the /info endpoints.
type MonitoringRequest ¶
type PortIntel ¶
type PortIntel struct {
Success bool `json:"success"`
Port int `json:"port"`
WellKnown string `json:"well_known"`
Data IntelData `json:"data"`
}
PortIntel is the response of GET /port/{port}.
type PrefixIntel ¶
type PrefixIntel struct {
Success bool `json:"success"`
CIDR string `json:"cidr"`
Net string `json:"net"`
Mask int `json:"mask"`
Family string `json:"family"`
AnycastLabel string `json:"anycast_label"`
Data IntelData `json:"data"`
}
PrefixIntel is the response of GET /prefix/{net}/{mask}.
type Privacy ¶
type Privacy struct {
IsAbuser bool `json:"isAbuser"`
IsAnonymous bool `json:"isAnonymous"`
IsBogon bool `json:"isBogon"`
IsHosting bool `json:"isHosting"`
IsIcloudRelay bool `json:"isIcloudRelay"`
IsProxy bool `json:"isProxy"`
IsTor bool `json:"isTor"`
IsVpn bool `json:"isVpn"`
}
Privacy flags an IP as belonging to a VPN, proxy, Tor exit, hosting provider and so on.
type Report ¶
type Report struct {
Nodes map[string]interface{}
}
Result mapping generic report data. Real world results return dicts mapped by Node name.
type ScanRecent ¶
type ScanRecent struct {
Success bool `json:"success"`
Target string `json:"target"`
RecentScans []FullscanJob `json:"recent_scans"`
}
ScanRecent is the response of GET /scan/{target}.
type SoftwareIntel ¶
type SoftwareIntel struct {
Success bool `json:"success"`
Name string `json:"name"`
Version string `json:"version"`
Data IntelData `json:"data"`
}
SoftwareIntel is the response of GET /software/{name}[/{version}].
type TCPMonitoringRequest ¶
type TCPMonitoringRequest struct {
MonitoringRequest
Port int `json:"port"`
}
type TargetRequest ¶
type TargetRequest struct {
Target string `json:"target"`
}
type UDPMonitoringRequest ¶
type UDPMonitoringRequest struct {
MonitoringRequest
Port int `json:"port"`
Payload string `json:"payload,omitempty"`
}