Merge pull request #956 from BenGardiner/ipv6_anyproxy_fixes

Ipv6 any.proxy fixes
This commit is contained in:
Simone Margaritelli 2022-06-10 23:00:28 +02:00 committed by GitHub
commit c81db63a10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 8 deletions

View file

@ -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",

View file

@ -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")
}
}