Threat hunting with AI
Threat hunting means searching for attackers who have not triggered any alert. AI can help turn an idea into a query, but you must test it.
In 60 seconds
Threat hunting with AI
Threat hunting means searching for attackers who have not triggered any alert. AI can help turn an idea into a query, but you must test it.
Use MITRE ATT&CK to shape the hypothesis
| Hunt part | Example |
|---|---|
| Hypothesis | An attacker with a stolen account is moving between servers using remote logins. |
| ATT&CK mapping | Tactic: Lateral Movement. Technique: Remote Services. |
| Data needed | Authentication logs from servers, with user, source host, destination host and time. |
| What would look odd | One account logging in to many more hosts than usual in a short time. |
Let AI draft the query
-- Accounts that logged in to many hosts over the network in 7 days
SELECT user_name,
COUNT(DISTINCT dest_host) AS hosts_reached
FROM auth_logs
WHERE event_time >= NOW() - INTERVAL '7 days'
AND logon_type = 'network'
AND result = 'success'
GROUP BY user_name
HAVING COUNT(DISTINCT dest_host) > 10
ORDER BY hosts_reached DESC;Validate on known data
- 1
Check it runs
Fix any made-up field or table names. - 2
Test on a known case
Run it on data where you know the answer, such as a lab test or a past incident. - 3
Check the baseline
Backup servers and admin tools may reach many hosts normally. Note them. - 4
Review results
Investigate what is left. Most hunts find nothing bad, and that is still useful. - 5
Document
Write down the hypothesis, query, data range, results and what you would change.
Documenting a hunt
- Hypothesis and ATT&CK mapping
- Data sources and time range searched
- Final query (after your fixes), and what the AI draft got wrong
- Findings, including "nothing found"
- Whether this should become a detection rule
Watch and read more
Lab
A documented hunt plan with an AI-drafted query that you tested on sample data.
The problem
Use the sample authentication events below (fictional).
- Write a hypothesis and map it to an ATT&CK tactic and technique.
- Ask an AI to draft a query in a language you can run (SQL on a small table, or a spreadsheet filter works too).
- Load the sample data and run the query. Fix anything the AI got wrong.
- Write a short hunt record: hypothesis, data, final query, findings, and what you fixed.
event_time,user_name,src_host,dest_host,logon_type,result
2025-05-01 10:01,backup_svc,BKP-01,SRV-01,network,success
2025-05-01 10:02,backup_svc,BKP-01,SRV-02,network,success
2025-05-01 10:03,backup_svc,BKP-01,SRV-03,network,success
2025-05-01 14:20,ravi.m,WS-22,SRV-01,network,success
2025-05-01 23:41,anita.s,WS-09,SRV-01,network,success
2025-05-01 23:42,anita.s,WS-09,SRV-02,network,success
2025-05-01 23:43,anita.s,WS-09,SRV-03,network,success
2025-05-01 23:44,anita.s,WS-09,SRV-04,network,success
2025-05-01 23:45,anita.s,WS-09,DC-01,network,successYou are done when
Hard questions
Try to answer before you reveal. If you can answer these, you understood the lesson.
Q1Why is counting distinct hosts better than counting logins for this hypothesis?Reveal
A normal user may log in to the same server many times a day. Lateral movement is about reaching new places. Counting distinct destination hosts measures spread, which fits the hypothesis better and reduces noise from repeated normal logins.
Q2An attacker moves slowly, one new host per day. Would the 7-day query catch it? How could you adjust?Reveal
Maybe not, if the threshold is 10 hosts in 7 days. You could compare each account against its own normal behaviour (for example, hosts never visited before), look over a longer time range, or pay special attention to sensitive targets like domain controllers. Each choice trades more findings for more noise.
Questions people ask
What is the difference between hunting and responding to alerts?
Alerts come to you when a rule fires. Hunting is when you go looking, on purpose, for things your rules did not catch. Good hunts often become new rules.
Can AI suggest hypotheses?
Yes, it can brainstorm ideas from a threat report or an ATT&CK technique. You choose the ones that fit your environment and data. An idea is only useful if you have the logs to test it.
Why give the AI my real field names?
Without them, it guesses common names, which often do not match your system. Giving real field names (not real data) makes the draft much closer to working.
Is it safe to paste my query results into a chatbot?
Only into an approved tool, and only what is needed. Hunt results often contain usernames, hostnames and IP addresses, which are internal data.
Lesson test
5 questions. Get 3 right (60%) to pass and complete this lesson.