MCPcopy Create free account
hub / github.com/evilsocket/shellz / NewSession

Method NewSession

plugins/plugin.go:39–56  ·  view source on GitHub ↗
(sh models.Shell, timeouts core.Timeouts)

Source from the content-addressed store, hash-verified

37}
38
39func (p *Plugin) NewSession(sh models.Shell, timeouts core.Timeouts) (err error, clone *Plugin) {
40 p.Lock()
41 defer p.Unlock()
42
43 if err, clone = LoadPlugin(p.Path); err != nil {
44 return
45 }
46
47 clone.timeouts = timeouts
48 _, err = async.WithTimeout(timeouts.Connect, func() interface{} {
49 clone.ctx, err = clone.Call("Create", sh)
50 return err
51 })
52 if err != nil {
53 return err, nil
54 }
55 return
56}
57
58func (p *Plugin) Type() string {
59 return "plugin"

Callers 2

NewSSHFunction · 0.80
findSessionForFunction · 0.80

Calls 1

LoadPluginFunction · 0.85

Tested by

no test coverage detected