What is the URL to use with the api for project honeypot?

68 views Asked by At

I signed up for project honeypot and obtained the 12 digit api key. Am trying to test it but the url I am sending sends me to a generic page. I am expecting a positive/negative result, maybe purpose. Using APIs is new to me. Here is what I have:

$project_honeypot_key = "999999999999"; // this format
$ip_addr = "123.456.789.098"; // $ip_addr = getenv("REMOTE_ADDR");
$reversedIP = implode('.', array_reverse(explode('.', $ip_addr))); // 098.789.456.123
$listSpecificDomain = 'dnsbl.httpbl.org';

$honeypot_url = "$project_honeypot_key.$reversedIP.$listSpecificDomain";

Expanded: $honeypot_url = "999999999999.123456789012.dnsbl.httpbl.org";

$response = file_get_contents("https://www.projecthoneypot.org/$honeypot_url");

Addended 2023-11-21

I checked the honeypot page and it says with the dots. Their page says:

rluilwyouaez.7.1.1.127.dnsbl.httpbl.org [Access Key] [Octet-Reversed IP] dnsbl.httpbl.org

Regardless, I made the change and tried again. Both variations of the reversed ip address take me to my dashboard page.

honeypot_url: https://www.projecthoneypot.org?$honeypot_key.184.45.57.70.dnsbl.httpbl.org honeypot_url2: https://www.projecthoneypot.org?$honeypot_key.184455770.dnsbl.httpbl.org

Something else?

1

There are 1 answers

1
Kieveli On

I'd guess your 'implode' is messing up:

$reversedIP = implode('', array_reverse(explode('.', $ip_addr))); // 098.789.456.123

You're imploding it but putting the periods back in. This modification removes the '.' from the implode directive, so you should just get a single string like you need.