Reputation: 2049
What is the best way to find out which URLs the user is currently viewing in Linux? I want to do that independently of the browser (firefox, chromium ...) and via linux shell.
Upvotes: 0
Views: 636
Reputation: 56
By netstat and tcpdump you cat view only IP address of sites. 1- you can capture ip address by netstat and revers to domain with 'host' command 2- you can capture DNS query packet with 'tcpdump'
Upvotes: 0
Reputation: 7823
short version: You can't, well not easily.
Longer version: There is no standard for exposing this data, what urls a user has open is internal data to the browsers. You could attempt to deduce it by watching the output of netstat
over time and seeing what ips the system connects to. tcpdump / wireshark or a similar traffic analysis program would also be an option, but you would need to parse all the traffic leaving the box and then make the deductions about which websites the user is visiting.
However with both of those approaches you will get all the requests required for each url a user views, working out which was the one he actually wanted will be non-trivial.
Upvotes: 2