/
types.go
31 lines (28 loc) · 1.27 KB
/
types.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
package scanners
// Hold infromation on all of our
type Credential struct {
Type string // The type of authentication we have
Account string // The account info or username
AuthData string // The password or authentication data
}
// Each type of scanner must implement this interface to be compatible.
type Scanner interface {
// Name should be the string used to uniqely identify each of the scanners within the system for our code and on the CLI as a parameter for the user.
Name() string
// Description is the string that will describe this to users
Description() string
// A way to return to the users what types of authentication we support
SupportedAuthentication() []string
// Examples of each authentication type should look like
SupportedAuthenticationExample() map[string]string
// Actually perform a scan. Will be run in a go-routine
Scan(target, exec string, cred Credential, out chan Result)
}
// A struct to hold our results before we output them
type Result struct {
Host string //The string used to connect to the host
Auth Credential //What we used to authenticate to the target
Message string //The output message received
Output string //The output of the command run, if any
Status bool //Whether we were successful or failed
}