Last active
November 15, 2019 17:12
-
-
Save faststeak/275d5d157492b281b6940068f2ae9f6d to your computer and use it in GitHub Desktop.
Osquery Queries from various sources
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
SELECT p.pid, p.name, p.state, u.username, lp.* | |
FROM processes p | |
INNER JOIN listening_ports lp | |
ON lp.pid = p.pid | |
INNER JOIN users u | |
ON u.uid = p.uid; | |
SELECT u.username, | |
g.groupname | |
FROM users u | |
INNER JOIN user_groups ug | |
ON u.uid = ug.uid | |
INNER JOIN groups g | |
ON g.gid = ug.gid; | |
select s.uid, | |
s.command, | |
s.history_file, | |
u.username | |
from shell_history s | |
join users u on u.uid=s.uid; | |
select s.uid, | |
s.command, | |
s.history_file, | |
s.time, | |
u.username | |
from shell_history s | |
join users u on u.uid=s.uid; | |
select s.uid, | |
s.command, | |
s.history_file, | |
s.time, | |
u.username | |
from users u | |
join shell_history s on s.uid=u.uid | |
where s.time > ((select strftime('%s','now')) - 86400); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment