mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
new: implemented syn.scan module (closes #67)
This commit is contained in:
parent
d6fe8fc663
commit
ce76c7258d
8 changed files with 338 additions and 3 deletions
20
core/core.go
20
core/core.go
|
@ -6,6 +6,7 @@ import (
|
|||
"os/exec"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -21,6 +22,25 @@ func TrimRight(s string) string {
|
|||
return strings.TrimRight(s, defaultTrimSet)
|
||||
}
|
||||
|
||||
func UniqueInts(a []int, sorted bool) []int {
|
||||
tmp := make(map[int]bool)
|
||||
uniq := make([]int, 0)
|
||||
|
||||
for _, n := range a {
|
||||
tmp[n] = true
|
||||
}
|
||||
|
||||
for n, _ := range tmp {
|
||||
uniq = append(uniq, n)
|
||||
}
|
||||
|
||||
if sorted {
|
||||
sort.Ints(uniq)
|
||||
}
|
||||
|
||||
return uniq
|
||||
}
|
||||
|
||||
func Exec(executable string, args []string) (string, error) {
|
||||
path, err := exec.LookPath(executable)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue