mirror of
https://github.com/bettercap/bettercap
synced 2025-07-08 05:51:37 -07:00
new: added -eval command
This commit is contained in:
parent
a849692468
commit
59c0e1eb76
3 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,7 @@
|
|||
set arp.spoof.targets 192.168.1.53
|
||||
# targeting the whole subnet by default, to make it selective:
|
||||
#
|
||||
# sudo ./bettercap-ng -caplet caplets/beef-active.cap -eval "set arp.spoof.targets 192.168.1.64"
|
||||
|
||||
# inject beef hook
|
||||
set http.proxy.script caplets/beef-inject.js
|
||||
# keep reading arp table for network mapping
|
||||
|
|
|
@ -8,6 +8,7 @@ type Options struct {
|
|||
Debug *bool
|
||||
Silent *bool
|
||||
NoHistory *bool
|
||||
Commands *string
|
||||
}
|
||||
|
||||
func ParseOptions() (Options, error) {
|
||||
|
@ -17,6 +18,7 @@ func ParseOptions() (Options, error) {
|
|||
Debug: flag.Bool("debug", false, "Print debug messages."),
|
||||
Silent: flag.Bool("silent", false, "Suppress all logs which are not errors."),
|
||||
NoHistory: flag.Bool("no-history", false, "Disable history file."),
|
||||
Commands: flag.String("eval", "", "Run a command, used to set variables via command line."),
|
||||
}
|
||||
|
||||
flag.Parse()
|
||||
|
|
6
main.go
6
main.go
|
@ -34,6 +34,12 @@ func main() {
|
|||
|
||||
defer sess.Close()
|
||||
|
||||
if *sess.Options.Commands != "" {
|
||||
if err = sess.Run(*sess.Options.Commands); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
if *sess.Options.Caplet != "" {
|
||||
if err = sess.RunCaplet(*sess.Options.Caplet); err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue