Bitcoin Forum

Economy => Micro Earnings => Topic started by: Octopus.pp.ua on April 24, 2016, 01:16:02 PM



Title: Bots attacked?
Post by: Octopus.pp.ua on April 24, 2016, 01:16:02 PM
Hi all!

So, how can i see, bots is the really zaebali (sorry for my french).

I had used antibot script and .htaccess.
My ban list you can see in http://octopus.pp.ua/BAN.txt . It consist proxies and TOR's IP's. Manually checked every day, when i had attacked by bots. Yes, i'm nerd :)

And antibot script. I had set timeout in "Get reward" button in 60 sec, and set coockies with time of impression from user. When user click to "Get reward" button, i have check, is 60 sec out. So, when bots attack again, i will change that to save it in session.

If you want, you can use my experience.

1. Open your index file and add in first
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

"Mortal" saved current ip of user
"Combat" saved current time of visit

2. In "POST" section add:
Code:
	if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Where function banned(); is

Code:
function banned() {
    trigger_error("Banned: ".getIP());
    http_response_code(403);
    die();
}

So, with that code and .htaccess i defence my faucets.

Good luck!


Title: Re: Bots attacked?
Post by: Marteen23 on April 24, 2016, 02:56:38 PM
Hi all!

So, how can i see, bots is the really zaebali (sorry for my french).

I had used antibot script and .htaccess.
My ban list you can see in http://octopus.pp.ua/BAN.txt . It consist proxies and TOR's IP's. Manually checked every day, when i had attacked by bots. Yes, i'm nerd :)

And antibot script. I had set timeout in "Get reward" button in 60 sec, and set coockies with time of impression from user. When user click to "Get reward" button, i have check, is 60 sec out. So, when bots attack again, i will change that to save it in session.

If you want, you can use my experience.

1. Open your index file and add in first
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

"Mortal" saved current ip of user
"Combat" saved current time of visit

2. In "POST" section add:
Code:
	if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Where function banned(); is

Code:
function banned() {
    trigger_error("Banned: ".getIP());
    http_response_code(403);
    die();
}

So, with that code and .htaccess i defence my faucets.

Good luck!

Hey after putting the codes my own IP address gets blocked, What can i do?


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 24, 2016, 02:59:59 PM
Hi all!

So, how can i see, bots is the really zaebali (sorry for my french).

I had used antibot script and .htaccess.
My ban list you can see in http://octopus.pp.ua/BAN.txt . It consist proxies and TOR's IP's. Manually checked every day, when i had attacked by bots. Yes, i'm nerd :)

And antibot script. I had set timeout in "Get reward" button in 60 sec, and set coockies with time of impression from user. When user click to "Get reward" button, i have check, is 60 sec out. So, when bots attack again, i will change that to save it in session.

If you want, you can use my experience.

1. Open your index file and add in first
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

"Mortal" saved current ip of user
"Combat" saved current time of visit

2. In "POST" section add:
Code:
	if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Where function banned(); is

Code:
function banned() {
    trigger_error("Banned: ".getIP());
    http_response_code(403);
    die();
}

So, with that code and .htaccess i defence my faucets.

Good luck!

Hey after putting the codes my own IP address gets blocked, What can i do?

U must wait 1 min before claim. Or, you can set another timout in
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000); 

And

Code:
if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))

First code mean lifetime of cookies is 50 min, second - check, is 50 sec is out when user click button


Title: Re: Bots attacked?
Post by: Marteen23 on April 24, 2016, 03:13:43 PM
Hi all!

So, how can i see, bots is the really zaebali (sorry for my french).

I had used antibot script and .htaccess.
My ban list you can see in http://octopus.pp.ua/BAN.txt . It consist proxies and TOR's IP's. Manually checked every day, when i had attacked by bots. Yes, i'm nerd :)

And antibot script. I had set timeout in "Get reward" button in 60 sec, and set coockies with time of impression from user. When user click to "Get reward" button, i have check, is 60 sec out. So, when bots attack again, i will change that to save it in session.

If you want, you can use my experience.

1. Open your index file and add in first
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

"Mortal" saved current ip of user
"Combat" saved current time of visit

2. In "POST" section add:
Code:
	if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Where function banned(); is

Code:
function banned() {
    trigger_error("Banned: ".getIP());
    http_response_code(403);
    die();
}

So, with that code and .htaccess i defence my faucets.

Good luck!

Hey after putting the codes my own IP address gets blocked, What can i do?

U must wait 1 min before claim. Or, you can set another timout in
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000); 

And

Code:
if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))

First code mean lifetime of cookies is 50 min, second - check, is 50 sec is out when user click button
So should i make sure my browser is also enabled to save cookies because i think my browser is set to block cookies from websites


Title: Re: Bots attacked?
Post by: Marteen23 on April 24, 2016, 03:27:59 PM
All set now, thank you!


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 24, 2016, 04:50:38 PM
All set now, thank you!

U r wellcome %) I hope, that's can help against bots


Title: Re: Bots attacked?
Post by: Marteen23 on April 25, 2016, 12:08:41 AM
All set now, thank you!

