0.1.7 • Published 7 years ago
aipdb v0.1.7
AIPDB - AbuseIPDB made simple
AIPDB is a library to check and report ip addresses on the site https://abuseipdb.com/, this lib is still in development and may still have some weird mems that need fixing.
Currently aipdb does not handle the rate limiting AbuseIPDB Imposes, you can find more about their api and the rate limits they enforce here: https://www.abuseipdb.com/api.html
For testing the api AbuseIPDB asks that you use private IP Addresses. e.g. 127.0.0.1
Installing via NPM.
$ npm install aipdb
Setting up
aipdb.set({
key: "12345abcde",
days_since: 60
})
Checking IP Addresses
aipdb.lookup({
ip: "127.0.0.1"
}, function(object) {
console.log(object)
})
// Output:
/*
{ code: 200,
body:
[ { ip: '127.0.0.1',
country: 'United States',
isoCode: 'US',
category: [Array],
created: 'Mon, 1 Jan 2017 00:01:17 +0000' },
{ ip: '127.0.0.1',
country: 'United States',
isoCode: 'US',
category: [Array],
created: 'Thu, 24 Jan 2017 00:15:01 +0000' },
...
*/
Reporting IP Addresses
aipdb.report({
ip: "127.0.0.1",
categories: "3,14", // See "https://www.abuseipdb.com/categories", Would report the IP under the categories "Port Scan" and "Bad Web Bot".
comment: "Vebery dangaroos Iee Pee Edrass"
}, function(event) {console.log(event)})
// Output:
/*
{
code: 200, // Can be 400, if so body will contain a JSON responce telling you how you fugg'd up.
body: { ip: '127.0.0.1', success: true }, // Make a human-usable url: "https://www.abuseipdb.com/check/" + r.body.ip + "/" - https://www.abuseipdb.com/check/127.0.0.1
error: null
}
*/