Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum
Register Blogs Search Today's Posts Mark Forums Read

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-2009, 02:22 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
Passwords

So I found an old backup and have a encrypted file. I know some of the letters in the password so I tried searching for a bruteforce program but I kinda gave up on that lol. I figured it wouldnt take much to figure this out myself.

Then I ran into this problem. If I have the possible characters into an array, I figured if I just put it into a loop and go through each character and inside that go through each charcter, etc I would get all the possibilities.

PHP Code:
<pre>
<?PHP
$eol 
"\n";
$chars = array("a""b""c");
$i 0;
while(
$i count($chars)) {
    
$ii 0;
    while(
$ii count($chars)) {
        
$iii 0;
        while(
$iii count($chars)) {
            echo 
$chars[$i].$chars[$ii].$chars[$iii].$eol;
            
$iii++;
        }
        
$ii++;
    }
    
$i++;
}
?>
</pre>
Basically if I have this it echos out:
Quote:
aaa
aab
aac
aba
abb
abc
aca
acb
acc
baa
bab
bac
bba
bbb
bbc
bca
bcb
bcc
caa
cab
cac
cba
cbb
cbc
cca
ccb
ccc
Which is correct but what if I want more than 3 caracters? Is there an easier way to do this then to embed more loops inside the loops? In that case if I wasnt sure if it was say 6 characters or 7 characters id have to run the program with 6 loops, then that fails I go again with 7? Is there a way to do this and just run it once? There has gotta be another way then 17+ embed loops lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-08-2009, 04:11 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 24,556
Jordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to all
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan Send a message via Yahoo to Jordan
Re: Passwords

Yup, you can use recursion to get it done easier. Modified this script here to fit your needs: Brute Force PHP Script : eternal rise
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-08-2009, 04:34 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
Re: Passwords

Ah recursion - should look more into this have not did to much with it quite yet besides the basic loop lol.

Thanks for it tho this really helps =)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-08-2009, 05:56 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 24,556
Jordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to all
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan Send a message via Yahoo to Jordan
Re: Passwords

It is a neat subject to look into and work with.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-08-2009, 08:09 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
Re: Passwords

Yes, I believe my data structure teacher said recursion is a main concept in computer science.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-08-2009, 08:15 PM
Orjan's Avatar
Moderator
 
Join Date: Sep 2007
Location: Karlstad, Sweden
Age: 34
Posts: 2,553
Orjan is a glorious beacon of lightOrjan is a glorious beacon of lightOrjan is a glorious beacon of lightOrjan is a glorious beacon of lightOrjan is a glorious beacon of light
Send a message via MSN to Orjan Send a message via Skype™ to Orjan
Re: Passwords

Yes it is, there is even whole program languages based purely on recursion. (PROLOG at least), where you have a fact, which can contain of a fact and a list and the list can contain a fact and a list etc...
__________________
Ask me: Orjan | Contribute to the Wiki! | Make your own Programming blog!
I usually play eRepublik and Travian when I'm not on CodeCall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-08-2009, 10:22 PM
John's Avatar
Co-Administrator
 
Join Date: Jul 2006
Age: 21
Posts: 5,835
John is just really niceJohn is just really niceJohn is just really niceJohn is just really niceJohn is just really nice
Send a message via AIM to John Send a message via MSN to John
Re: Passwords

Quote:
Originally Posted by orjan View Post
Yes it is, there is even whole program languages based purely on recursion. (PROLOG at least), where you have a fact, which can contain of a fact and a list and the list can contain a fact and a list etc...
Just because Prolog doesn't have loops doesn't mean it is based on recursion. However, Prolog _is_ based on logic.
__________________

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Passwords? Wanch Linux/Unix General 25 02-01-2009 03:34 PM
Passwords travy92 Visual Basic Programming 6 10-06-2007 11:33 AM
Passwords? littlefranciscan General Programming 3 03-06-2007 04:22 PM
Passwords Chan C# Programming 5 08-07-2006 08:26 AM
Passwords NeedHelp Technology Ramble 3 07-21-2006 04:20 PM


All times are GMT -5. The time now is 11:19 AM.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0