2017 © Pedro Peláez
 

library honeypot

Project Honey Pot (un-official) PHP SDK

image

jadb/honeypot

Project Honey Pot (un-official) PHP SDK

  • Saturday, January 23, 2016
  • by jadb
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Honeypot

The Project Honey Pot's un-official PHP SDK., (*1)

Using the library, you can start auto-detecting bad visitors (HttpBL) and/or help deterring new ones (Quicklink)., (*2)

Install

composer require jadb/honeypot:1.0.x-dev

Usage

HttpBL

To use the Http::BL API, you will first need an API key. Head over and register if you haven't already (this is a referral link):, (*3)

Once you have that, you can just do:, (*4)

<?php

if (!(new \Honeypot\HttpBL('your-api-key'))->isSafe('127.0.0.1') {
    exit('Unsafe visitor');
}

If you want more control over the rules:, (*5)

<?php
/**
 * By default, strict mode is used. When not in strict mode, any pass is a pass. This ruleset
 * translates to: 5 days or older, or threat score lower than 2, or visitor type lower than 4.
 */
$strict = false; 
$age = 5; 
$score = 2;
$type = 4;
if (!(new \Honeypot\HttpBL('your-api-key'))->isSafe('127.0.0.1', $age, $score, $type) {
    exit('Unsafe visitor');
}

For even more, you could just get the Address object and create your own validation:, (*6)

<?php
$address = (new \Honeypot\HttpBL('your-api-key'))->address('127.0.0.1');

NOTE: For testing purposes, dummy data is made available., (*7)

To use quicklinks and help deterring new bad IPs, you will need to get a honeypot's URL or host your own honeypot., (*8)

Once that is done, you can create up to 8 different links by doing:, (*9)

<?php
// this will create 5 links
echo (new \Honeypot\Quicklink('http://link.to.honeypot.org/'))->render(5);

Patches & Features

  • Fork
  • Mod, fix
  • Test - this is important, so it's not unintentionally broken
  • Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
  • Pull request - bonus point for topic branches

To ensure your PRs are considered for upstream, you MUST follow the PSR2 coding standards., (*10)

Bugs & Feedback

http://github.com/jadb/honeypot/issues, (*11)

License

Copyright (c) 2015, Jad Bitar and licensed under The MIT License., (*12)

The Versions

23/01 2016

dev-master

9999999-dev

Project Honey Pot (un-official) PHP SDK

  Sources   Download

MIT

The Development Requires