-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.go
63 lines (56 loc) · 1.26 KB
/
core.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
package gomsf
//TODO
const (
coreAddModePath = "core.add_module_path"
coreModeStat = "core.module_stats"
coreReloadMode = "core.reload_modules"
coreSave = "core.save"
coreVersion = "core.version"
coreStop = "core.stop"
)
type ModuleInfo struct {
Exploits string `msgpack:"exploits"`
Auxs string `msgpack:"auxiliary"`
Posts string `msgpack:"post"`
Encoders string `msgpack:"encoders"`
Nops string `msgpack:"nops"`
Payloads string `msgpack:"payloads"`
}
type VersionInfo struct {
Version string `msgpack:"version"`
Ruby string `msgpack:"ruby"`
Api string `msgpack:"api"`
}
func AddModulePath(cli MsfCli, user, pass string) (*ModuleInfo, error) {
var (
retv *ModuleInfo
sts = []string{coreAddModePath, user, pass}
)
err := cli.Send(sts, &retv)
if err != nil {
return nil, err
}
return retv, nil
}
func Version(cli MsfCli, token string) (*VersionInfo, error) {
var (
retv *VersionInfo
sts = []string{coreVersion, token}
)
err := cli.Send(sts, &retv)
if err != nil {
return nil, err
}
return retv, nil
}
func Stop(cli MsfCli, token string) (*Generic, error) {
var (
retv *Generic
sts = []string{coreStop, token}
)
err := cli.Send(sts, &retv)
if err != nil {
return nil, err
}
return retv, nil
}