Created
March 23, 2023 21:45
-
-
Save muffins/59810da3dfd1d246f02ff27f6afb19a9 to your computer and use it in GitHub Desktop.
osquery listening processes function
This file contains 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
function listening_processes() { | |
type osqueryi > /dev/null 2>&1 | |
if [ $? -eq 1 ]; then | |
echo "[-] osqueryi not found on the system, install it." | |
return 1 | |
fi | |
osqueryi "select p.pid, p.name, lp.port, lp.address from listening_ports lp join processes p on lp.pid = p.pid where lp.port <> 0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment