BBS.PROGENIC.COM
Home      Members   Calendar   Who's On   SOTM
Welcome Guest ( Login | Register )
      

Home » Chat » Coding » [php] dictionary generator


[php] dictionary generatorExpand / Collapse
Author
Message
Posted Friday, April 18, 2008 9:32 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Today @ 10:19 AM
Posts: 344, Visits: 2,230
Hey im trying to make a dictionary generator in php and i have a working beta ver that takes a length provided by the user that writes to a file upper or lower case char sets, with each set on a new line

so it uot puts like:
aaa
aab
aac

or

AAA
AAB
AAC

Im not really sure how to mix lower and upper case chars or how to add digits special chars or spaces. Any ideas??

Heres my code so far.

PW length: 

::Case::

Lower:

Upper:



if($_GET['max'] != '')
{
$pwl = $_GET['max'];
$pwn = '0';
$num = '';
while($pwn != $pwl)
{
$num .= $_GET['case'];
$pwn++;
}
//echo $num;
$sum = array();
$sumn = '0';
while($sumn != $pwl)
{
array_push($sum, '26');
$sumn++;
}
$i = '0';
$file = fopen('pwl.dic', 'w+');
while($i != array_product($sum))
{
fputs($file, '$num');
$i++;
$num++;
}
fclose($file);
echo 'Download you PW list';
}
?>


< ?
$a = 'RTFM';
$b = 'STFU';
echo $a.' & '.$b;
?>
Post #14356
Posted Saturday, April 19, 2008 7:22 AM
Progenic Family

Progenic Family

Group: Old Skool
Last Login: Thursday, September 11, 2008 3:31 PM
Posts: 159, Visits: 1,093
Not knocking it, but why reinvent the wheel when you can just use John to output the combos etc assuming most people will want a local wordlist for a local copy of whatever passes they're working on? BTW, have you worked out the filesize some of those brute force files will be? That's why most are generated on the fly...

I don't do PHP, but if I was doing this I'd just use the Ascii values of all printable characters and cycle through them in loops to generate all the possible combination - probably horribly inefficient but wouldn't take long to whizz through.

Edit - looks like it's the Chr(x) function in PHP, so as 97-122 = a-z, 65-90 = A-Z etc, you can just specify ranges for each subset of printable characters then use your loops to go through them as needed...

http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters



Post #14358
Posted Saturday, April 19, 2008 8:08 AM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Today @ 10:19 AM
Posts: 344, Visits: 2,230
anonymoose (4/19/2008)
Not knocking it, but why reinvent the wheel when you can just use John to output the combos etc assuming most people will want a local wordlist for a local copy of whatever passes they're working on? BTW, have you worked out the filesize some of those brute force files will be? That's why most are generated on the fly...

I don't do PHP, but if I was doing this I'd just use the Ascii values of all printable characters and cycle through them in loops to generate all the possible combination - probably horribly inefficient but wouldn't take long to whizz through.

Edit - looks like it's the Chr(x) function in PHP, so as 97-122 = a-z, 65-90 = A-Z etc, you can just specify ranges for each subset of printable characters then use your loops to go through them as needed...

http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters

ty moose, i know im making it harder on my self but its just something i want to do so i can say i did it plus i rather use my own code when i can



< ?
$a = 'RTFM';
$b = 'STFU';
echo $a.' & '.$b;
?>
Post #14359
Posted Saturday, April 19, 2008 11:42 AM


Progenic Crew

Progenic Crew

Group: Administrators
Last Login: Today @ 3:16 PM
Posts: 904, Visits: 5,302
You're one of those people who would use their own encryption `algorithm` in a system aren't you ?
Post #14360
Posted Saturday, April 19, 2008 11:56 AM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Today @ 10:19 AM
Posts: 344, Visits: 2,230
wax (4/19/2008)
You're one of those people who would use their own encryption`algorithm` in a system aren't you ?

well i wouldnt go that far lol

< ?
$a = 'RTFM';
$b = 'STFU';
echo $a.' & '.$b;
?>
Post #14361
Posted Saturday, April 19, 2008 12:51 PM
Progenic Family

Progenic Family

Group: Old Skool
Last Login: Thursday, September 11, 2008 3:31 PM
Posts: 159, Visits: 1,093
Anarchy Angel (4/19/2008)
ty moose, i know im making it harder on my self but its just something i want to do so i can say i did it plus i rather use my own code when i can

Cool, well that Chr stuff will do it easily enough - but make sure you have a bit of space free on your server before you let the public loose on it It's Saturday and I've had a few beers but by my reckoning, if someone requests a-z in 8 chars you'll have a 195gb file on your server (eventually!) for them to DL or A-Z and a-z in 8 chars, 48tb but then I start thinking I've carried one too many zeroes somewhere...
Post #14362
Posted Saturday, April 19, 2008 2:07 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Today @ 10:19 AM
Posts: 344, Visits: 2,230
anonymoose (4/19/2008)
Anarchy Angel (4/19/2008)
ty moose, i know im making it harder on my self but its just something i want to do so i can say i did it plus i rather use my own code when i can

Cool, well that Chr stuff will do it easily enough - but make sure you have a bit of space free on your server before you let the public loose on it It's Saturday and I've had a few beers but by my reckoning, if someone requests a-z in 8 chars you'll have a 195gb file on your server (eventually!) for them to DL or A-Z and a-z in 8 chars, 48tb but then I start thinking I've carried one too many zeroes somewhere...

well it wouldnt be going on my site, its more for ppl to run on their servers and once i get it down i may take out the write to file function and add it to a pw strength tester "AKA pw cracker" but i try to use my powers for good so i call it a pw strength tester :p

< ?
$a = 'RTFM';
$b = 'STFU';
echo $a.' & '.$b;
?>
Post #14363
Posted Friday, May 02, 2008 2:45 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Yesterday @ 12:39 PM
Posts: 203, Visits: 335
wax (4/19/2008)
You're one of those people who would use their own encryption`algorithm` in a system aren't you ?

I actually encrypt my bank-login stuffs, with an encryption I wrote xD
hahaha soo f-lame
just for fun really

/Andy
Post #14435
Posted Friday, May 02, 2008 4:03 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: Today @ 9:25 AM
Posts: 335, Visits: 1,963
andy (5/2/2008)
I actually encrypt my bank-login stuffs, with an encryption I wrote xD
hahaha soo f-lame
just for fun really

Give me the encrypted data and I'll test your algorithm for you
Post #14436
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: proge, wax

All times are GMT -6:00, Time now is 10:49pm

Progenic BBS 2008
Execution: 0.156. 7 queries. Compression Enabled.