U r wellcome %) I hope, that's can help against bots

Oh it works! I have seen how much many people have been banned in just under 1 minute. Most of them from Russia. What i did before to block Russians was to block the whole country but i realized i was losing ads revenue and also i was denying innocent people access because Russia Uses the the most spam bots and proxies. But that i have something like this, i don't have to worry about the spammers and their spambots! Thank you, now my ad revenue and page views are picking up, i have had more than 20000pageviews under 6hours! Whoop Whoop!


Title: Re: Bots attacked?
Post by: wdnj on April 25, 2016, 12:14:50 AM
Hi all!

So, how can i see, bots is the really zaebali (sorry for my french).

I had used antibot script and .htaccess.
My ban list you can see in http://octopus.pp.ua/BAN.txt . It consist proxies and TOR's IP's. Manually checked every day, when i had attacked by bots. Yes, i'm nerd :)

And antibot script. I had set timeout in "Get reward" button in 60 sec, and set coockies with time of impression from user. When user click to "Get reward" button, i have check, is 60 sec out. So, when bots attack again, i will change that to save it in session.

If you want, you can use my experience.

1. Open your index file and add in first
Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

"Mortal" saved current ip of user
"Combat" saved current time of visit

2. In "POST" section add:
Code:
	if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Where function banned(); is

Code:
function banned() {
    trigger_error("Banned: ".getIP());
    http_response_code(403);
    die();
}

So, with that code and .htaccess i defence my faucets.

Good luck!
Is this for faucetbox script?


Title: Re: Bots attacked?
Post by: LaStOpTi0N on April 25, 2016, 05:14:48 AM
Will you please show proper coding of this anti-bot you mention above with line number where we have to put it.I really need it because my faucet is full of bots.Faucetbox admin panel show around 6000 claims/day but google adsense show only 800. :(

I don't wanna refill my wallet till i fix it so please help me & give some advice .


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 25, 2016, 07:55:59 AM

Oh it works! I have seen how much many people have been banned in just under 1 minute. Most of them from Russia. What i did before to block Russians was to block the whole country but i realized i was losing ads revenue and also i was denying innocent people access because Russia Uses the the most spam bots and proxies. But that i have something like this, i don't have to worry about the spammers and their spambots! Thank you, now my ad revenue and page views are picking up, i have had more than 20000pageviews under 6hours! Whoop Whoop!

Good luck in your work :)


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 25, 2016, 07:59:07 AM

 Is this for faucetbox script?

Yes, this code for faucetbox script, but it will work in another scripts, if you use appropriate functions such as "getip()".


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 25, 2016, 08:16:51 AM
Will you please show proper coding of this anti-bot you mention above with line number where we have to put it.I really need it because my faucet is full of bots.Faucetbox admin panel show around 6000 claims/day but google adsense show only 800. :(

I don't wanna refill my wallet till i fix it so please help me & give some advice .

This code insert in 2-3 rows of index.php, after "<?php":

Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

Scroll to 1547 row and insert after "// banning
        $ip = ip2long(getIP());
        if($ip) { // only ipv4 supported here
            foreach($security_settings["ip_ban_list"] as $ban) {
                if(ipSubnetCheck($ip, $ban)) {
                    banned();
                }
            }
        }"

Code:
if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Function "banned()" already in faucetbox script, so, that's all you have to do.

Do not forget use timer on button "Get reward".


Title: Re: Bots attacked?
Post by: Werko on April 25, 2016, 08:49:15 AM
You can use flash-cookies instead the browser cookies. Is not so easy to manipulate.


Title: Re: Bots attacked?
Post by: ~Bitcoin~ on April 25, 2016, 02:58:43 PM
You can use flash-cookies instead the browser cookies. Is not so easy to manipulate.
Could you give some detail about how to set those flash cookie up. I now gonna implement this cookie method in my another script not a faucetbox account but i think this will also be good for any site.


Title: Re: Bots attacked?
Post by: Werko on April 26, 2016, 07:40:47 AM
Here is a good example.

https://github.com/nfriedly/Javascript-Flash-Cookies


Title: Re: Bots attacked?
Post by: tomaa on April 27, 2016, 06:41:45 AM
Thank you for this. Over the weekend I got ripped by the bots and need to shut down. I'm taking now all the measures before the relaunch.


Title: Re: Bots attacked?
Post by: datalore on April 27, 2016, 03:33:37 PM
How to install?


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 27, 2016, 03:36:13 PM
Thank you for this. Over the weekend I got ripped by the bots and need to shut down. I'm taking now all the measures before the relaunch.

U r wellcome %)


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on April 27, 2016, 03:37:05 PM
How to install?

Full way, how to install in 12 post: https://bitcointalk.org/index.php?topic=1448604.msg14656996#msg14656996


Title: Re: Bots attacked?
Post by: BitRipped on May 01, 2016, 09:51:23 PM
Nice  ;D very nice.. I will be giving this a try to say to the least. Thank you


