sleep function

Reply

Join Date: Aug 2008
Posts: 94
Reputation: designingamy is an unknown quantity at this point 
Solved Threads: 0
designingamy designingamy is offline Offline
Junior Poster in Training

sleep function

 
0
  #1
Aug 21st, 2008
Hello all!

I wanted to ask everyone what they thought about the sleep function in php. I do believe I'm going to use it for my website, but I'm really unsure how to implement it in. I wanted to use it on the login page. I googled this until I'm blue in the face and can't get anywhere. Does anyone know of a good site that shows lots of examples? Or can someone show me where to put it in a login code?

Thanks bunches!
~Amy
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: sleep function

 
0
  #2
Aug 21st, 2008
Originally Posted by designingamy View Post
Hello all!

I wanted to ask everyone what they thought about the sleep function in php. I do believe I'm going to use it for my website, but I'm really unsure how to implement it in. I wanted to use it on the login page. I googled this until I'm blue in the face and can't get anywhere. Does anyone know of a good site that shows lots of examples? Or can someone show me where to put it in a login code?

Thanks bunches!
~Amy
I've never used the sleep function. I think its usefulness is limited to very few things. Can you be more specific about what you are going to use it for?
Last edited by R0bb0b; Aug 21st, 2008 at 11:29 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 94
Reputation: designingamy is an unknown quantity at this point 
Solved Threads: 0
designingamy designingamy is offline Offline
Junior Poster in Training

Re: sleep function

 
0
  #3
Aug 22nd, 2008
Like I said, I want to use it for the LogIn page, so if hackers want to try to use 50 billion passwords to find the right username, or vice versa, it may take them longer than they want to wait.

Since you don't use the sleep function, I'm curious to know what you use for security. I've heard both good and bad things about the sleep function. I don't think it will hurt to use it and any additional security to try to prevent the wrong ones from entering.

~Amy
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: sleep function

 
0
  #4
Aug 22nd, 2008
Originally Posted by designingamy View Post
Like I said, I want to use it for the LogIn page, so if hackers want to try to use 50 billion passwords to find the right username, or vice versa, it may take them longer than they want to wait.

Since you don't use the sleep function, I'm curious to know what you use for security. I've heard both good and bad things about the sleep function. I don't think it will hurt to use it and any additional security to try to prevent the wrong ones from entering.

~Amy
I limit the number of failed attempts for that user, then lock the account, then unlock it after an hour once the activity stops or at password reset, which ever comes first.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 94
Reputation: designingamy is an unknown quantity at this point 
Solved Threads: 0
designingamy designingamy is offline Offline
Junior Poster in Training

Re: sleep function

 
0
  #5
Aug 22nd, 2008
Hmmm...that sounds like a good idea. But what about if a hacker has a password and then does nothing but try to figure out what the username is. How do you prevent those attacks?

~Amy
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: sleep function

 
0
  #6
Aug 22nd, 2008
Originally Posted by designingamy View Post
Hmmm...that sounds like a good idea. But what about if a hacker has a password and then does nothing but try to figure out what the username is. How do you prevent those attacks?

~Amy
WOW, you are thorough. Guess I never really considered that. I'm still not convinced that it is the best way to handle it since it would effect the other legitimate users as well though. But if you want to, I think it should be right before the database connection.
Last edited by R0bb0b; Aug 22nd, 2008 at 2:57 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 94
Reputation: designingamy is an unknown quantity at this point 
Solved Threads: 0
designingamy designingamy is offline Offline
Junior Poster in Training

Re: sleep function

 
0
  #7
Aug 22nd, 2008
Yes, but I think if it were only delayed a few seconds I don't think that most users would have a major problem with it.

I guess it could be possible to do both? Limit the # of attempts as well as using the sleep function?

~Amy
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: sleep function

 
0
  #8
Aug 25th, 2008
Once again, hackers might keep trying the passwords, but you might want to try an approach of blocking ip's. 5 attempts at an ip with an incorrect password, record the ip in a table, and pull back from the table when user's are accessing the login page. If they match an ip in the table, disable the ability to log in or along those lines. Yes they can spoof the ip's, but it is a viable solution.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 94
Reputation: designingamy is an unknown quantity at this point 
Solved Threads: 0
designingamy designingamy is offline Offline
Junior Poster in Training

Re: sleep function

 
0
  #9
Aug 26th, 2008
That sounds like a pretty good idea...of course they could go to any computer, but it would make it harder for them.

I am not sure exactly how to write all that php code. Can you point me into the right direction, a website perhaps, that discusess this?

I really appreciate it

~Amy
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: sleep function

 
0
  #10
Aug 26th, 2008
Here's a link of how to get the ip address
http://www.plus2net.com/php_tutorial/php_ip.php

Then just set up table along the lines of

BLOCKED_IP
FAILED_LOGIN_ATTEMPTS
LAST_FAILED_TIME

When the user accesses the page, check the ip against blocked_ip, if it matches then check LAST_FAILED_TIME and FAILED_LOGIN_ATTEMPTS, if it is greater than 30 min and whatever value for FAILED_LOGIN_ATTEMPTS you choose, then display the login page, otherwise dispaly the access denied page and increment the FAILED_LOGIN_ATTEMPTS. If you allow access, delete the row for that ip. If the user types in a bad password insert or increment the FAILED_LOGIN_ATTEMPTS.

You might want to go about it a little different of a way, but there is a good start.

Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC