note 54393 added to function.sleep

From: Date: Sat, 02 Jul 2005 21:43:22 +0000
Subject: note 54393 added to function.sleep
Groups: php.notes 
Request: Send a blank email to php-notes+get-91320@lists.php.net to get a copy of this message
I think you guys are over thinking this. It's always nice to code expecting the worse, but odds are, you will never have someone targetting you for exploits in your custom code. They would rather find exploits in a nuke site so that they can do the most damage. With that aside, an effective way to prevent brute force attacks would be to only allow a certain number of authentication attempts at once, regardless of the IP. 15 would be a safe number, and sleep(10). Brute force attacks can only be successful under two conditions, 1) be able to process insanely fast, or 2) get really lucky and find an easy password. When an authentication request starts, write a row to a mySQL table and delete it when you're done. Also mysql_num_rows when you start the request. Deny immediately if num_rows returns greater than 15, sleep 10 seconds if num_rows exceeds 10, and sleep 5 seconds no matter what. This progressive security approach would not only be effective, but would baffle the cracker. (he cannot see your code and would not know what is going on) But do not let anyone tell you any different. If he decides to DoS you (ane he has the resources to pull it off).. there is nothing you can do to stop it outside of notifying your ISP. -Luke ---- Manual Page -- http://www.php.net/manual/en/function.sleep.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54393 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54393&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54393&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54393&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54393&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54393&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54393&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54393&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91320) next »