I need to determine which Web site is opened by which process. For example I would like to see that chrome.exe is connected w/ stackoverflow.com. In case that the browser on stackoverflow.com.
I used psutil to see network connection by IPs for each process then with socket.gethostbyaddr_ex('stackoverflow.com'), to get IP and check if this ip is on the psutil result list..
The problem that it's not always working it depends on the site. For example for yahoo.com the ip I got from socket.gethostbyaddr didn't match any IPs on the psutil result.
Anyone know another library or how we the same method it can work?
I mean probably the psutil does work but maybe yahoo has more than one ip like Google does and the IPs does match..
Aucun commentaire:
Enregistrer un commentaire