代码拉取完成,页面将自动刷新
#!/usr/bin/env python3
# Including this to print error message if python < 3.0 is used
from __future__ import print_function
import sys
import argparse
import os
import traceback
from collections import Counter
# Local imports
from lib_princeling.banner_info import print_banner
from lib_guesser.pcfg_grammar import PcfgGrammar
from lib_princeling.wordlist_generation import create_prince_wordlist
## Main function, starts everything off
#
def generate(max_size):
# Information about this program
program_info = {
# Program and Contact Info
'name': 'PRINCE-LING',
'version': '4.1',
'author': 'Matt Weir',
'contact': 'cweir@vt.edu',
# Standard Options
'rule_name': 'Default',
'output_file': './guesses.txt',
'max_size': max_size,
# Advanced Options
'skip_case': False,
}
# Get the base directory to load all of the rules from
#
# Don't want to use the relative path since who knows where someone is
# invoking this script from
#
# Also aiming to make this OS independent/
#
base_directory = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'Rules',
program_info['rule_name']
)
## Create the grammar
#
# Note, if the ruleset can not be loaded, (for example it doesn't exist),
# it will throw an exception.
try:
print("Loading Ruleset: " + str(program_info['rule_name']), file=sys.stderr)
print('', file=sys.stderr)
pcfg = PcfgGrammar(
program_info['rule_name'],
base_directory,
program_info['version'],
base_structure_folder="Prince",
skip_case=program_info['skip_case'],
)
except Exception as msg:
print(msg)
print("Exiting")
return
# Set up the wordlist save option, either stdout or write to file
pcfg.save_to_file(program_info['output_file'])
create_prince_wordlist(pcfg, program_info['max_size'], base_directory, program_info['output_file'])
pcfg.shutdown()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。