mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
new: syn.scan will now perform basic tcp banner grabbing
This commit is contained in:
parent
5a62546c50
commit
aea68460c8
5 changed files with 160 additions and 3 deletions
18
modules/syn_scan/tcp_grabber.go
Normal file
18
modules/syn_scan/tcp_grabber.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package syn_scan
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func tcpGrabber(mod *SynScanner, ip string, port int) string {
|
||||
if conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", ip, port)); err == nil {
|
||||
defer conn.Close()
|
||||
msg, _ := bufio.NewReader(conn).ReadString('\n')
|
||||
return strings.Trim(msg, "\r\n\t ")
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue