#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Exclamation Password Dictionary


    Hello Everyone,

    I am fairly new to Python and have dabbled in various forms of programming in the past. By dabbled, I mean I am a total noob.

    I am trying to create an extensive password dictionary, and none of the resources that I can find online work! I would prefer to make the dictionary in Windows 7 using Python 3.3.1, and this is what I am looking for:

    Minimum Length of 4
    Maximum Length of 25
    An Alphabet of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()"
    Unlimited number of passwords

    I would want it to export the passwords to a .txt file, and I would want it to check the size of the file after a certain amount of password to make sure it isn't too large to open, possibly after every 10000 passwords, and create a new .txt file after 100mb?

    As a new user I can not post URLs, but if you search on Google for "python password dictionary", I have tried every option on the first few pages of search results.

    For each of these, I had copied them to a .txt file, and then saved it as a .py file. Upon saving it as a python file, I would double click the file, it would open up the Python terminal momentarily, then immediately close it. I let it sit for a few hours, ctrl+alt+del to make sure Python wasn't operating in the background creating my dictionary, and it was not. I also attempted to run these files in the terminal in Ubuntu, and it would appear as though it was working, but if I clicked on the new terminal it opened, that terminal would close and I would be left without a dictionary.

    I feel as though this is asking for a lot, so any help would be greatly appreciated!!!!

    -Cyrex
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    29
    Rep Power
    0
    My guess from what I just read is that you just started using python. The problem is that you're not opening files correctly. Python scripts can't be opened by double clicking or opening them in the terminal like other files, basically, what you need to do is open your terminal and, with python installed, type python script.py.
    On the other hand, I wouldn't recommend doing larger projects like this until you are confident with your language of choice. Search for Python tutorials, there's plenty of them online.

    I'll look into this later today in case you decide to stick with it.

    Good luck
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,901
    Rep Power
    481
    If, after following Lucantrop's advice, demonstrating to yourself that you can use python and the tutorials make sense, you need to post a web site you can

    www dot somewhere dot com /path


    However, I followed your google search instructions and the code from the one web site I tried did not work.
    [code]Code tags[/code] are essential for python code and Makefiles!
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    29
    Rep Power
    0
    Code:
    import random
    
    out = open('pwds_test.txt', 'w')
    
    abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()'
    
    pwd = ''
    for i in range(0, 10):
        for j in random.sample(abc, random.randint(4, 25)):
            pwd += j
        out.write(pwd+'\n')
        pwd = ''
    This should work.
    Now find a way to check the filesize every time it loops and make it into an infinite loop, but srsly tho, that 'unlimited number of passwords' is only ever going to work if you have like 17 bazillion terabytes of free hdd space. You should probably just choose a number and leave it at that.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0
    Lucantrop,

    That code is working like a charm, and it actually does work by double clicking it in Windows 7. As for how to make multiple files, I am clueless, but I saw a few sites talking about this, so I'll check them out in a bit. Currently it is time to let this run. I did a test with 10 phrases. Then 50,000 phrases (808kb file size), and now 1,000,000 phrases (15.7mb).

    I did a good ole' ctrl-F to search for common words, names, months, etc, including words that I know are part of my passwords, and very few to none even came up. I'll have to experiment with multiple "alphabets" to see if I can get more words, and also experiment with the size of the phrases. I might be better off making enormous files for different sizes (eg. 4 symbols, then 5, and so on).

    I am going to let it run while I go to the movies, aiming for 1 trillion phrases. I'll update you on the progress once it is done!

    Thank you so much for your help!!!

    -CyrexNZ
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    29
    Rep Power
    0
    The reason there's no real words in it, dates and stuff is because of:
    Code:
    for j in random.sample(abc, random.randint(4, 25)):
    it loops through characters of a randomized string from a string of characters 4-25 characters long(also randomized).

IMN logo majestic logo threadwatch logo seochat tools logo