-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test in real envrionment Signed-off-by: yylt <[email protected]>
- Loading branch information
Showing
17 changed files
with
739 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ | |
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
vendor/ | ||
.idea/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,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" | ||
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"` | ||
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} | ||
sts = []string{coreAddModePath, user, pass} | ||
) | ||
err := cli.Send(sts,&retv) | ||
err := cli.Send(sts, &retv) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return retv,nil | ||
} | ||
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 | ||
} |
Oops, something went wrong.