Subscribe to Blog
Email Address
 

This website has recently become a target of relentless spam attacks.
Some dumbasses (probably bots or worse Russian hackers) post unrelated messages and such. Possibly looking for exploits in the security system.

I pride my self in openness to any meaningful content and do not want to pre-moderate comments or make registration (with email verification) mandatory.
So I subscribed to https://www.abuseipdb.com free API service that checks user's IP address before allowing to post any comments.

If you by any chance are wrongfully denied access, just let me know and i will clear the block.

On my part i will ban and report spammers with extreme prejudice. Let's make internet spam free one IP at a time!

For webmasters here is plain PHP code i used to enable IP checking and reporting:

Code

<?php
function httpCheckAbuse($ip){
    $key="[secret API key]";
    $url = "https://www.abuseipdb.com/check/".$ip."/json";
    $ret=httpRequest($url,'GET',['key'=>$key,'days'=>60],$status);

    if ($status==200)
        return json_decode($ret);
    else
        return false;
}
function httpReportAbuse($ip,$comment){
    $key="[secret API key]";
    $url = "https://www.abuseipdb.com/report/json";

    $ret=httpRequest($url,'GET',
        [
            'key'=>$key,
            'category'=>10,
            'comment'=>$comment,
            'ip'=>$ip,
        ],$status);
    if ($status==200)
        return json_decode($ret);
    else
        return false;
}

function httpRequest($url,$method,$queryArray,&$status=null){
    $request = curl_init();
    // Set request options
    try{
        switch ($method){
            case 'POST':
                curl_setopt_array($request, array
                    (
                        CURLOPT_URL => $url,
                        CURLOPT_POST => true,
                        CURLOPT_POSTFIELDS => http_build_query($queryArray),
                    ));
                break;
            case 'GET':
            default:
                curl_setopt_array($request, array
                    (
                        CURLOPT_URL => $url."?".http_build_query($queryArray),
                    ));
        }

        curl_setopt($request,CURLOPT_RETURNTRANSFER , true);
        curl_setopt($request,CURLOPT_HEADER, false);
        // Execute request and get response and status code
        $response = curl_exec($request);
        $status = curl_getinfo($request, CURLINFO_HTTP_CODE);

        curl_close($request);
        if($status == 200)
            return $response;
    }catch (Exception $ex){
        return null;
    }
    return null;
}

Best Regards.

--Eldar Gerfanov

Comments:

No Comments posted yet, be the first one!

New Comment to: Fight SPAM!

Name: *
Security Code:
*
 
© 200908:53:46-2016 Eldar Gerfanov. All Rights Reserved.
© 2009 Eldar Gerfanov. Materials on this site are presented as is and are mostly for educational use. You may freely reproduce information presented herein without any consent from me, provided you include link to this site.
In case when i am not the copyright holder, you may want to contact proper owner of material. Anyway, they are freely available on the Internet.
If you hold the copyright right for any of the materials on this site and want them removed, please contact me here