forked from xiecat/wsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.go
59 lines (50 loc) · 1.15 KB
/
shell.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
package wsm
import (
"errors"
"github.com/go0p/wsm/lib/httpx"
"github.com/go0p/wsm/lib/shell"
)
type BaseShell struct {
// 连接地址
Url string
// 连接参数
Password string
// shell 类型
Script shell.ScriptType
Proxy string
// 自定义 header 头
Headers map[string]string
Client *httpx.ReqClient
}
func (b *BaseShell) Verify() error {
if len(b.Url) == 0 {
return errors.New("url is empty")
}
if len(b.Password) == 0 {
return errors.New("password is empty")
}
if len(b.Script) == 0 {
return errors.New("script is empty")
}
return nil
}
func (b BaseShell) Ping(p ...shell.IParams) (bool, error) {
//TODO implement me
panic("implement me")
}
func (b BaseShell) BasicInfo(p ...shell.IParams) (shell.IResult, error) {
//TODO implement me
panic("implement me")
}
func (b BaseShell) CommandExec(p shell.IParams) (shell.IResult, error) {
//TODO implement me
panic("implement me")
}
func (b BaseShell) FileManagement(p shell.IParams) (shell.IResult, error) {
//TODO implement me
panic("implement me")
}
func (b BaseShell) DatabaseManagement(p shell.IParams) (shell.IResult, error) {
//TODO implement me
panic("implement me")
}