How to view network traffic in and out of a machine?

Solution 1:

Yeah, Wireshark or HTTP Scoop.

With Wireshark you just need to configure the StartupItem 'ChmodBPF' which is included in the download, for it to work.

Solution 2:

My preferred way of doing it is with tcpdump and then open the dumped capture file with Wireshark, because it's easier to configure and even faster.

Example:

tcpdump -s 0 -w dumpfile.pcap -vv -i en0 'host example.com and port 80'

Solution 3:

Debookee will do the job for the following protocols: HTTP, HTTPS, DNS, TCP, DHCP, SIP ...

There's also a scanner included that can show you all the devices on your network.

But the best to me is the interceptor tool that allows you to see the traffic of any device (mobile, tablet, other Mac or PC) on your network, like Cain & Abel for Windows.