forked from sensepost/gowitness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
74 lines (59 loc) 路 1.26 KB
/
options.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
65
66
67
68
69
70
71
72
73
74
package lib
import (
"os"
"github.com/rs/zerolog"
)
// Options contains all of the gowitness options
type Options struct {
// Logging
Logger *zerolog.Logger
Debug bool
DisableLogging bool
// Screenshots
ScreenshotPath string
// Generic options
Threads int
NoHTTPS bool
NoHTTP bool
ServerAddr string
// File command
File string
// Scan command
ScanCidr []string
ScanCidrFile string
ScanRandom bool
ScanPorts string
PortsSmall bool
PortsMedium bool
PortsLarge bool
// Single
ScreenshotFileName string
// Nmap
NmapFile string
NmapService []string
NmapServiceContains string
NmapPorts []int
NmapScanHostanmes bool
NmapOpenPortsOnly bool
// Report List
ReportJSON bool
ReportCSV bool
PerceptionSort bool
// Merge
MergeDBs []string
MergeSourcePath string
MergeOutputDB string
}
// NewOptions returns a new options struct
func NewOptions() *Options {
return &Options{}
}
// PrepareScreenshotPath prepares the path to save screenshots in
func (opt *Options) PrepareScreenshotPath() error {
if _, err := os.Stat(opt.ScreenshotPath); os.IsNotExist(err) {
if err = os.Mkdir(opt.ScreenshotPath, 0750); err != nil {
return err
}
}
return nil
}