mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
new: new -script allows to run JS code to instrument session
This commit is contained in:
parent
d5e5abcb9b
commit
40727063ec
13 changed files with 610 additions and 312 deletions
21
session/script.go
Normal file
21
session/script.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
"github.com/evilsocket/islazy/plugin"
|
||||
|
||||
_ "github.com/bettercap/bettercap/js"
|
||||
)
|
||||
|
||||
type Script struct {
|
||||
*plugin.Plugin
|
||||
}
|
||||
|
||||
func LoadScript(fileName string, ses *Session) (*Script, error) {
|
||||
if p, err := plugin.Load(fileName); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return &Script{
|
||||
Plugin: p,
|
||||
}, nil
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue