Documentation ¶
Overview ¶
Code generated by "script/generate_lookup.go"; DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cli.Command{ Category: "Crypto", Name: "hashpwd", Usage: "A tool for query password hash offline", Commands: []*cli.Command{ &cli.Command{ Name: "generate", Aliases: []string{"g"}, Usage: "Generate password hash form password dict", Flags: []cli.Flag{ &cli.StringFlag{ Name: "filepath", Aliases: []string{"f", "file"}, Usage: "password dict file", }, &cli.StringFlag{ Name: "output", Aliases: []string{"o", "out"}, Usage: "Save password hash dict", Value: "hash.dic", }, }, Action: func(c *cli.Context) (err error) { fpath := c.String("filepath") fs, err := os.Stat(fpath) if err != nil { return errors.WithStack(err) } if fs.IsDir() { return errors.Errorf("%s is not a file", fpath) } return GenerateHashDict(fpath, c.String("output")) }, }, &cli.Command{ Name: "lookup", Aliases: []string{"l"}, Usage: "Generate password hash form password dict", Flags: []cli.Flag{ &cli.StringFlag{ Name: "dict", Aliases: []string{"f", "file"}, Usage: "password hash dict file", Value: "hash.dic", }, &cli.StringFlag{ Name: "hash", Aliases: []string{"p"}, Usage: "password hash", }, }, Action: func(c *cli.Context) (err error) { p := c.String("hash") if p == "" { return errors.Errorf("plz input password hash") } fpath := c.String("dict") fs, err := os.Stat(fpath) if err != nil { return errors.WithStack(err) } if fs.IsDir() { return errors.Errorf("%s is not a file", fpath) } pwd, err := LookupHashDict(fpath, p) if err != nil { return err } if pwd == "" { return errors.Errorf("Not found hash: %s", p) } logger.SuccessF("Found password: %s", pwd) return nil }, }, }, }
Functions ¶
func Encrypt ¶
FIXME: 多重加密使用原始数据加密,可能会有问题 golang: md5(md5(xxx)) == php: md5(md5(xxx,true)) != php: md5(md5(xxx))
func GenerateHashDict ¶
func GetPlaintext ¶
func LookupHashDict ¶
FEAT: 逐行读取文件,一次查询多个密码? 目前每查询一次密码就检索整个文件
Types ¶
type SyncWriter ¶
Click to show internal directories.
Click to hide internal directories.