【小组作业】Userdictionary maker 文档说明

  • 2019 年 10 月 7 日
  • 筆記

本文作者:超级小菜鸡(Ms08067实验室Python渗透小组成员)

简介

这是一个基于python3开发的字典生成器。构想是依据国人的习惯生成一份字典,目前由于本人太菜,还找不到一个良好的方法来生成,文件读写也是个大问题。

版本

初版V 0.0.1

这个版本, 怎么说呢, 我自己写的都有点晕,不过相较于分支"master", "dict-v1","dict-v2"来讲, 这个是写成的一版!

主要是前两版没想好, 导致写的时候…Duang了…

本版的用法

帮助文档中这样写:

 cmd.__doc__ = r”””
               usage:
    -h          ----            (same as option [--help])
        [--help]            show help info.
    -n          ----            (same as [--name=])
        [--name=]           target name input.
    -d          ----            (same as option [--date=])
        [--short-date]      password with short date. (e.g. 1231 ( 31st Dec. ))
        [--middle-date]     password with middle date. (e.g. 001231 ( 31st Dec. 2000 ))
        [--long-date]       password with long date. (e.g. 200001231 ( 31st Dec. 2000 ))
        [--date=]           input target date. (e.g. 2000-12-31 (format must YYYY-MM-DD) )
        [--year=]           when target date is unknown, use this arg can generate the whole date of this year.
    -f          ----            (same as option [--force])
        [--force]           force to write an existed (or not) file.
    -c          ----            (same as option [--default-chars])
        [--default-chars]   generate password with default characters. '.'
        [--specify-chars=]  generate password with specified characters.
        [--none-chars]      generate password with none character.
    -p          ----            (same as option [--weak-passwd])
        [--weak-passwd]     generate password with weak password.
“””

大致是这样:

  • -h, --help : 用于显示帮助界面
  • -n, --name= : 用于输入目标姓名, 单字用'-'分隔, 姓和名用'–'分隔, 如"zhang-sun–wu-ji"
  • -d, --date= : 用于输入日期, 精确到具体天, 如"1900-01-01"
  • -f, --force : 用于字典存在时, 强制覆盖字典
  • -c, --default-chars : 用于使用默认的字符, '.'
  • -p, --weak-passwd : 用于添加TOP100 弱口令
  • --short-date : 用于生成短日期, 如'0101'
  • --middle-date : 用于生成中等日期, 如'000101'
  • --long-date : 用于生成长日期, 如'19000101'
  • --year= : 用于接收年份, 当目标生日未知时, 启用此选项会更方便一点, 如'1900'
  • --specify-chars= : 用于接收自定义密码符号集, 如'.,/'
  • --none-chars : 用于生成字典时, 不使用符号

emmm, 本人还是很菜, 也没啥开发经验, 总之也只能凑合着看了哈哈!如果有影响使用的bug,可以给我发邮件。

邮箱地址:[email protected]

使用说明

Windows版

1. 配置好Python 3 (添加到PATH环境变量中, 确保CMD可以直接调用Python 3)

2. cd到目录中, 如果有安装git, 可以使用命令:

(1) git clone -b dict-v3

https://gitee.com/Happy-Rabbit/user-dict-maker.git

3. 进入文件夹中, 按住<Shift>加鼠标右键, 单击”在此处打开命令行/powershell窗口”

4. 输入:

(1) 输入”python -V”检测下是否是Python3.*

① 是: -> (5)

② 否: -> (2)

(2) 去Python官网(或者腾讯软件管家)下载Python3

(3) 安装时选择添加到PATH,安装

(4) 安装完成后, 查看版本

① 是: Python3.* -> (5)

② 否: 将PATH里的顺序调到上面(具体请自行百度)

(5) 控制台输入: “python main.py -h”查看帮助

(6) 根据帮助信息进行操作

5. 完成

Linux / macOS

1. 输入 sudo <包管理器> install python3 git

2. 输入python3 -V

3. 如果自己经常使用Python3

(1) vim $HOME/.bashrc

(2) 添加 alias python=”python3”到最下面空白行

(3) source $HOME/.bashrc

4. 输入

(1) git clone -b dict-v3

https://gitee.com/Happy-Rabbit/user-dict-maker.git

5. 此时进入当前目录下的user-dict-maker文件夹

6. 输入python3main.py -h查看命令帮助

7. 完成

示例

(gitclone 操作)

输入: git clone -bhttps://gitee.com/Happy-Rabbit/user-dict-maker.git

(显示帮助信息)

输入: python3 main.py -h

(姓名+日期+长日期+中等日期)

输入: python3 main.py -n”x--x-x” -d “yyyy-mm-dd”--long-date --middle-date

(年份+姓名+强制替换)

输入: python3 main.py --name=”x--x-x” --year=YYYY--force

代码网址:

https://gitee.com/Happy-Rabbit/user-dict-maker/tree/dict-v3/