Title: Re: Bots attacked?
Post by: dfinc on May 03, 2016, 09:46:14 PM
This code works well, but I was wondering is there is any way you could use this together with the AntiBotLinks script?


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on May 04, 2016, 07:24:13 PM
This code works well, but I was wondering is there is any way you could use this together with the AntiBotLinks script?

You can use this code with any another AntiBotLinks script


Title: Re: Bots attacked?
Post by: frycek on May 04, 2016, 08:47:41 PM
Can I use this script with 15 second timer?


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on May 04, 2016, 10:12:35 PM
Can I use this script with 15 second timer?

Sure. Just set timeout:
Code:
if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))

15, not 50.

Recomended set 10 sec, when page loaded


Title: Re: Bots attacked?
Post by: frycek on May 05, 2016, 06:52:10 PM
Thanks :)
Where I can find banned IP list?


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on May 05, 2016, 07:54:30 PM
Thanks :)
Where I can find banned IP list?

You can find it in your webserver's logs (error code 403), or you can use code such as:

Code:
$ra = getIP();
$fname = $_SERVER['SERVER_NAME'];

$sql = "INSERT INTO log_faucets (ip, fname)
VALUES
('$ra', '$fname')";

mysql_query($sql, $link);

in IF statement (when cheked, is user legal, listing posted in first post), and logs with banned IPs will be accumulated in database table 'log_faucets'. Sure, you must create this table before:

Code:
CREATE TABLE IF NOT EXISTS `log_faucets` (
  `ip` varchar(50) NOT NULL,
  `fname` varchar(100) NOT NULL,
  `DT` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Where 'ip' - banned ip
'fname' - faucet's name (if you use some faucets)
'DT' - datetime of impression

And later you can use this list in .htaccess or check IP in future impressions for preventive ban.


Title: Re: Bots attacked?
Post by: frycek on May 05, 2016, 08:28:29 PM
Am I do it right?

https://i.imgur.com/yMZdaAT.png

I want to ask because I don't have any knowledge about sql and php.


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on May 05, 2016, 08:42:24 PM
Am I do it right?

https://i.imgur.com/yMZdaAT.png

I want to ask because I don't have any knowledge about sql and php.

1. Are you create this table (log_faucets) in your database?
2. Are you connect to database in your script? Do not post connection string to forum coz you can lose your money.
3. Move "{" up to string with "$ra = getIP();" - it's border of IF statement (must be "{$ra = getIP();")

1, 2 you can google how to using DB, or i can help


Title: Re: Bots attacked?
Post by: frycek on May 05, 2016, 09:08:03 PM
Thanks for help, I create table in DB with your commend.
My site is connected to DB (satoshi are sended and adresses are recorded in DB - so I think it's ok).
So now I have to wait is any IP get catch to my log_faucets table :)


Title: Re: Bots attacked?
Post by: Octopus.pp.ua on May 06, 2016, 09:14:40 PM
Thanks for help, I create table in DB with your commend.
My site is connected to DB (satoshi are sended and adresses are recorded in DB - so I think it's ok).
So now I have to wait is any IP get catch to my log_faucets table :)

So? Have you result?


Title: Re: Bots attacked?
Post by: BitRipped on May 07, 2016, 12:06:50 PM
Is there any way of logging the Invalid and successful CAPTCHAS?

So successful and non successful responses can be added to log file somewhere or a new one entirely? I'm thinking Fail2Ban can then be configured on that log file to trigger temp ban. Then maybe a additional permanent blacklist rule could be made on fail rate  ;)


Title: Re: Bots attacked?
Post by: frycek on May 07, 2016, 02:51:59 PM
Thanks for help, I create table in DB with your commend.
My site is connected to DB (satoshi are sended and adresses are recorded in DB - so I think it's ok).
So now I have to wait is any IP get catch to my log_faucets table :)

So? Have you result?

I don't have any records in log_faucets table. I don't know is it possible that my faucet is blear from bots.
(I use nasty hosts protection)


Title: Re: Bots attacked?
Post by: n3rvi0zz0 on May 07, 2016, 05:53:25 PM
Will you please show proper coding of this anti-bot you mention above with line number where we have to put it.I really need it because my faucet is full of bots.Faucetbox admin panel show around 6000 claims/day but google adsense show only 800. :(

I don't wanna refill my wallet till i fix it so please help me & give some advice .

This code insert in 2-3 rows of index.php, after "<?php":

Code:
setcookie("Mortal",$_SERVER['REMOTE_ADDR'], time()+3000);
setcookie("Combat",time(), time()+3000);

Scroll to 1547 row and insert after "// banning
        $ip = ip2long(getIP());
        if($ip) { // only ipv4 supported here
            foreach($security_settings["ip_ban_list"] as $ban) {
                if(ipSubnetCheck($ip, $ban)) {
                    banned();
                }
            }
        }"

Code:
if (($_COOKIE['Mortal'] != getIP()) or ((time() - $_COOKIE['Combat']) < 50))
{
banned();
}

Function "banned()" already in faucetbox script, so, that's all you have to do.

Do not forget use timer on button "Get reward".


im using antibots link and i have this problem i needed to delete the default button and now the  button shows straigh away to do the antibots stuff

also in wich index we put this code in the template or in the root folder