Ian Littman / @ian@phpc.social / @ian.im / @iansltx
Slides at ian.im/doda25
and lets you do stuff like check if Apple Intelligence is enabled on a computer
SELECT path, sha1 FROM hash WHERE path IN (
SELECT path FROM process_open_files
JOIN file USING (path) WHERE file.size <= 1024 * 100
);
acpi_tables
battery
block_devices
chassis_info
connected_displays
cpu_info
cpuid
device_firmware
fan_speed_sensors
hardware_events
ibridge_info
intel_me_info
memory_devices
nvram
pci_devices
power_sensors
temperature_sensors
usb_devices
video_info
drivers (Windows)
apps (macOS)
apt_sources
chocolatey_packages
deb_packages
gatekeeper
gatekeeper_approved_apps
homebrew_packages
package_bom
package_install_history
package_receipts
python_packages
yum_sources
authenticode (Windows)
startup_items
launchd
chrome_extensions
firefox_addons
safari_extensions
patches (Windows)
npm_packages
programs (Windows)
rpm_packages
rpm_package_files
windows_update_history
authorized_keys
certificates
groups
keychain_items
known_hosts
last (logins + logouts)
logged_in_users
logon_sessions (Windows)
password_policy (macOS)
security_profile_info (Windows)
selinux_*
shadow
ssh_configs
sudoers
suid_bin
user_events
user_groups
user_ssh_keys
users
disk_encryption
bitlocker_info
connectivity
dns_cache (Windows)
dns_resolvers
etc_hosts
interface_addresses
interface_details
interface_ipv6
listening_ports
process_open_sockets
routes
wifi_*
curl
alf
alf_exceptions
alf_explicit_auths
windows_firewall_rules
windows_security_center
iptables
crontab
scheduled_tasks (Windows)
startup_items
processes
process_*
running_apps
systemd_units
windows_event_logs
syslog_events
unified_log
asl
shell_history
carves
disk_*
file
file_events
hash
md_* (software RAID)
mdls / mdfind (Spotlight)
mounts
nfs_shares
ntfs_*
office_mru
process_file_events
signature
docker_*
lxd_*
sudo ln -s $HOME/.docker/run/docker.sock /var/run/docker.sock
azure_instance_metadata
azure_instance_tags
ec2_instance_metadata
ec2_instance_tags
plist
registry
kernel_*
time
uptime
load_average
...at least likely join keys tend to be named the same (pid, uid, path)
Bonus tip: Check out the SQLite docs on SELECT and the SQLite tutorial
Provide query as an osqueryi argument to output and quit
At the CLI: --json, --csv
Inside the shell: .mode line, .mode column
Can run scheduled over time with either the entire result or diffs
SELECT * FROM processes WHERE on_disk = 0
SELECT COUNT(*) > 0 FROM files WHERE path = "/my/malware"
SELECT * FROM process_open_sockets WHERE remote_address = ""
Questions? Find me here / @ian@phpc.social / @ian.im / @iansltx
Slides: https://ian.im/doda25
More info: 2hr workshop from Zach from BSidesSF '24