new: implemented syn.scan module (closes #67)

This commit is contained in:
evilsocket 2018-02-22 21:20:36 +01:00
parent d6fe8fc663
commit ce76c7258d
8 changed files with 338 additions and 3 deletions

View file

@ -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 {