check

package
v0.46.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 33 Imported by: 2

Documentation

Overview

Package check contains functions that can check an IP address.

Index

Constants

This section is empty.

Variables

All contains all available checks.

Default contains subset of all available checks recommended for most people.

Functions

func AbuseIPDB added in v0.24.0

func AbuseIPDB(ipaddr net.IP) (checkip.Result, error)

AbuseIPDB uses api.abuseipdb.com to get generic information about ipaddr and to see if the ipaddr has been reported as malicious.

func BlockList added in v0.24.0

func BlockList(ipaddr net.IP) (checkip.Result, error)

BlockList searches the ipaddr in lists.blocklist.de/lists/dnsbl/all.list.

func CinsScore added in v0.24.0

func CinsScore(ipaddr net.IP) (checkip.Result, error)

CinsScore searches ipaddr in https://cinsscore.com/list/ci-badguys.txt.

func DBip added in v0.24.0

func DBip(ip net.IP) (checkip.Result, error)

DBip gets geolocation from https://db-ip.com/db/download/ip-to-city-lite.

func DnsMX added in v0.24.0

func DnsMX(ipaddr net.IP) (checkip.Result, error)

DnsMX performs reverse lookup and consults AbuseIPDB to get domain names fo the ipaddr. Then it looks up MX records (mail servers) for the given domain names.

func DnsName added in v0.24.0

func DnsName(ipaddr net.IP) (checkip.Result, error)

DnsName does a reverse lookup for a given IP address to get its names.

func Firehol added in v0.28.0

func Firehol(ipaddr net.IP) (checkip.Result, error)

Firehol checks whether the ipaddr is found on blacklist https://iplists.firehol.org/?ipset=firehol_level1.

func IPSum added in v0.24.0

func IPSum(ipaddr net.IP) (checkip.Result, error)

IPSum checks how many blacklists the ipaddr is found on. It uses https://raw.githubusercontent.com/stamparm/ipsum/master/ipsum.txt.

func IPtoASN added in v0.24.0

func IPtoASN(ipaddr net.IP) (checkip.Result, error)

IPtoASN gets info about autonomous system of the ipaddr. The data is taken from https://iptoasn.com/data/ip2asn-combined.tsv.gz.

func IsOnAWS added in v0.46.0

func IsOnAWS(ipaddr net.IP) (checkip.Result, error)

IsOnAWS checks if ipaddr belongs to AWS. If so it provides info about the IP address. It gets the info from https://ip-ranges.amazonaws.com/ip-ranges.json

func MaxMind added in v0.24.0

func MaxMind(ip net.IP) (checkip.Result, error)

MaxMind gets geolocation data from maxmind.com's GeoLite2-City.mmdb.

func OTX added in v0.24.0

func OTX(ipaddr net.IP) (checkip.Result, error)

OTX counts pulses to find out whether the ipaddr is malicious. Is uses https://otx.alienvault.com/api/v1/indicators/IPv4.

func PhishStats added in v0.29.0

func PhishStats(ipaddr net.IP) (checkip.Result, error)

PhishStats checks whether the ipaddr is involved in phishing according to https://phishstats.info/phish_score.csv.

func Ping added in v0.24.0

func Ping(ipaddr net.IP) (checkip.Result, error)

Ping sends five pings (ICMP echo request packets) to the ippaddr and returns the statistics.

func SansISC added in v0.43.0

func SansISC(ipaddr net.IP) (checkip.Result, error)

SansISC gets info from SANS Internet Storm Center API. curl "https://isc.sans.edu/api/ip/${IPADDR}?json"

func Shodan added in v0.24.0

func Shodan(ipaddr net.IP) (checkip.Result, error)

Shodan gets generic information from api.shodan.io.

func Tls added in v0.30.0

func Tls(ipaddr net.IP) (checkip.Result, error)

Tls finds out TLS information by connecting to the ipaddr and TCP port 443.

func UrlScan added in v0.24.0

func UrlScan(ipaddr net.IP) (checkip.Result, error)

UrlScan gets data from urlscan.io. When a URL is submitted to urlscan.io, an automated process will browse to the URL like a regular user and record the activity that this page navigation creates.

func VirusTotal added in v0.24.0

func VirusTotal(ipaddr net.IP) (checkip.Result, error)

VirusTotal gets generic information and security reputation about the ippaddr from https://www.virustotal.com/api.

Types

type AutonomousSystem added in v0.24.0

type AutonomousSystem struct {
	Number      int    `json:"-"`
	FirstIP     net.IP `json:"-"`
	LastIP      net.IP `json:"-"`
	Description string `json:"description"`
	CountryCode string `json:"-"`
}

func (AutonomousSystem) Json added in v0.25.0

func (a AutonomousSystem) Json() ([]byte, error)

func (AutonomousSystem) Summary added in v0.24.0

func (a AutonomousSystem) Summary() string

type MX added in v0.24.0

type MX struct {
	Records map[string][]string `json:"records"` // domain => MX records
}

MX maps MX records to domain names.

func (MX) Json added in v0.25.0

func (mx MX) Json() ([]byte, error)

func (MX) Summary added in v0.24.0

func (mx MX) Summary() string

type Names added in v0.24.0

type Names []string

Names are the DNS names of the given IP address.

func (Names) Json added in v0.25.0

func (n Names) Json() ([]byte, error)

func (Names) Summary added in v0.24.0

func (n Names) Summary() string

Jump to

Keyboard shortcuts

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