'6LdM3YEUAAAAAPAJ7SQ-ZmBuyKYYqms7iXcCJjrv', 'response' => $_POST['g-recaptcha-response'], ); $ch = curl_init('https://www.google.com/recaptcha/api/siteverify'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 15); $output = curl_exec($ch); if(strpos($output, 'success": true') !== FALSE) { $pair = create_pair(); } else { unset($_POST['create']); unset($pair); } } ?>

IPAuth - 2FA for servers

IPAuth helps you to easily setup an IP-based Two factor authentication (2FA) for your servers.



We created an authentication key pair for your server. It is divided into 2 parts:

  1. An authentication URL. This is used to dynamically capture your local IP. Please Bookmark!
  2. A server Key URL. This is used to dynamically pull the new local IP.

Your Key Pair is:

1- Authentication URL:

2- Server URL:

Basic Setup Instructions

The following instructions will help you make use of the IPAuth system.

Step 1: Save and bookmark the Authentication URL. This will allow you to whitelist your IP when you need it.

Step 2: Create a shell script that dynamically pulls your IP. You can do so using the following script:

        #!/bin/sh
        CURIP=`curl --max-time 5 -s "https://ipauth.net/serverquery/?key=[your server key]" | 
        grep "success" | cut -d ":" -f 3 | cut -d "," -f 1`
        rm -f /root/ipt1
        /sbin/iptables -nL > /root/ipt1
        
        if [ ! "x$CURIP" = "x" ]; then
            grep "ACCEPT" /root/ipt1 |grep "$CURIP" >/dev/null 2>&1
            if [ ! $? = 0 ]; then
            /sbin/iptables -I INPUT --source "$CURIP"  -j ACCEPT -m comment --comment "IPAuth IP: $CURIP"
            fi
        fi

        rm -f /root/ipt1
        

Step 3: Create a scheduled job on your server that checks the IP at some frequency (e.g., every two minutes):

        # crontab -e
        */2 * * * * /etc/path/to/your/file/ipupdater.sh
        
Understanding IPAuth

We created an authentication key pair for your server to authenticate your current IP address to a desired server. It is divided into 2 parts:

  1. An authentication URL. This is used to dynamically capture your local IP. Please bookmark this link.
  2. A server Key URL. This is used to dynamically pull the new local IP.

The design allows you to deploy a whitelist model on your server. Save the authentication url (e.g.,bookmark in your browser) and use the server key URL to pull the new IP address. This is good if your IP changes a lot but still want to employ a whitelist model (e.g., travel).

If you have any questions, comments, recommendations or thoughts about the API, let us know at info@ipauth.net.