MyBB Community Forums

Full Version: how is working Anti ddos Plugins
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
https://community.mybb.com/mods.php?action=view&pid=969

Is say if an user Made multiple request they will have an Error fine but When i try i can refresh the page and have Access to the board to continue torefresh refresh refresh etc ? Does is possible to Disconect the member if they pass the Too request in 3 second by this plugins like when is redirect to the 404 page or Error page is redirect to the logout button Like if they have click ont it with an Message

you have Been Log out for Multiple Request target on the Board
Modify the value in IF($_SESSION['last_session_request'] > TIME() - 0.1){

Setted to 0.1s... put 3 instead
(2020-08-10, 08:01 AM)Crazycat Wrote: [ -> ]Modify the value in IF($_SESSION['last_session_request'] > TIME() - 0.1){

Setted to 0.1s... put 3 instead

thanks but the questions is not this to change 1 to 3 is If possible if One member make Request too qickly under 1 or 3 second The Default time in the plugins i would not change that .. Is possible If they made too fast request Is Disconect from the Board With A message link ( Multiple Request Forbiden ) Reconnect You . !

I know for Logout is use A key of profiles maybe With this we can Made What i Request for ..

thanks you Waiting reply
Just add logout code (remove cookie):
my_unsetcookie("mybbuser");
my_unsetcookie("sid");
redirect("index.php", "Too much request, reconnect please");
(2020-08-10, 11:45 AM)Crazycat Wrote: [ -> ]Just add logout code (remove cookie):
my_unsetcookie("mybbuser");
my_unsetcookie("sid");
redirect("index.php", "Too much request, reconnect please");

Where i Put that code ? and How I Remove cookie ? is a good Idea ?

What You Recommend thanks
Change the last function of the plugin:
function antifloodsecurity_global_start(){
	global $mybb, $session, $db;
	if ($mybb->settings['antifloodsecurity_enable'] == 1){
		if (!isset($_SESSION)) {
			session_start();
		}
		if($_SESSION['last_session_request'] > time() - 10){
			my_unsetcookie("mybbuser");
			my_unsetcookie("sid");
			$time = TIME_NOW;
			// Run this after the shutdown query from session system
			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$time}', lastactive='{$time}' WHERE uid='{$mybb->user['uid']}'");
			$db->delete_query("sessions", "sid = '{$session->sid}'");
			redirect("index.php", "Too much request, reconnect please");
		}
	}
} 
(2020-08-10, 11:55 AM)Crazycat Wrote: [ -> ]Change the last function of the plugin:
function antifloodsecurity_global_start(){
	global $mybb, $session, $db;
	if ($mybb->settings['antifloodsecurity_enable'] == 1){
		if (!isset($_SESSION)) {
			session_start();
		}
		if($_SESSION['last_session_request'] > time() - 10){
			my_unsetcookie("mybbuser");
			my_unsetcookie("sid");
			$time = TIME_NOW;
			// Run this after the shutdown query from session system
			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$time}', lastactive='{$time}' WHERE uid='{$mybb->user['uid']}'");
			$db->delete_query("sessions", "sid = '{$session->sid}'");
			redirect("index.php", "Too much request, reconnect please");
		}
	}
} 


thanks you

(2020-08-10, 11:55 AM)Crazycat Wrote: [ -> ]Change the last function of the plugin:
function antifloodsecurity_global_start(){
	global $mybb, $session, $db;
	if ($mybb->settings['antifloodsecurity_enable'] == 1){
		if (!isset($_SESSION)) {
			session_start();
		}
		if($_SESSION['last_session_request'] > time() - 10){
			my_unsetcookie("mybbuser");
			my_unsetcookie("sid");
			$time = TIME_NOW;
			// Run this after the shutdown query from session system
			$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$time}', lastactive='{$time}' WHERE uid='{$mybb->user['uid']}'");
			$db->delete_query("sessions", "sid = '{$session->sid}'");
			redirect("index.php", "Too much request, reconnect please");
		}
	}
} 

Can you Copy The Complet File Modified for Made what i speak about because i dont understand I need to Copy All the Text in your last message and replace For the Plugins or add at the end ?

is Just That I need to add

if($_SESSION['last_session_request'] > time() - 10){
my_unsetcookie("mybbuser");
my_unsetcookie("sid");
$time = TIME_NOW;
// Run this after the shutdown query from session system
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$time}', lastactive='{$time}' WHERE uid='{$mybb->user['uid']}'");
$db->delete_query("sessions", "sid = '{$session->sid}'");
redirect("index.php", "Too much request, reconnect please");
}
}
}



After Session_starts();
}

?

i have replace the function start with all of the code you send to me save and replace the plugins and re installed now on Spam on Page or open multiple table is dont made Anything i have re place the original file Waiting your Come back Thanks