943,852 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 5833
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 26th, 2009
0

PHP Password Generator

Expand Post »
Hi,
I am developing a piece of software which is not in any way being designed to hack into my schools proxy server using HTTP auth
At the moment I have got it to generate random passwords of a random length, however using this method it is sometimes repeating passwords and there is no logical order to follow. Is there any way to get my PHP app to generate passwords in sequence (I know the passwords contain letters a-z A-Z and numbers 0-9)
a -> A -> b ->B etc.
Then move on to
aa -> aA -> ab -> aB etc.
then
ba -> bA etc
or something like that as in it trys each possible character then adds another character to the string and loops.
Regards,
Sam Rudge
P.S. Never try to hack the admin password for your school proxy, it can get you in a lot of trouble lol
Similar Threads
Reputation Points: 26
Solved Threads: 31
Posting Whiz
samarudge is offline Offline
354 posts
since May 2008
Feb 26th, 2009
0

Re: PHP Password Generator

Exactly, that's why most people here probably wont and shouldn't help you with this.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Feb 26th, 2009
0

Re: PHP Password Generator

php simply isn't meant for this kind of thing, regardless of its intention, albeit yours is a pretty useless one. On the basis of an 8 character password, where each letter can be 1 of 62 possibilities (a-zA-Z0-9) that is 9.807971461541689e+55 possibilities.

Good luck with that.
Sponsor
Reputation Points: 265
Solved Threads: 126
Practically a Master Poster
mschroeder is offline Offline
624 posts
since Jul 2008
Feb 26th, 2009
0

Re: PHP Password Generator

OK no need to get stroppy, and btw i was able to get 650 attempts per second with my laptop alone and I have 5 exactly the same + a load of friends with laptops who have said they will run the application. Im running it from a command window not through apache or IIS etc. I also know the password begins with H and is 7-10 characters long. I can also access the proxy with my home servers using VPN. Also i dont know any other languages that can process 650 requests per second and not slow or crash the laptops.
Reputation Points: 26
Solved Threads: 31
Posting Whiz
samarudge is offline Offline
354 posts
since May 2008
Feb 27th, 2009
0

Re: PHP Password Generator

If you want a random password for general purposes then simply just do a hash of the current date, time and microtime. The following is an example:
php Syntax (Toggle Plain Text)
  1. echo substr(hash('sha1',date('d F Y G i s u')),0,10);

But if you are trying to hack into a school network like you have mentioned then try the following:
php Syntax (Toggle Plain Text)
  1. //settings
  2. $chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz";
  3. $minchars=8;
  4. $maxchars=10;
  5.  
  6. //rest of script
  7. $escapecharplus=0;
  8. $repeat=mt_rand($minchars,$maxchars);
  9. while ($escapecharplus<$repeat)
  10. {
  11. $randomword.=$chars[mt_rand(1, strlen($chars)-1)];
  12. $escapecharplus+=1;
  13. }
  14. //display random word
  15. echo $randomword;
The above code is what I used in my sha1 cracker.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Feb 27th, 2009
0

Re: PHP Password Generator

Hmm, thanx but I already have it generating random passwords. I just wanted it to do an incremental attack. I think I will add all the letters to an array and work from there.
Regds,
Sam Rudge
Reputation Points: 26
Solved Threads: 31
Posting Whiz
samarudge is offline Offline
354 posts
since May 2008
Feb 27th, 2009
0

Re: PHP Password Generator

Well if you are trying to get an admin password then wouldn't the most logical thing be to first work out how to communicate with their proxy server (probably sockets). Then to do a password injection into their system so there is a new account then when you go to use their computers simply use the admin password you injected into their system. I hear that is how most online hackers hack into websites.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Feb 27th, 2009
0

Re: PHP Password Generator

Yer but im 16 and the only languages I know are PHP, Perl, Python and C# I also think that creating a new user might make them find out. Or proxy is highly monitored.
Reputation Points: 26
Solved Threads: 31
Posting Whiz
samarudge is offline Offline
354 posts
since May 2008
Feb 27th, 2009
0

Re: PHP Password Generator

Click to Expand / Collapse  Quote originally posted by samarudge ...
Yer but im 16 and the only languages I know are PHP, Perl, Python and C# I also think that creating a new user might make them find out. Or proxy is highly monitored.
I have not yet mentioned to use a different language. What sockets are is just another part of php which can be found out at http://au2.php.net/manual/en/function.socket-create.php Although I have never used php sockets before, from what I have read, the opening connection will look something like the following:
php Syntax (Toggle Plain Text)
  1. $ipaddress='';// server ip address
  2. $socket = socket_create (AF_INET, SOCK_STREAM, tcp);
  3. socket_connect($socket,$ipaddress, 80);
Then after that connection established you can do whatever communications with the server using php sockets.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Feb 27th, 2009
0

Re: PHP Password Generator

Click to Expand / Collapse  Quote originally posted by mschroeder ...
On the basis of an 8 character password, where each letter can be 1 of 62 possibilities (a-zA-Z0-9) that is 9.807971461541689e+55 possibilities.
Or 62^8, or 218,340,105,584,896 possibilities...

Click to Expand / Collapse  Quote originally posted by samarudge ...
i was able to get 650 attempts per second with my laptop alone and I have 5 exactly the same
Ok, 5 of them, assuming you figure a way to start at a certain position and not just do the exact same on all 5 would be 3,250/second.
or 3,639,001,759,748.26 Seconds,
or 60,650,029,329.13 Minutes,
or 1,010,833,822.15 Hours
or 50,541,691.10 Days
or 138,470.38 Years
(please correct me if my math is wrong, its the end of a long day )

Either way, it will take a long time with a PC (or PCs) like yours.

Oh, and in response to your actual question:
Click to Expand / Collapse  Quote originally posted by samarudge ...
Is there any way to get my PHP app to generate passwords in sequence
Yes.
Last edited by Will Gresham; Feb 27th, 2009 at 10:52 pm.
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: All my buttons with javascript dont work.
Next Thread in PHP Forum Timeline: Reg Exp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC