0.0.2 • Published 6 years ago
@tndev/project-honeypot v0.0.2
Project Honeypot
This npm module will allow you to query and consume the Project Honeypot API. Query it with an IP, and an Object will be sent back with relevent metadata regarding that IP.
Installation
npm install @tndev/project-honeypot
Usage
- Register for an account at Project Honeypot.
- Enable API access and receive an access key.
- Use this code:
const Honeypot = require('project-honeypot')
let pod = new Honeypot('YOUR-ACCESS-KEY')
// ...
let response = await honeypot.query(ip)
Result
- If the IP address was not found,
response.found
isfalse
. - Otherwise, if
response.found
istrue
it will contain the following additional fields:
{
ip: '127.1.1.5',
found: true,
lastSeenDays: 1,
threatScore: 1,
type: {
searchEngine: false,
suspicious: true,
harvester: false,
commentSpammer: true
}
}
Note: Certain ip addresses in the 127.*.*.*
range are test addresses, 127.1.1.5
being one of them. It returns a result record corresponding to a IP address flagged as both suspicious
and comment spammer
. View the full list here.
Tests
$ npm i
$ npm test