mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
new: basic ipv6 support
This commit is contained in:
parent
d0b5c34763
commit
bef4c6abaa
8 changed files with 115 additions and 35 deletions
|
@ -167,6 +167,12 @@ type scanJob struct {
|
|||
func (mod *SynScanner) scanWorker(job async.Job) {
|
||||
scan := job.(scanJob)
|
||||
|
||||
fromHW := mod.Session.Interface.HW
|
||||
fromIP := mod.Session.Interface.IP
|
||||
if scan.Address.To4() == nil {
|
||||
fromIP = mod.Session.Interface.IPv6
|
||||
}
|
||||
|
||||
for dstPort := mod.startPort; dstPort < mod.endPort+1; dstPort++ {
|
||||
if !mod.Running() {
|
||||
break
|
||||
|
@ -174,7 +180,7 @@ func (mod *SynScanner) scanWorker(job async.Job) {
|
|||
|
||||
atomic.AddUint64(&mod.stats.doneProbes, 1)
|
||||
|
||||
err, raw := packets.NewTCPSyn(mod.Session.Interface.IP, mod.Session.Interface.HW, scan.Address, scan.Mac, synSourcePort, dstPort)
|
||||
err, raw := packets.NewTCPSyn(fromIP, fromHW, scan.Address, scan.Mac, synSourcePort, dstPort)
|
||||
if err != nil {
|
||||
mod.Error("error creating SYN packet: %s", err)
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue