Skip to content

Instantly share code, notes, and snippets.

@bngsudheer
Created March 11, 2016 14:47
Show Gist options
  • Save bngsudheer/a54a759d94010689c3a9 to your computer and use it in GitHub Desktop.
Save bngsudheer/a54a759d94010689c3a9 to your computer and use it in GitHub Desktop.
Find the process that tries to establish outbound SSH connections
#!/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