# what is connected to internet



## HackXBack (Nov 20, 2013)

hello minds,
i have one question
how i can know what the links and pages that is connected to internet and send and received packet through my freebsd machine ?
thank you 

How can I find out which connections my FreeBSD machine has to and from the Internet? Thank you.


----------



## kpa (Nov 20, 2013)

`sockstat -64cL`. This will give you all connected IPv4 and IPv6 sockets that are not connected to localhost in anyway but are connections to or from the internet.


----------



## HackXBack (Nov 20, 2013)

*T*hank you, @kpa, *I* know this cmd command, but what *I* need is to see what the links are that are being visited through the machine.


----------



## beatgammit (Nov 20, 2013)

HackXBack said:
			
		

> *T*hank you, @kpa, *I* know this cmd command, but what *I* need is to see what the links are that are being visited through the machine.



What do you mean by links? Are you referring to HTTP connections? (i.e. to a web page)

I've used net/wireshark to follow TCP traffic, but if you're only interested in the URLs in HTTP packets, you could use tcpdump and get the first line, which will contain the URL that is being requested.

However, if the website in question is hosted on your machine, and the connections you're interested in are coming from the outside, it'll probably be a _ton_ easier just to mess with the logging settings on your webserver. Most webservers have an option to log all URLs that are visited. This is much less invasive than tcpdump and works on HTTPS connections.


----------

