Giter Site home page Giter Site logo

tp7309 / ttpassgen Goto Github PK

View Code? Open in Web Editor NEW
142.0 4.0 25.0 12.43 MB

密码生成 flexible and scriptable password dictionary generator which can support brute-force、combination、complex rule mode etc...

License: Apache License 2.0

Python 100.00%
password-generator password-dictionaries wordlist-generator brute-force crunch password wordlist hashcat word generator

ttpassgen's Introduction

TTPassGen

build codecov DeepSource Rawsec's CyberSecurity Inventory BlackArch package

TTPassGen is a highly flexible and scriptable password dictionary generator base on Python, you can easily use various rules to generate the desired combination of words.

README i18n: 中文说明

Features

  • generate password use combination、permulation、conditional rules and so on.
  • support all characters or words(from wordlist option) that can make up a password, some built-in charset has been provided, such as lowercase letter list and numeric list.
  • you can specify the order and frequency of each element in the password.
  • simple rule format, and easy to use, rule could be defined similar regex's style.
  • time-consuming estimate, output size estimate, and progress report.
  • unicode word support by using wordlist option.
  • generation of large amount of passwords at once, no output size limit.
  • support split output by file size.

Install

TTPassGen can be easily installed using pip:

pip install ttpassgen

Requirements

Python 3.5 or later. if you are using windows, you could just use the release version, no need python environment.

Quick Start

Switch to the project's ttpassgen directory if you want use ttpassgen by downloaded source code.

Example: Generate word list and output to out.txt, the word start with numbers, only allow 1、2、3, appear 2 or 3 times, end with xyz.

ttpassgen -r '[123]{2:3}xyz' out.txt

Done.

Options

C:\Users\tp730>ttpassgen --help
Usage: ttpassgen [OPTIONS] OUTPUT
Options:
  -m, --mode INTEGER             generation mode:

                                 0 = combination rule mode
                                 [default: 0]
  -d, --dictlist TEXT            read wordlist from the file, multi files
                                 should by seperated by comma.
  -r, --rule TEXT                define word format, $0 means refer first
                                 file in dictlist option, some built-in char arrays:

                                 ?l = abcdefghijklmnopqrstuvwxyz
                                 ?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ
                                 ?d = 0123456789
                                 ?s = !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
                                 ?a = ?l?u?d?s
                                 ?q = ]

                                 example: [?dA]{1:2}$0
                                 view *RuleTypes* section for more information.
                                 [default: '']
  -c, --dict_cache INTEGER       each element in 'dictlist' option represents
                                 a dict file path, this option define the
                                 maximum amount of memory(MB) that can be used,
                                 increasing this value when the file is large
                                 may increase the build speed.  [default: 500]
  -g, --global_repeat_mode TEXT  global repeat mode, the value is used when the repeat mode of rule is not specified:

                                 ? = 0 or 1 repetitions
                                 * = 0 or more repetitions
                                 [default: ?]
  -p, --part_size INTEGER        when result data is huge, split package
                                 size(MB) will be applied, 0 is unlimited.
                                 [default: 0]
  -a, --append_mode INTEGER      whether append content to OUTPUT or not.
                                 [default: 0]
  -s, --seperator TEXT           wword seperator for output file, by default, Mac/Linudx: \n, Windows: \r\n".
                                 [default: Mac/Linux: \n, Windows: \r\n]
  --inencoding TEXT              dict file encoding.
  --outencoding TEXT             output file encoding.  [default: utf-8]
  --help                         Show this message and exit.

The output file uses utf-8 encoding by default, it is recommended to use Notepad++ to open this file.

RuleTypes

TTPassGen supports three rule type, which can specified with the --rule option, you can use these rules at the same time.

CharArrayRule

Generate a word based on the defined char array and repeat information. Rule format:

[]{min_repeat:max_repeat:repeat_mode}

CharArray

Use [] to wrap all chars.

Built-in char arrays:

//lowercase letters
?l = abcdefghijklmnopqrstuvwxyz

//Uppercase letters
?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ

