How to find which process used a port? Possible Trojan.

I got this warning on my router:


Threat

A Network Trojan was Detected. Signature ET MALWARE

Suspicious User Agent (Autoupdate). From: 10.0.1.3:61379, to: 54.36.160.184:80, protocol: TCP


I did "% lsof -i" to try to figure out which process it was, but none was using that port when I checked. Is there any way to monitor the port and catch which process tries to use it, the next time it does?

Mac Pro, macOS 10.13

Posted on Oct 4, 2020 4:27 AM

Reply
5 replies

Oct 4, 2020 6:48 AM in response to BDAqua

% lsof -nP -i4TCP:$63681 | grep LISTEN

lsof: unacceptable port specification in: -i 4TCP:

lsof 4.89

latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/

latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ

latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man

usage: [-?abhlnNoOPRtUvV] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]

[-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s]

[+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]

Use the ``-h'' option to get more help information.


% sudo lsof -iTCP -sTCP:LISTEN -n -P


shows about 25 lines of things on various ports, but 1) my port of interest isn't there - is there an option to have it wait and keep testing until it shows up, or I need to write a script for that, and 2) I would assume there are more than 25 processes making connections right now - what are the criteria for being shown on this list? Thanks!!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to find which process used a port? Possible Trojan.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.