def do_help(self, key): if key in help_dict: print(cool.yellow(help_dict[key])) elif key == 'desc': for k in help_dict.keys(): print(cool.yellow(help_dict[k])) else: self.do_cls('') print(cool.green(pydictor_art_text)) print(helpmsg)
def parse_args(): parser = argparse.ArgumentParser( prog='pydictor', formatter_class=argparse.RawTextHelpFormatter, description=cool.green( '*[+] A Useful Hacker Dictionary Builder. [+]*') + pyoptions.CRLF + cool.green(' [+] Build by LandGrey email:[email protected]') + pyoptions.CRLF, usage=cool.orange(''' pydictor.py [options] -base [type] -char [custom_char] -chunk [chunk1] [chunk2] ... -extend [string_or_file] -plug [{plugin}] --conf [expression_or_file] --sedb -o,--output [directory] -tool [{tool}] --len [minlen] [maxlen] --head [prefix_string] --tail [suffix_string] --encode [{encode}] --occur [letter] [digital] [special] --types [letter] [digital] [special] --repeat [letter] [digital] [special] --regex [regex] --level [code] --leet [code] --dmy'''.format(plugin=",".join(pyoptions.plug_range), encode=",".join(pyoptions.encode_range), tool=",".join(pyoptions.tool_range)))) parser.add_argument( '-base', dest='base', choices=[ pystrs.base_dic_type[0], pystrs.base_dic_type[1], pystrs.base_dic_type[2], pystrs.base_dic_type[3], pystrs.base_dic_type[4], pystrs.base_dic_type[5], pystrs.base_dic_type[6] ], metavar='Type', default='', help=cool.yellow('''Choose from ({0}, {1}, {2}, {3}, {4}, {5}, {6}) {0} digital [0 - 9] {1} lowercase letters [a - z] {2} capital letters [A - Z] {3} Mix {0} and {1} [0-9 a-z] {4} Mix {0} and {2} [0-9 A-Z] {5} Mix {1} and {2} [a-z A-Z] {6} Mix {0}, {1} and {3} [0-9 a-z A-Z]'''.format( pystrs.base_dic_type[0], pystrs.base_dic_type[1], pystrs.base_dic_type[2], pystrs.base_dic_type[3], pystrs.base_dic_type[4], pystrs.base_dic_type[5], pystrs.base_dic_type[6]))) parser.add_argument( '-char', dest='char', metavar='character', default='', help=cool.yellow('Use Custom Character build the dictionary')) parser.add_argument( '-chunk', dest='chunk', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('Use the multi-chunk build the dictionary')) parser.add_argument('-extend', dest='extend', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('Extend the string list or file')) parser.add_argument('-plug', dest='plug', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('''{plugins_desc}'''.format( plugins_desc=pyoptions.plugins_desc))) parser.add_argument( '--conf', dest='conf', nargs='?', metavar='file_path', default='default', const='const', help=cool.yellow( "Use the configuration string or file build the dictionary")) parser.add_argument( '--sedb', dest='sedb', default='', action="store_true", help=cool.yellow('Enter the Social Engineering Dictionary Builder')) parser.add_argument('-o', '--output', dest='output', metavar='path', type=str, default=paths.results_path, help=cool.yellow('''Set the output directory path default: %s''' % paths.results_path)) parser.add_argument('-tool', dest='tool', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('''{tools_desc}'''.format( tools_desc=pyoptions.tools_desc))) parser.add_argument('--len', dest='len', metavar=('minlen', 'maxlen'), nargs=2, type=int, default=(pyoptions.minlen, pyoptions.maxlen), help=cool.yellow('''Default: min=%s max=%s''' % (pyoptions.minlen, pyoptions.maxlen))) parser.add_argument('--head', dest='head', metavar='prefix', type=str, default='', help=cool.yellow('Add string head for the items')) parser.add_argument('--tail', dest='tail', metavar='suffix', type=str, default='', help=cool.yellow('Add string tail for the items')) parser.add_argument('--encode', dest='encode', metavar='encode', default='none', choices=pyoptions.encode_range, help=cool.yellow('''{encode_desc}'''.format( encode_desc=pyoptions.encode_desc))) parser.add_argument( '--occur', dest='occur', metavar=('letter', 'digital', 'special'), nargs=3, type=str, default=(pyoptions.letter_occur, pyoptions.digital_occur, pyoptions.special_occur), help=cool.yellow('''Default: letter "%s" digital "%s" special "%s"''' % (pyoptions.letter_occur, pyoptions.digital_occur, pyoptions.special_occur))) parser.add_argument( '--types', dest='types', metavar=('letter', 'digital', 'special'), nargs=3, type=str, default=(pyoptions.letter_types, pyoptions.digital_types, pyoptions.special_types), help=cool.yellow( '''Default: letter "%s" digital "%s" special "%s"''' % (pyoptions.letter_types, pyoptions.digital_types, pyoptions.special_types))) parser.add_argument( '--repeat', dest='repeat', metavar=('letter', 'digital', 'special'), nargs=3, type=str, default=(pyoptions.letter_repeat, pyoptions.digital_repeat, pyoptions.special_repeat), help=cool.yellow( '''Default: letter "%s" digital "%s" special "%s"''' % (pyoptions.letter_repeat, pyoptions.digital_repeat, pyoptions.special_repeat))) parser.add_argument('--regex', dest='regex', metavar='regex', nargs=1, type=str, default=pyoptions.filter_regex, help=cool.yellow('''Filter by regex, Default: (%s)''' % pyoptions.filter_regex)) parser.add_argument( '--level', dest='level', metavar='code', default=pyoptions.level, type=int, help=cool.yellow( '''Use code [1-5] to filter results, default: {0}'''.format( pyoptions.level))) parser.add_argument( '--leet', dest='leet', metavar='code', nargs='+', type=int, default=pyoptions.leetmode_code, help=cool.yellow('Choose leet mode code (0, 1, 2, 11-19, 21-29)')) parser.add_argument( '--more', dest='more', default='', action="store_true", help=cool.yellow( 'Append more simple word list to extend function results, default: false' )) parser.add_argument( '--dmy', dest='dmy', default='', action="store_true", help=cool.yellow( 'Use ddMMyyyy format date, default date format: yyyyMMdd')) if len(sys.argv) == 1: sys.argv.append('-h') args = parser.parse_args() check_args(args) return args
{1} ----------------------------[ {2} ]--------------------------- [+]help desc [+]exit/quit [+]clear/cls [+]show option [+]set option arguments [+]rm option [+]len minlen maxlen [+]head prefix [+]tail suffix [+]encode type [+]occur L d s [+]types L d s [+]repeat L d s [+]regex string [+]level code [+]leet code [+]output directory [+]run ----------------------------[ {3} ]---------------------------- [+]{4} [+]{5} [+]{6} [+]{7} [+]{8} [+]{9} [+]{10} [+]{11} [+]{12} [+]{13} [+]{14} [+]{15} [+]{16} [+]{17} [+]{18} '''.format(cool.orange("Social Engineering Dictionary Builder"), cool.green("Build by LandGrey"), cool.yellow("command") , cool.yellow("option"), pystrs.sedb_range[0], pystrs.sedb_range[1], pystrs.sedb_range[2], pystrs.sedb_range[3], pystrs.sedb_range[4], pystrs.sedb_range[5], pystrs.sedb_range[6], pystrs.sedb_range[7], pystrs.sedb_range[8], pystrs.sedb_range[9], pystrs.sedb_range[10], pystrs.sedb_range[11], pystrs.sedb_range[12], pystrs.sedb_range[13], pystrs.sedb_range[14], ) help_dict = OrderedDict([ # settings help message (pystrs.sedb_range[0], " {:10} Chinese name's phonetic 中文名拼音全拼".format( pystrs.sedb_range[0])), (pystrs.sedb_range[1], " {:10} English name 英文名".format( pystrs.sedb_range[1])), (pystrs.sedb_range[2], " {:10} Simple name spellings 姓名简拼".format(
def parse_args(): parser = argparse.ArgumentParser( prog='pydictor', formatter_class=argparse.RawTextHelpFormatter, description=cool.green( '*[+] A Useful Hacker Dictionary Builder. [+]*') + pyoptions.CRLF + cool.green(' [+] Build by LandGrey email:[email protected]') + pyoptions.CRLF, usage=cool.orange(''' pydictor.py [options] -base [type] -char [custom_char] -chunk [chunk1] [chunk2] ... -extend [str_or_file] -plug [{p0},{p1},{p2},{p3},{p4},{p5}] --conf [expression_or_file] --sedb -o,--output [directory] -tool [{t5},{t0},{t1},{t2},{t3},{t4}] --len [minlen] [maxlen] --head [prefix_string] --tail [suffix_string] --encode [{e0},{e1},{e2},{e3},{e4},{e5},{e6},{e7}] --occur [letter] [digital] [special] --types [letter] [digital] [special] --regex [regex] --level [code] --leet [code]'''.format(p0=pystrs.plug_range[0], p1=pystrs.plug_range[1], p2=pystrs.plug_range[2], p3=pystrs.plug_range[3], p4=pystrs.plug_range[4], p5=pystrs.plug_range[5], t0=pystrs.tool_range[0], t1=pystrs.tool_range[1], t2=pystrs.tool_range[2], t3=pystrs.tool_range[3], t4=pystrs.tool_range[4], t5=pystrs.tool_range[5], e0=pystrs.encode_range[0], e1=pystrs.encode_range[1], e2=pystrs.encode_range[2], e3=pystrs.encode_range[3], e4=pystrs.encode_range[4], e5=pystrs.encode_range[5], e6=pystrs.encode_range[6], e7=pystrs.encode_range[7]))) parser.add_argument( '-base', dest='base', choices=[ pystrs.base_dic_type[0], pystrs.base_dic_type[1], pystrs.base_dic_type[2], pystrs.base_dic_type[3], pystrs.base_dic_type[4], pystrs.base_dic_type[5], pystrs.base_dic_type[6] ], metavar='Type', default='', help=cool.yellow('''Choose from ({0}, {1}, {2}, {3}, {4}, {5}, {6}) {0} digital [0 - 9] {1} lowercase letters [a - z] {2} capital letters [A - Z] {3} Mix {0} and {1} [0-9 a-z] {4} Mix {0} and {2} [0-9 A-Z] {5} Mix {1} and {2} [a-z A-Z] {6} Mix {0}, {1} and {3} [0-9 a-z A-Z]'''.format( pystrs.base_dic_type[0], pystrs.base_dic_type[1], pystrs.base_dic_type[2], pystrs.base_dic_type[3], pystrs.base_dic_type[4], pystrs.base_dic_type[5], pystrs.base_dic_type[6]))) parser.add_argument( '-char', dest='char', metavar='character', default='', help=cool.yellow('Use Custom Character build the dictionary')) parser.add_argument( '-chunk', dest='chunk', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('Use the multi-chunk build the dictionary')) parser.add_argument('-extend', dest='extend', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('Extend the string list or file')) parser.add_argument('-plug', dest='plug', metavar='arg', nargs='+', type=str, default='', help=cool.yellow( '''Choose from ({1}, {2}, {3}, {4}, {5}, {6}) {1:10} [idcard_last_4_digit] {2:10} [idcard_last_6_digit] default sex:{0} {3:10} [idcard_last_8_digit] default sex:{0} {4:10} [url_or_file_path] {5:10} [url_or_file_path] {6:10} [YYYYMMDD] [YYYYMMDD]'''.format( pystrs.default_sex, pystrs.plug_range[0], pystrs.plug_range[1], pystrs.plug_range[2], pystrs.plug_range[3], pystrs.plug_range[4], pystrs.plug_range[5], ))) parser.add_argument('--conf', dest='conf', nargs='?', metavar='file_path', default='default', const='const', help=cool.yellow( '''Use the configuration file build the dictionary Default: %s''' % paths.buildconf_path)) parser.add_argument( '--sedb', dest='sedb', default='', action="store_true", help=cool.yellow('Enter the Social Engineering Dictionary Builder')) parser.add_argument('-o', '--output', dest='output', metavar='path', type=str, default=paths.results_path, help=cool.yellow('''Set the output directory path default: %s''' % paths.results_path)) parser.add_argument('-tool', dest='tool', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('''Choose from ({0}, {1}, {2}, {3}, {4}) {0:10} [file_or_dir] {1:10} [file_path] {2:10} ['{5}','{6}','{7}'] [file_path] [view_num] {3:10} [dir] {4:10} [dir]'''.format(pystrs.tool_range[0], pystrs.tool_range[1], pystrs.tool_range[2], pystrs.tool_range[3], pystrs.tool_range[4], pystrs.just_view_counter, pystrs.just_save_counter, pystrs.save_and_view))) parser.add_argument('--len', dest='len', metavar=('minlen', 'maxlen'), nargs=2, type=int, default=(pyoptions.minlen, pyoptions.maxlen), help=cool.yellow('''Default: min=%s max=%s''' % (pyoptions.minlen, pyoptions.maxlen))) parser.add_argument('--head', dest='head', metavar='prefix', type=str, default='', help=cool.yellow('Add string head for the items')) parser.add_argument('--tail', dest='tail', metavar='suffix', type=str, default='', help=cool.yellow('Add string tail for the items')) parser.add_argument( '--encode', dest='encode', metavar='encode', default='none', choices=[ pystrs.encode_range[0], pystrs.encode_range[1], pystrs.encode_range[2], pystrs.encode_range[3], pystrs.encode_range[4], pystrs.encode_range[5], pystrs.encode_range[6], pystrs.encode_range[7], pystrs.encode_range[8] ], help=cool.yellow( '''From ({e0}, {e1}, {e2}, {e3}, {e4}, {e5}, {e6}, {e7}, {e8})'''. format( e0=pystrs.encode_range[0], e1=pystrs.encode_range[1], e2=pystrs.encode_range[2], e3=pystrs.encode_range[3], e4=pystrs.encode_range[4], e5=pystrs.encode_range[5], e6=pystrs.encode_range[6], e7=pystrs.encode_range[7], e8=pystrs.encode_range[8], ))) parser.add_argument( '--occur', dest='occur', metavar=('letter', 'digital', 'special'), nargs=3, type=str, default=(pyoptions.letter_occur, pyoptions.digital_occur, pyoptions.special_occur), help=cool.yellow('''Default: letter "%s" digital "%s" special "%s"''' % (pyoptions.letter_occur, pyoptions.digital_occur, pyoptions.special_occur))) parser.add_argument( '--types', dest='types', metavar=('letter', 'digital', 'special'), nargs=3, type=str, default=(pyoptions.letter_types, pyoptions.digital_types, pyoptions.special_types), help=cool.yellow( '''Default: letter "%s" digital "%s" special "%s"''' % (pyoptions.letter_types, pyoptions.digital_types, pyoptions.special_types))) parser.add_argument('--regex', dest='regex', metavar='regex', nargs=1, type=str, default=pyoptions.filter_regex, help=cool.yellow('''Filter by regex, Default: (%s)''' % pyoptions.filter_regex)) parser.add_argument( '--level', dest='level', metavar='code', default=pyoptions.level, type=int, help=cool.yellow( '''Use code [1-5] to filter results, default: {0}'''.format( pyoptions.level))) parser.add_argument( '--leet', dest='leet', metavar='code', nargs='+', type=int, default=pyoptions.leetmode_code, help=cool.yellow('Choose leet mode code (0, 1, 2, 11-19, 21-29)')) if len(sys.argv) == 1: sys.argv.append('-h') args = parser.parse_args() check_args(args) return args
def parse_args(): parser = argparse.ArgumentParser( prog='pydictor', formatter_class=argparse.RawTextHelpFormatter, description=cool.green( '*[+] A Useful Hacker Dictionary Builder. [+]*') + pyoptions.CRLF + cool.green(' [+] Build by LandGrey email:[email protected]') + pyoptions.CRLF, usage=cool.orange(''' pydictor.py [options] -base [type] -char [custom_char] -chunk [chunk1] [chunk2] ... -extend [str_or_file] -plug [{plug0},{plug1},{plug2}] --conf [config_file] --sedb -o [output_path] -tool [{tool0},{tool1},{tool2},{tool3},{tool4}] [args] ... --len [minlen] [maxlen] --head [prefix_string] --tail [suffix_string] --encode [{en0},{en1},{en2},{en3},{en4},{en5},{en6},{en7}] --level [code] --leet [code]'''.format(plug0=pystrs.plug_range[0], plug1=pystrs.plug_range[1], plug2=pystrs.plug_range[2], tool0=pystrs.tool_range[0], tool1=pystrs.tool_range[1], tool2=pystrs.tool_range[2], tool3=pystrs.tool_range[3], tool4=pystrs.tool_range[4], en0=pystrs.encode_range[0], en1=pystrs.encode_range[1], en2=pystrs.encode_range[2], en3=pystrs.encode_range[3], en4=pystrs.encode_range[4], en5=pystrs.encode_range[5], en6=pystrs.encode_range[6], en7=pystrs.encode_range[7]))) parser.add_argument( '-base', dest='base', choices=[ pystrs.base_dic_type[0], pystrs.base_dic_type[1], pystrs.base_dic_type[2], pystrs.base_dic_type[3], pystrs.base_dic_type[4], pystrs.base_dic_type[5], pystrs.base_dic_type[6] ], metavar='Type', default='', help=cool.yellow('''Choose from ({0}, {1}, {2}, {3}, {4}, {5}, {6}) {0} digital [0 - 9] {1} lowercase letters [a - z] {2} capital letters [A - Z] {3} Mix {0} and {1} [0-9 a-z] {4} Mix {0} and {2} [0-9 A-Z] {5} Mix {1} and {2} [a-z A-Z] {6} Mix {0}, {1} and {3} [0-9 a-z A-Z]'''.format( pystrs.base_dic_type[0], pystrs.base_dic_type[1], pystrs.base_dic_type[2], pystrs.base_dic_type[3], pystrs.base_dic_type[4], pystrs.base_dic_type[5], pystrs.base_dic_type[6]))) parser.add_argument( '-char', dest='char', metavar='character', default='', help=cool.yellow('Use Custom Character build the dictionary')) parser.add_argument( '-chunk', dest='chunk', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('Use the multi-chunk build the dictionary')) parser.add_argument('-extend', dest='extend', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('Extend the string list or file')) parser.add_argument('-plug', dest='plug', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('''Choose from ({0}, {1}, {2}, {3}) {0:10} [idcard_last_6_digit] default sex:{3} {1:10} [idcard_last_8_digit] default sex:{3} {2:10} [url_or_file_path]'''.format(pystrs.plug_range[0], pystrs.plug_range[1], pystrs.plug_range[2], pystrs.default_sex))) parser.add_argument('--conf', dest='conf', nargs='?', metavar='file_path', default='default', const='const', help=cool.yellow( '''Use the configuration file build the dictionary Default: %s''' % paths.buildconf_path)) parser.add_argument( '--sedb', dest='sedb', default='', action="store_true", help=cool.yellow('Enter the Social Engineering Dictionary Builder')) parser.add_argument('-o', '-output', dest='output', metavar='path', type=str, default=paths.results_path, help=cool.yellow('''Set the output directory path default: %s''' % paths.results_path)) parser.add_argument('-tool', dest='tool', metavar='arg', nargs='+', type=str, default='', help=cool.yellow('''Choose from ({0}, {1}, {2}, {3}, {4}) {0:10} [file_or_dir] {1:10} [file_path] {2:10} ['{5}','{6}','{7}'] [file_path] [view_num] {3:10} [dir] {4:10} [dir]'''.format(pystrs.tool_range[0], pystrs.tool_range[1], pystrs.tool_range[2], pystrs.tool_range[3], pystrs.tool_range[4], pystrs.just_view_counter, pystrs.just_save_counter, pystrs.save_and_view))) parser.add_argument('--len', dest='len', metavar=('minlen', 'maxlen'), nargs=2, type=int, default=(pyoptions.minlen, pyoptions.maxlen), help=cool.yellow('''[Minimun_Length] [Maximun_Length] Default: min=%s max=%s''' % (pyoptions.minlen, pyoptions.maxlen))) parser.add_argument('--head', dest='head', metavar='prefix', type=str, default='', help=cool.yellow('Add string head for the items')) parser.add_argument('--tail', dest='tail', metavar='suffix', type=str, default='', help=cool.yellow('Add string tail for the items')) parser.add_argument( '--encode', dest='encode', metavar='encode', default='none', choices=[ pystrs.encode_range[0], pystrs.encode_range[1], pystrs.encode_range[2], pystrs.encode_range[3], pystrs.encode_range[4], pystrs.encode_range[5], pystrs.encode_range[6], pystrs.encode_range[7] ], help=cool.yellow('''From (%s, %s, %s, %s, %s, %s, %s, %s)''' % (pystrs.encode_range[0], pystrs.encode_range[1], pystrs.encode_range[2], pystrs.encode_range[3], pystrs.encode_range[4], pystrs.encode_range[5], pystrs.encode_range[6], pystrs.encode_range[7]))) parser.add_argument( '--level', dest='level', metavar='code', default=pyoptions.level, type=int, help=cool.yellow( '''Use code [1-5] to filter results, default: {0}'''.format( pyoptions.level))) parser.add_argument( '--leet', dest='leet', metavar='code', nargs='+', type=int, default=pyoptions.leetmode_code, help=cool.yellow('Choose leet mode code (0, 1, 2, 11-19, 21-29)')) if len(sys.argv) == 1: sys.argv.append('-h') args = parser.parse_args() check_args(args) return args