//Number list
?d = 0123456789

//Special character list
?s = !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

//A collection of the above list
?a = ?l?u?d?s

//']', chars are wrapped with '[]', so if what put ']' into '[]', use '?q' instead of ']'.
?q = ]

For example, [?d] means to select char from number list.

RepeatFormat

{min_repeat:max_repeat:repeat_mode}

For CharArrayRule, repeat times is the length of the word to be generated.

  • min_repeat minimum repeat times
  • max_repeat maximum repeat times
  • repeat_mode char repeat mode

Define rule similar regex's style:

[] 1 repetitions. [123] -> 1 2 3

[]? 0 or 1 repetitions. [123]? -> '' 1 2 3

[]{m:n:r} repeat m to n times. Repeat mode support ? and *.

  • repeatMode is '?', each char appears 0 or 1 times in word.

    [123]{1:2:?} -> 1 2 3 12 13 21 23 31 32

  • repeatMode is '*', each char appears 0 or more times in word.

    [123]{1:2:*} -> 1 2 3 11 12 13 21 22 23 31 32 33

Short rule format:

  • []{m:n}

    same as []{m:n:global_repeat_mode}

  • []{n}

    same as []{n:n:global_repeat_mode}

  • []{n:r}

    same as []{n:n:r}

Example

Generate 8-digit numeric password:

[?d]{8:8:*} or [?d]{8:*} or [1234567890]{8:8:*}

Generate an 8-digit numeric password, and each char in the password can appear at most once. Because the default value of global repeat mode is '?', so you can skip set repeat_mode:

[?d]{8:8:?} or [?d]{8}

Generate a password of 7 to 8 digits in length. The word can be composed of upper and lower case letters, numbers, and _:

[?l?u?d_]{7:8:*}

Use characters 1, 2, and 3 to generate a 4-digit password, and each character can appear at most once in each word:

[123]{4}  //Error! the length of word cannot be greater than the char array size.
[123]{2}[123]{2}  //Correct.

StringArrayRule

Generate a word based on the defined string array and repeat information. Rule format:

  • $(string1,string2){min_repeat:max_repeat:repeat_mode}

    String array, each string is splited by comma, no spaces.

  • string

    Normal string, same as $(string){1:1:?}.

Like CharArrayRule, but StringArrayRule does not support Short rule format.

Example

Generate an 8-digit numeric password, end with abc:

[?d]{8:8:*}abc

Choose a number from (10,20,30), then append it after 'age':

age$(10,20,30){1:1:?}

Choose a number from (10,20,30), then append it after 'age', end with 'x' or 'y':

age$(10,20,30){1:1:?}[xy]

DictRule

Read string from file(txt file). The dictionary file path can be specified by the --dictlist option. For example,$0 means to refer 0th dictionary file.

Rule format:

$index

DictRule not support repeat mode.

Example

content of in.txt:

ab
cd

content of in2.txt:

12
34

When --dictlist option defined as in.txt,in2.txt and seperator is one space, run following command:

- IMPORTANT
# use single quotes
ttpassgen --dictlist "in.txt,in2.txt" --rule '$0[_]?$1' -s " " out.txt
# OR in bash shell
ttpassgen --dictlist "in.txt,in2.txt" --rule "\$0[_]?\$1" -s " " out.txt
# OR in Windows Command Prompt
ttpassgen --dictlist "in.txt,in2.txt" --rule "$0[_]?$1" -s " " out.txt
# OR in PowerShell
ttpassgen --dictlist "in.txt,in2.txt" --rule "`$0[_]?`$1" -s " " out.txt

Output:

ab12 ab34 ab_12 ab_34 cd12 cd34 cd_12 cd_34

Donate

Buy a cup of coffee for me (Scan by wechat):

qrcode

ttpassgen's People

Contributors

deepsource-autofix[bot] avatar deepsourcebot avatar tp7309 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ttpassgen's Issues

Error in Charmap

I'm getting an error when trying to install it on windows -
"UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 879: character maps to "

repetition mode ?

