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 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 != "" { if URL != "" {
urls := strings.Split(URL, ",") urls := strings.Split(URL, ",")
TmpUrls := make(map[string]struct{}) TmpUrls := make(map[string]struct{})
@ -205,13 +220,19 @@ func ParseInput(Info *HostInfo) {
fmt.Println("[-] Hash is error,len(hash) must be 32") fmt.Println("[-] Hash is error,len(hash) must be 32")
os.Exit(0) os.Exit(0)
} else { } else {
var err error Hashs = append(Hashs, Hash)
HashBytes, err = hex.DecodeString(Hash) }
Hashs = RemoveDuplicate(Hashs)
for _, hash := range Hashs {
hashbyte, err := hex.DecodeString(Hash)
if err != nil { if err != nil {
fmt.Println("[-] Hash is error,hex decode error") fmt.Println("[-] Hash is error,hex decode error ", hash)
os.Exit(0) continue
} else {
HashBytes = append(HashBytes, hashbyte)
} }
} }
Hashs = []string{}
} }
func ParseScantype(Info *HostInfo) { func ParseScantype(Info *HostInfo) {

View File

@ -103,6 +103,7 @@ var (
RedisShell string RedisShell string
Userfile string Userfile string
Passfile string Passfile string
Hashfile string
HostFile string HostFile string
PortFile string PortFile string
PocPath string PocPath string
@ -120,7 +121,8 @@ var (
LiveTop int LiveTop int
Socks5Proxy string Socks5Proxy string
Hash string Hash string
HashBytes []byte Hashs []string
HashBytes [][]byte
HostPort []string HostPort []string
IsWmi bool IsWmi bool
Noredistest bool Noredistest bool

View File

@ -38,6 +38,7 @@ func Flag(Info *HostInfo) {
flag.StringVar(&HostFile, "hf", "", "host file, -hf ip.txt") flag.StringVar(&HostFile, "hf", "", "host file, -hf ip.txt")
flag.StringVar(&Userfile, "userf", "", "username file") flag.StringVar(&Userfile, "userf", "", "username file")
flag.StringVar(&Passfile, "pwdf", "", "password file") flag.StringVar(&Passfile, "pwdf", "", "password file")
flag.StringVar(&Hashfile, "hashf", "", "hash file")
flag.StringVar(&PortFile, "portf", "", "Port File") flag.StringVar(&PortFile, "portf", "", "Port File")
flag.StringVar(&PocPath, "pocpath", "", "poc file path") flag.StringVar(&PocPath, "pocpath", "", "poc file path")
flag.StringVar(&RedisFile, "rf", "", "redis file to write sshkey file (as: -rf id_rsa.pub)") flag.StringVar(&RedisFile, "rf", "", "redis file to write sshkey file (as: -rf id_rsa.pub)")