Please read before continuing- If you do modifications on a file, be sure the BACKUP the original file!
- I might be able to do custom modifications if the price is right. I do not code for $3 an hour.
- I do NOT claim my code is 100% safe. Use it at your own risk!
- These mods are written for the most basic faucet owners with no coding skills. Don't flame if it's too easy for you.
- Donations are always appreciated: 18331uW3DzHiZAX15t6VvnvcHkdnAj7oEM
NH downtime protectionPreventing claims by blocking (partial) hostnames will not work when the NastyHosts website is down.
Faucets that use NastyHosts as their only IP checking service are also vulnerable for claims made by VPNs/proxies (bots). That's why you need to check if NastyHosts is available before you let a user claim.
The instructions below will display a simple message to your faucet users.
Instructions1. Backup the original "index.php" file from your root directory.
2. Open the "index.php" from your root directory in Notepad or any other editor.
3. Search the file for this code:
$hostnames = @file_get_contents($security_settings["ip_check_server"].getIP());
$hostnames = json_decode($hostnames);
4. Change the code to this:
$hostnames = @file_get_contents($security_settings["ip_check_server"].getIP());
if (stripos($hostnames, 'suggestion') === false) {
print "We are having technical difficulties. Sorry for the inconvenience. Please come back later.";
trigger_error("IP check could not be reached - IP address: ".getIP());
die();
}
$hostnames = json_decode($hostnames);
5. Save and upload the new "index.php" file.
Notes- When NastyHosts is down you can NOT log into your FaucetinaBOX admin panel. You might need to repair the modification above if you need access when NH is down.. and thus users who use (partially) blocked hostnames can claim again.
- You can check your FTP server on a daily base to see if NastyHosts was down when people tried to claim. The "error_log" file will look like this:
[16-Feb-2016 16:35:16 UTC] PHP Notice: IP check could not be reached - IP address: 51.254.*.* in /home/your_site/public_html/index.php on line 1448