Created
March 11, 2016 14:47
-
-
Save bngsudheer/a54a759d94010689c3a9 to your computer and use it in GitHub Desktop.
Find the process that tries to establish outbound SSH connections
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find process that tries to establish outbound SSH connections | |
for (( ; ; )) | |
do | |
sleep 1 | |
lsof -i tcp:22 -P -R | |
if [ $? -eq 0 ]; then | |
echo 'found something. See above for details' | |
exit | |
else | |
echo 'nothing so far' | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment