Show outgoing SMTP connections and their processes
find which process is sending spam | show outgoing connections port 25 | php script sending spam find | ss | spam | connectionsss -Htnp state established '( dport = :25 )'Lists all established TCP connections whose destination port is the given port, with the remote address and the responsible process including its PID. Normally only the mail server (Postfix or qmail) opens such connections. If php-fpm, php or an unknown process shows up here, a compromised script is probably sending spam directly.
Note: ls -l /proc/PID/cwd reveals the working directory of the process and often the affected website.
Also searched as
- find which process is sending spam
- show outgoing connections port 25
- php script sending spam find