From d01df95dba9d70294bedff042c860b595f1c2dcd Mon Sep 17 00:00:00 2001 From: shadow1ng Date: Thu, 29 Aug 2024 15:12:30 +0800 Subject: [PATCH] update --- common/Parse.go | 29 +++++++++++++++++++++++++---- common/config.go | 4 +++- common/flag.go | 1 + 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/common/Parse.go b/common/Parse.go index e2ca8a5..115edda 100644 --- a/common/Parse.go +++ b/common/Parse.go @@ -66,6 +66,21 @@ func ParsePass(Info *HostInfo) { Passwords = PwdList } } + if Hashfile != "" { + hashs, err := Readfile(Hashfile) + if err == nil { + for _, line := range hashs { + if line == "" { + continue + } + if len(line) == 32 { + Hashs = append(Hashs, line) + } else { + fmt.Println("[-] len(hash) != 32 " + line) + } + } + } + } if URL != "" { urls := strings.Split(URL, ",") TmpUrls := make(map[string]struct{}) @@ -205,13 +220,19 @@ func ParseInput(Info *HostInfo) { fmt.Println("[-] Hash is error,len(hash) must be 32") os.Exit(0) } else { - var err error - HashBytes, err = hex.DecodeString(Hash) + Hashs = append(Hashs, Hash) + } + Hashs = RemoveDuplicate(Hashs) + for _, hash := range Hashs { + hashbyte, err := hex.DecodeString(Hash) if err != nil { - fmt.Println("[-] Hash is error,hex decode error") - os.Exit(0) + fmt.Println("[-] Hash is error,hex decode error ", hash) + continue + } else { + HashBytes = append(HashBytes, hashbyte) } } + Hashs = []string{} } func ParseScantype(Info *HostInfo) { diff --git a/common/config.go b/common/config.go index c0f8b3f..e487c96 100644 --- a/common/config.go +++ b/common/config.go @@ -103,6 +103,7 @@ var ( RedisShell string Userfile string Passfile string + Hashfile string HostFile string PortFile string PocPath string @@ -120,7 +121,8 @@ var ( LiveTop int Socks5Proxy string Hash string - HashBytes []byte + Hashs []string + HashBytes [][]byte HostPort []string IsWmi bool Noredistest bool diff --git a/common/flag.go b/common/flag.go index 450e2db..571f8d4 100644 --- a/common/flag.go +++ b/common/flag.go @@ -38,6 +38,7 @@ func Flag(Info *HostInfo) { flag.StringVar(&HostFile, "hf", "", "host file, -hf ip.txt") flag.StringVar(&Userfile, "userf", "", "username file") flag.StringVar(&Passfile, "pwdf", "", "password file") + flag.StringVar(&Hashfile, "hashf", "", "hash file") flag.StringVar(&PortFile, "portf", "", "Port File") flag.StringVar(&PocPath, "pocpath", "", "poc file path") flag.StringVar(&RedisFile, "rf", "", "redis file to write sshkey file (as: -rf id_rsa.pub)")