mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -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
|
@ -8,6 +8,8 @@ import (
|
|||
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
|
||||
"github.com/evilsocket/islazy/async"
|
||||
)
|
||||
|
||||
type OpenPort struct {
|
||||
|
@ -60,13 +62,17 @@ func (mod *SynScanner) onPacket(pkt gopacket.Packet) {
|
|||
}
|
||||
|
||||
if host != nil {
|
||||
ports := host.Meta.GetOr("ports", map[int]OpenPort{}).(map[int]OpenPort)
|
||||
ports := host.Meta.GetOr("ports", map[int]*OpenPort{}).(map[int]*OpenPort)
|
||||
if _, found := ports[port]; !found {
|
||||
ports[port] = OpenPort{
|
||||
openPort := &OpenPort{
|
||||
Proto: "tcp",
|
||||
Port: port,
|
||||
Service: network.GetServiceByPort(port, "tcp"),
|
||||
}
|
||||
|
||||
ports[port] = openPort
|
||||
|
||||
mod.bannerQueue.Add(async.Job(grabberJob{host, openPort}))
|
||||
}
|
||||
|
||||
host.Meta.Set("ports", ports)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue