Inveigh icon indicating copy to clipboard operation
Inveigh copied to clipboard

NullReference Exception if IPv6 is disabled

Open VbScrub opened this issue 3 years ago • 3 comments

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Inveigh.Arguments.ParseArguments() at Inveigh.Program.Main(String[] arguments)

The error comes from line 295 in the Arguments.cs file because it is trying to insert into a null string:

Program.argMAC = Program.argMAC.Insert(2, ":").Insert(5, ":").Insert(8, ":").Insert(11, ":").Insert(14, ":");

The only solution was to enable IPv6 on my network adapter. Even if I use -IPv6 N I still get the error.

VbScrub avatar Nov 19 '21 17:11 VbScrub

Thanks, this will be fixed soon. You can also get around it by feeding it a MAC with -MAC. Basically, it only needs the MAC for DHCPv6 spoofing so it's not needed when IPv6 is disabled. I should have included -MAC in the list of paramters that are not required when IPv6 is disabled.

Kevin-Robertson avatar Nov 19 '21 18:11 Kevin-Robertson

thanks - just wrapped the block with if(enabledDHCPv6) - worked

            if (Program.enabledDHCPv6)
            {
                if (string.IsNullOrEmpty(Program.argMAC))
                {

                    if (string.IsNullOrEmpty(Program.argSnifferIPv6))
                    {
                        Program.argMAC = GetLocalMACAddress(GetLocalIPAddress("IPv6"));
                    }
                    else
                    {
                        Program.argMAC = GetLocalMACAddress(Program.argSnifferIPv6);
                    }

                }

                Program.argMAC = Program.argMAC.Insert(2, ":").Insert(5, ":").Insert(8, ":").Insert(11, ":").Insert(14, ":");
            }

T35R6braPwgDJKq avatar Dec 10 '21 11:12 T35R6braPwgDJKq

Thanks! That bug should be fixed in the dev branch version also.

Kevin-Robertson avatar Dec 10 '21 20:12 Kevin-Robertson