1 Star 0 Fork 0

最近......的Ender/password_cracking

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
prince_ling.py 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
最近......的Ender 提交于 2021-11-05 17:24 . finished everything
#!/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()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/enderbyendera/password_cracking.git
git@gitee.com:enderbyendera/password_cracking.git
enderbyendera
password_cracking
password_cracking
master

搜索帮助