OSQuery threat hunting queries and endpoint investigation playbooks focused on persistence detection, suspicious accounts, process analysis, and malicious outbound connections.
This repository documents practical OSQuery-based endpoint investigation techniques used in blue team operations and threat hunting workflows.
The project focuses on:
- Detecting suspicious user accounts
- Investigating running processes
- Monitoring startup persistence
- Identifying suspicious outbound network activity
- Creating repeatable endpoint triage procedures
All content was recreated from hands-on learning, independent research, and personal lab study using OSQuery concepts and SQL-based endpoint visibility techniques.
- Endpoint threat hunting
- OSQuery query development
- SQL-based system investigation
- Persistence detection
- Linux endpoint analysis
- Network connection analysis
- Incident triage documentation
- Security operations workflow design
queries/ -> OSQuery hunting queries
notes/ -> Technical learning notes and detection logic
playbooks/ -> Investigation and response procedures
findings/ -> Example investigation scenariosDetection logic for:
- Newly created accounts
- Accounts with elevated privileges
- Unusual login shells
- Persistence-oriented user creation
Hunting for:
- Processes executing from temporary directories
- Unexpected parent-child process relationships
- Unusual binaries
- Long-running unauthorized processes
Investigation techniques for:
- Established outbound connections
- Unknown remote IPs
- Suspicious listening ports
- Potential command-and-control behavior
Queries focused on:
- Startup entries
- Cron persistence
- Login scripts
- Auto-start mechanisms
SELECT pid, name, path
FROM processes
WHERE path LIKE '/tmp/%';Purpose: Identify processes running from temporary directories commonly abused by malware.
- Enumerate suspicious processes
- Review network connections
- Identify persistence mechanisms
- Validate user accounts and privileges
- Document findings and containment actions
Detailed workflows are available in the playbooks/ directory.
This repository is intended for defensive security education, endpoint visibility learning, and authorized threat hunting activities only.
No malicious tooling or unauthorized access techniques are included.
- OSQuery
- Linux CLI
- SQL
- Threat hunting methodology
- Endpoint investigation techniques