DanMcInerney / net-creds

Sniffs sensitive data from interface or pcap
GNU General Public License v3.0
1.65k stars 432 forks source link

OSX active interface detect #6

Closed Congee closed 6 years ago

Congee commented 9 years ago

Thus we don't need to install extra iproute wrapper on Mac OSX.

DanMcInerney commented 9 years ago

I'd like to merge this but I don't have an OSX machine to test it on just yet so I'm going to leave it open for a while til I can confirm.

DanMcInerney commented 8 years ago

If anyone else has a macbook they can test this on an report I'd really like to merge it.

s0lst1c3 commented 8 years ago

Hey Dan, if you're still looking for someone to test this out with a Macbook I can help you out.

DanMcInerney commented 8 years ago

That would be great s0lst1c3

Congee commented 8 years ago

I took a look in brona/iproute2mac1, here you can see, what it does is parse the output (route table) of netstat -nr -f inet. This is too simple to intoduce a lib. Therefore, you don't need to test this because it's already tested by by the lib.

BTW, scutil --nwi is easier to parse

CC@~ $ scutil --nwi
Network information (generation 375595192471657)
IPv4 network interface information
     en0 : flags 0x5 (IPv4,DNS)
           reach 0x00000002 (Reachable)
           Signature Hash: <data> 0x33d9150551e2fe0bb7abd9f3707bed81a0d95509
           generation 375595192471657

   REACH : flags 0x00000002 (Reachable)

IPv6 network interface information
   No IPv6 states found

   REACH : flags 0x00000007 (Reachable, Transient Connection, Connection Required)

Network interfaces: en0