/
hashkill.go
54 lines (41 loc) · 1.18 KB
/
hashkill.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package cmd
import (
"sync"
"fmt"
"log"
"os"
"github.com/z3oxs/hashkill/utils"
"github.com/spf13/cobra"
)
var wg sync.WaitGroup
var l = log.New(os.Stdout, "", 0)
func Hashkill(c *cobra.Command, args []string) {
algo, _ := c.Flags().GetString("algo")
hashtype, _ := c.Flags().GetBool("hashtype")
wordlist, _ := c.Flags().GetString("wordlist")
version, _ := c.Flags().GetBool("version")
hashedwl, _ := c.Flags().GetString("name")
file, _ := c.Flags().GetString("file")
hash, _ := c.Flags().GetString("hash")
createM, _ := c.Flags().GetBool("create")
crackM, _ := c.Flags().GetBool("crack")
if hashtype {
utils.Hashtype()
return
}
if version {
fmt.Println("\033[1;32m[🗸]\033[m v0.1.4 (03/31/2022)")
return
}
if createM {
utils.Banner("Create", algo, hashedwl, wordlist, file, hash)
create(algo, wordlist, hashedwl)
} else if crackM {
utils.Banner("Crack", algo, "", wordlist, file, hash)
if file != "" {
crack(algo, wordlist, file, "file")
} else {
crack(algo, wordlist, hash, "hash")
}
}
}