This commit is contained in:
shadow1ng 2024-08-29 15:12:30 +08:00
parent 513bb93e1b
commit d01df95dba
3 changed files with 29 additions and 5 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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)")