Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start-Sniffer: Error if LocalIP not provided and Persistent Route for 0.0.0.0 is set. #3

Open
amnich opened this issue Nov 25, 2017 · 1 comment

Comments

@amnich
Copy link

amnich commented Nov 25, 2017

If I don't provide the LocalIP for Start-Sniffer it returns an error

 Using Local IP: Default 
   Cannot convert value "Default " to type "System.Net.IPAddress". Error: "Wrong IP Address (Error edited - was in Polish)."
   At D:\PoSH\Skrypty\NetworkSniffer\Network-SnifferTools.psm1:762 char:5
   +     $Endpoint = New-Object System.Net.IPEndpoint([Net.IPAddress]"$Loc ...
   +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
       + FullyQualifiedErrorId : InvalidCastParseTargetInvocation

The reason is I have a persistent route with a 0.0.0.0 IP address so the value of LocalIP is 'Default' instead of my IP.

===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.1.254    192.168.1.145    306
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0    192.168.1.254  Default
===========================================================================
@amnich amnich changed the title Error if LocalIP not provided and Persistent Route for 0.0.0.0 is set. Start-Sniffer: Error if LocalIP not provided and Persistent Route for 0.0.0.0 is set. Nov 25, 2017
@pldmgg
Copy link
Owner

pldmgg commented Nov 25, 2017

Awesome thanks for catching this. Parsing route print is from the original Sniffer.ps1 and not really my style :)

I just pushed an update that should fix this. I'll take a look at fixing the other issue you filed regarding no output when timeout is reached.

Keep those issues coming if you find more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants