Hello,
My site has been under heavy DDoS attacks for the past month!, it seems like they are using vBulletin against the server since the index page has many queries, and running the index page for say 500 times/second would send thousands of queries to the Mysql server causing it to crash over and over again.
Since vb.org is the official site for vbulletin modifications, I was thinking of an easy solution that I couldnt make, I'm a beginner PHP programmer but havnt got into vb mods programming yet. The idea was to create a modification that applys to all the templates, simply checking for a session variable ( $_SESSION['human'] ) , cookies or both. if they exist than its a real user, otherwise its a bot or a just a visitor.
If its a visitor than the mod would show a little form with one submit button ( Click me to enter ). the form would assign the ( human ) session variable and show the previously requested URL.
This would prevent requesting all the queries on the index page (or any other page) and replace it with a harmful, light and query-less page when detecting a non-human or a user without cookies.
See the PHP code below to better understanding of the idea:
PHP Code:
IF ( !isset($_SESSION['human') || !isset($_COOKIE['prefix_userid'])) { show a form with a submit button ( Click to enter ). } else { (Show the requested page ). } /////////////////// The form processing code would be something similar to this : IF (isset($_POST['click_me'])) { $_SESSION['human']==1; }
The mode would simply be applied to the header to prevent loading any unnecessary data that would consume server resources during a DDoS attack, memebers wont need a variable to tell vb they're human since they have a userid cookie, visitors would need such confirmation. thats it!
I hope you guys got the idea, and hope one of you is gonna be able to do it in the next 2 or 3 days. I'm really in need for it, its just that I'm too busy upgrading to a dedicated server to learn the vBulletin coding HowTo's now!
BTW, sorry for the bad english, after all its a second language to me!
Thanks