diff --git a/data/apikey.json b/data/apikey.json index 6c1ca0a..0593721 100644 --- a/data/apikey.json +++ b/data/apikey.json @@ -4,5 +4,6 @@ "groq": "file:data/groq_apikey.txt", "scrapeops": "file:data/scrapeops_apikey.txt", "searchapi": "file:data/searchapi_apikey.txt", - "aviationstack": "file:data/aviationstack_apikey.txt" + "aviationstack": "file:data/aviationstack_apikey.txt", + "abuseipdb": "file:data/abuseipdb_apikey.txt" } diff --git a/lib/ip-reputation.js b/lib/ip-reputation.js new file mode 100644 index 0000000..bd090d4 --- /dev/null +++ b/lib/ip-reputation.js @@ -0,0 +1,30 @@ +// ip-reputation.js +// Namhyeon Go +// https://github.com/gnh1201/welsonjs +// +// ***SECURITY NOTICE*** +// IP Reputation Checker requires an internet connection, and data may be transmitted externally. Users must adhere to the terms of use and privacy policy. +// - AbuseIPDB website: https://www.abuseipdb.com/ +// +var HTTP = require("lib/http"); +var APIKEY = require("lib/apikey"); + +function check(ip_address) { + var apikey = APIKEY.getApiKey("abuseipdb"); + + var response = HTTP.create() + .setHeaders({ + "Key": apikey, + "Accept": "application/json" + }) + .setParameters({ + "ipAddress": ip_address + }); + + return response.responseBody; +} + +exports.VERSIONINFO = "IP Reputation Checker (ip-reputation.js) version 0.1"; +exports.AUTHOR = "abuse@catswords.net"; +exports.global = global; +exports.require = global.require;