Proxy Detection Web Service: Usage from Perl, ASP and PHP

Examples below show how to use the MaxMind Proxy Detection web service API from server-side scripts in Perl, ASP and PHP. These can be adapted for other web services.

Any programming language that supports HTTP client calls should be able to use MaxMind web services.

Perl Example

#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request qw(GET POST);
use HTTP::Headers;

# replace this value with license key
my $license_key = "LICENSE_KEY_HERE";

my $ua = LWP::UserAgent->new(timeout => 2);
my $h = HTTP::Headers->new;
$h->content_type('application/x-www-form-urlencoded');
my $request = HTTP::Request->new('POST','https://minfraud3.maxmind.com/app/ipauth_http',
$h,"l=$license_key&ipaddr=80.24.24.24");
my $res = $ua->request($request);
my $content = $res->content;
print "content = $content\n"
Active Server Pages (ASP) Example
Dim objHttp, strQuery
strQuery = "https://minfraud3.maxmind.com/app/ipauth_http?l=" & license_key & _
"&ipaddr=" & ipaddress
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "GET", strQuery, false
objHttp.send
Response.Write objHttp.ResponseText
Set objHttp = Nothing
Requirements:

  1. ASP 3.0+
  2. Microsoft® XML 3.0 Component
Microsoft XML 3.0 Component can be downloaded for free from here. PHP Example
#!/usr/bin/php -q
<?php
$license_key = 'LICENSE_KEY_HERE';
$ipaddress = 'IP_ADDRESS_HERE';
$query = "https://minfraud3.maxmind.com/app/ipauth_http?l=" . $license_key
. "&ipaddr=" . $ipaddress;
$score = file_get_contents($query);
echo $score;
?>

'Hacking' 카테고리의 다른 글

Security Checklists  (0) 2009.02.06
How to Make Sigs and finding packet id's to get Addresses  (0) 2009.02.04
How to block Proxy Servers  (0) 2009.01.29
Reverse Engineering Books  (1) 2009.01.28
Debugger  (0) 2009.01.28
Posted by CEOinIRVINE
l