Documentation
¶
Index ¶
- type BlacklistResponse
- type BulkReportBuilder
- type BulkReportLine
- type BulkReportResponse
- type CheckBlockResponse
- type CheckResponse
- type ClearAddressResponse
- type Client
- func (c Client) BulkReport(fileContent string) (*BulkReportResponse, error)
- func (c Client) Check(ip string, maxAgeInDays int) (*CheckResponse, error)
- func (c Client) CheckBlock(cidr string, maxAgeInDays int) (*CheckBlockResponse, error)
- func (c Client) ClearAddress(ip string) (*ClearAddressResponse, error)
- func (c Client) GetBlacklist(limit int) (*[]BlacklistResponse, error)
- func (c Client) GetBlacklistSubscriber(limit, confidenceMinimum int, onlyCountries, exceptCountries []string) (*[]BlacklistResponse, error)
- func (c Client) GetReports(ip string, page, resultsPerPage, maxAgeInDays int) (*GetReportsResponse, error)
- func (c Client) Report(ip string, categories []ReportCategory, comment string) (*ReportResponse, error)
- type GetReportsResponse
- type InvalidReport
- type ReportCategory
- type ReportCheckData
- type ReportResponse
- type ReportedAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlacklistResponse ¶
type BulkReportBuilder ¶
type BulkReportBuilder struct {
Reports []BulkReportLine
}
func NewBulkReportBuilder ¶
func NewBulkReportBuilder() *BulkReportBuilder
Create a new BulkReportBuilder for formatting BulkReport input
func (*BulkReportBuilder) AddReport ¶
func (b *BulkReportBuilder) AddReport(ip string, categories []ReportCategory, date time.Time, comment string) *BulkReportBuilder
Add a new Report to the Bulk Report
func (*BulkReportBuilder) Build ¶
func (b *BulkReportBuilder) Build() string
Format the Bulk report into CSV Format. Can be passed into the BulkReport function
type BulkReportLine ¶
type BulkReportLine struct { IP string Categories []ReportCategory Date time.Time Comment string }
type BulkReportResponse ¶
type BulkReportResponse struct { SavedReports int `json:"savedReports"` InvalidReports []InvalidReport `json:"invalidReports"` }
type CheckBlockResponse ¶
type CheckBlockResponse struct { NetworkAddress string `json:"networkAddress"` Netmask string `json:"netmask"` MinAddress string `json:"minAddress"` MaxAddress string `json:"maxAddress"` NumPossibleHosts int `json:"numPossibleHosts"` AddressSpaceDesc string `json:"addressSpaceDesc"` ReportedAddress []ReportedAddress `json:"reportedAddress"` }
type CheckResponse ¶
type CheckResponse struct { IPAddress string `json:"ipAddress"` IsPublic bool `json:"isPublic"` IPVersion int `json:"ipVersion"` IsWhitelisted bool `json:"isWhitelisted"` AbuseConfidenceScore int `json:"abuseConfidenceScore"` CountryCode string `json:"countryCode"` CountryName string `json:"countryName"` UsageType string `json:"usageType"` ISP string `json:"isp"` Domain string `json:"domain"` Hostnames []string `json:"hostnames"` TotalReports int `json:"totalReports"` NumDistinctUsers int `json:"numDistinctUsers"` LastReportedAt time.Time `json:"lastReportedAt"` Reports []ReportCheckData `json:"reports"` }
type ClearAddressResponse ¶
type ClearAddressResponse struct {
NumReportsDeleted int `json:"numReportsDeleted"`
}
type Client ¶
type Client struct {
ApiKey string
}
func (Client) BulkReport ¶
func (c Client) BulkReport(fileContent string) (*BulkReportResponse, error)
Bulk report IP Addresses from a CSV File
It is recommended to use the BulkReportBuilder to easily generate the correct input for this method. Otherise, see AbuseIPDB's bulk report form for information on how to format the file content
func (Client) Check ¶
func (c Client) Check(ip string, maxAgeInDays int) (*CheckResponse, error)
Get information on a specific IP Address
ip: The IP Address to Check
maxAgeInDays: How far back in time to check reports, (min 1, max 365) (abuseipdb default: 30)
func (Client) CheckBlock ¶
func (c Client) CheckBlock(cidr string, maxAgeInDays int) (*CheckBlockResponse, error)
Check an IP Subnet
cidr: The network block to check in CIDR notation (Free Subscription can check up to a /24, Basic up to a /20, and Premium up to a /16)
maxAgeInDays: How far back in days to check for reports (min 1, max 365) (abuseipdb default: 30)
func (Client) ClearAddress ¶
func (c Client) ClearAddress(ip string) (*ClearAddressResponse, error)
Delete all of your reports for an IP Address Note: This only deletes reports your account has made, it cannot delete reports from other accounts
ip: The IP Address to clear reports for
func (Client) GetBlacklist ¶
func (c Client) GetBlacklist(limit int) (*[]BlacklistResponse, error)
Get a Blacklist of known malicious IPs Note: This endpoint has restricted parameters limited to AbuseIPDB paid subscribers, if you wish to use those, please use the GetBlacklistSubscriber function
limit: The maximum number of IPs to list (max 10,000 for Free Plan) (abuseipdb default: 10,000)
func (Client) GetBlacklistSubscriber ¶
func (c Client) GetBlacklistSubscriber(limit, confidenceMinimum int, onlyCountries, exceptCountries []string) (*[]BlacklistResponse, error)
GetBlacklist function with extra parameters that are only usable through an AbuseIPDB paid plan
limit: The maximum number of IPs to list (max 10,000 for Free Plan, 100,000 for Basic, and 500,000 for Premium) (abuseipdb default: 10,000)
confidenceMinimum: The minimum abuse confidence score to show in the blacklist (min 25, max 100) (abuseipdb default: 100)
onlyCountries: only retrieve IPs from the specified countries
exceptCountries: retreive IPs from all countries, except those listed
onlyCountries and exceptCountries are mutually exclusive. Country codes should be given as ISO 3166 alpha-2 codes.
func (Client) GetReports ¶
func (c Client) GetReports(ip string, page, resultsPerPage, maxAgeInDays int) (*GetReportsResponse, error)
Get the reports for a specific IP Address
ip: The IP Address to get reports for
page: The page to check (min 1)
resultsPerPage: The number of results to return per page (min 1, max 100) (abuseipdb default: 25)
maxAgeInDays: How far back in time to check reports (min 1, max 365) (abuseipdb default: 30)
func (Client) Report ¶
func (c Client) Report(ip string, categories []ReportCategory, comment string) (*ReportResponse, error)
Report an IP Address
ip: The IP Address to report
categories: A list of categories to report the IP for
comment: Information related to the report (server logs, timestamps, etc.)
type GetReportsResponse ¶
type InvalidReport ¶
type ReportCategory ¶
type ReportCategory int
A specific category to report an IP Address for based on malicious behaviour
const ( // Altering DNS records resulting in improper redirection. CategoryDNSCompromise ReportCategory = iota + 1 // Falsifying domain server cache (cache poisoning). CategoryDNSPosioning // Fraudulent orders. CategoryFraudOrders // Participating in distributed denial-of-service (usually part of botnet). CategoryDDoSAttack // Participating in an FTP Brute Force attack CategoryFTPBruteForce // Oversized IP packet. CategoryPingOfDeath // Phishing websites and/or email. CategoryPhishing // Participating in VoIP Fraud CategoryFraudVoIP // Open proxy, open relay, or Tor exit node. CategoryOpenProxy // Comment/forum spam, HTTP referer spam, or other CMS spam. CategoryWebSpam // Spam email content, infected attachments, and phishing emails. CategoryEmailSpam // CMS blog comment spam. CategoryBlogSpam // Conjunctive category. CategoryVPNIP // Scanning for open ports and vulnerable services. CategoryPortScan // Participating in Hacking CategoryHacking // Attempts at SQL injection. CategorySQLInjection // Email sender spoofing. CategorySpoofing // Credential brute-force attacks on webpage logins and services like SSH, FTP, SIP, SMTP, RDP, etc. This category is seperate from DDoS attacks. CategoryBruteForce // Webpage scraping (for email addresses, content, etc) and crawlers that do not honor robots.txt. Excessive requests and user agent spoofing can also be reported here. CategoryBadWebBot // Host is likely infected with malware and being used for other attacks or to host malicious content. The host owner may not be aware of the compromise. This category is often used in combination with other attack categories. CategoryExploitedHost // Attempts to probe for or exploit installed web applications such as a CMS like WordPress/Drupal, e-commerce solutions, forum software, phpMyAdmin and various other software plugins/solutions. CategoryWebAppAttack // Secure Shell (SSH) abuse. Use this category in combination with more specific categories. CategorySSH // Abuse was targeted at an "Internet of Things" type device. Include information about what type of device was targeted in the comments. CategoryIoTTargeted )