I might be dumb or something but no matter how i structure the command it seems i Cant make the repetition mode work for the life of me... wondering if its me here or what... thanks in advance for addressing it :)

Saving Generation Progress

Hello. Is it possible in this generator to start generation from the point where you left off when there is a break? Relevant when generating large dictionaries by iterating over all characters. Thank you

Error: Missing argument "output".

In Windows version the ttpassgen.exe gives an error of "ttpassgen.exe [OPTIONS] OUTPUT
Error: Missing argument "output". Could you please assist?

No module named 'click'

Getting this error.

C:>C:\Windows\py.exe C:\TTPassGen-master\ttpassgen\ttpassgen.py
Traceback (most recent call last):
File "C:\TTPassGen-master\ttpassgen\ttpassgen.py", line 6, in
import click
ModuleNotFoundError: No module named 'click'

Combine words from wordlist

Hi, I'm trying to make all possible combinations of 5 words from a list of words I have in a file.txt.
I cant manage to write a ttpassgen command that does that.
Can anyone help?
Thanks

custom wordlist command

Hi
Thanks for amazing scripts
i have problem , i want make wordlist with only 32chars and i have 8 wordlist files with an order
like 1.txt abcd , 1234 2.txt efgh ,5678 ...
how could i make output with these to give me only 32chrs with files order ?

?a is not working

use :
ttpassgen -r '[?a]{1:1:*}' out.txt

cat out.txt
?
l
?
u
?
d
?
s

Inventory notification

Your tool/software has been inventoried on Rawsec's CyberSecurity Inventory.

What is Rawsec's CyberSecurity Inventory?

An inventory of tools and resources about CyberSecurity. This inventory aims to help people to find everything related to CyberSecurity.

  • Open source: Every information is available and up to date. If an information is missing or deprecated, you are invited to (help us).
  • Practical: Content is categorized and table formatted, allowing to search, browse, sort and filter.
  • Fast: Using static and client side technologies resulting in fast browsing.
  • Rich tables: search, sort, browse, filter, clear
  • Fancy informational popups
  • Badges / Shields
  • Static API
  • Twitter bot

More details about features here.

Note: the inventory is a FLOSS (Free, Libre and Open-Source Software) project.

Why?

  • Specialized websites: Some websites are referencing tools but additional information is not available or browsable. Make additional searches take time.
  • Curated lists: Curated lists are not very exhaustive, up to date or browsable and are very topic related.
  • Search engines: Search engines sometimes does find nothing, some tools or resources are too unknown or non-referenced. These is where crowdsourcing is better than robots.

Why should you care about being inventoried?

Mainly because this is giving visibility to your tool, more and more people are using the Rawsec's CyberSecurity Inventory, this helps them find what they need.

Badges

The badge shows to your community that your are inventoried. This also shows you care about your project and want it growing, that your tool is not an abandonware.

Feel free to claim your badge here: http://inventory.rawsec.ml/features.html#badges, it looks like that Rawsec's CyberSecurity Inventory, but there are several styles available.

So what?

That's all, this message is just to notify you if you care.

--multiprocessing-fork error

im using ttpassgen_v1.0.2 windows version but when i run any command the following error will appear and hang endlessly:

C:\Users\Youness\Desktop>ttpassgen  -r [123]{2:3}[ab] ttpass.dic
mode: combination rule mode, global_repeat_mode: ?, part_size: 0 Bytes, dictlist: [], rule: [123]{2:3}[ab]
Error: no such option: --multiprocessing-fork

anyone have an idea whats cause this error ?

What is the problem

Hello, I took the .exe for w10 and at the installation a stealthy/speedy dos window appears then nothing .. just does not install.
Is there anything to do that is not mentioned for a windows user?
I will try the version that needs python to see what happens.
thanks

Example given does not work

I have two lists of words that I want to combine, as given in the last example of the post.
I'm inputting the command: ttpassgen --dictlist in.dict,in2.dict --rule $0[_]?$1 -s " " out.dict

However, the generated out.dict file is empty aside from a "_" symbol at the start.

What's the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.