-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmain.go
64 lines (58 loc) · 1.71 KB
/
main.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
55
56
57
58
59
60
61
62
63
64
package main
import (
"fmt"
"log"
)
func main() {
printBanner()
takeInput()
if len(targets) > 0 {
log.Println("Genzai is starting...")
log.Println("Loading Genzai Signatures DB...")
loadDB()
log.Println("Loading Vendor Passwords DB...")
loadVendorDB()
log.Println("Loading Vendor Vulnerabilities DB...")
loadVendorVulnsDB()
fmt.Println("\n ")
}
genzaiOutput.Targets = targets
for _, target := range targets {
fmt.Println()
log.Println("Starting the scan for", target)
product, category, tag := targetDetection(target)
if product != "" {
var targetResult genzaiResult
targetResult.Target = target
targetResult.IoTidentified = product
targetResult.Category = category
log.Println("IoT Dashboard Discovered:", product)
log.Println("Trying for default vendor-specific [", product, "] passwords...")
passIssue := vendorpassScan(target, product, tag)
if passIssue.URL != "" {
targetResult.Issues = append(targetResult.Issues, passIssue)
}
log.Println("Scanning for any known vulnerabilities from the DB related to", product)
vulnIssues := vendorvulnScan(target, product, tag)
for _, vulnIssue := range vulnIssues {
if vulnIssue.URL != "" {
targetResult.Issues = append(targetResult.Issues, vulnIssue)
}
}
genzaiOutput.Results = append(genzaiOutput.Results, targetResult)
}
}
/*
for key, entry := range genzaiDB {
fmt.Printf("Entry %s:\n", key)
fmt.Println("Matches:", entry.Matchers.Strings)
fmt.Println("Response Code:", entry.Matchers.ResponseCode)
fmt.Println("Headers:")
for headerKey, headerValue := range entry.Matchers.Headers {
fmt.Printf(" %s: %v\n", headerKey, headerValue)
}
fmt.Println()
}
*/
generateOutput()
}