mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
Merge pull request #956 from BenGardiner/ipv6_anyproxy_fixes
Ipv6 any.proxy fixes
This commit is contained in:
commit
c81db63a10
3 changed files with 28 additions and 8 deletions
|
@ -44,7 +44,7 @@ func NewAnyProxy(s *session.Session) *AnyProxy {
|
|||
|
||||
mod.AddParam(session.NewStringParameter("any.proxy.dst_address",
|
||||
session.ParamIfaceAddress,
|
||||
session.IPv4Validator,
|
||||
"",
|
||||
"Address where the proxy is listening."))
|
||||
|
||||
mod.AddParam(session.NewIntParameter("any.proxy.dst_port",
|
||||
|
|
|
@ -32,7 +32,9 @@ func NewNDPSpoofer(s *session.Session) *NDPSpoofer {
|
|||
mod.AddParam(session.NewStringParameter("ndp.spoof.targets", "", "",
|
||||
"Comma separated list of IPv6 victim addresses."))
|
||||
|
||||
mod.AddParam(session.NewStringParameter("ndp.spoof.neighbour", "fe80::1", "",
|
||||
mod.AddParam(session.NewStringParameter("ndp.spoof.neighbour",
|
||||
"fe80::1",
|
||||
session.IPv6Validator,
|
||||
"Neighbour IPv6 address to spoof, clear to disable NA."))
|
||||
|
||||
mod.AddParam(session.NewStringParameter("ndp.spoof.prefix", "d00d::", "",
|
||||
|
@ -122,7 +124,7 @@ func (mod *NDPSpoofer) Start() error {
|
|||
}
|
||||
|
||||
return mod.SetRunning(true, func() {
|
||||
mod.Info("ndp spoofer started - neighbour=%s prefix=%s", mod.neighbour, mod.prefix)
|
||||
mod.Info("ndp spoofer started - targets=%s neighbour=%s prefix=%s", mod.addresses, mod.neighbour, mod.prefix)
|
||||
|
||||
mod.waitGroup.Add(1)
|
||||
defer mod.waitGroup.Done()
|
||||
|
@ -179,6 +181,8 @@ func (mod *NDPSpoofer) getTargets(probe bool) map[string]net.HardwareAddr {
|
|||
// do we have this ip mac address?
|
||||
if hw, err := mod.Session.FindMAC(ip, probe); err == nil {
|
||||
targets[ip.String()] = hw
|
||||
} else {
|
||||
mod.Info("couldn't get MAC for ip=%s, put it into the neighbour table manually e.g. ping -6")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue