Ask your first question in plain English
Use Hunt to ask a question in plain English, read the AQL it becomes, and refine it by hand.
Arcsentry turns a plain-English question into a query in AQL, its query language. It shows you that query before it runs. You can run it, change it, or rewrite it entirely.
This tutorial uses a web server case, but the steps are the same for any evidence.
Before you start
- A case with parsed evidence (Collect evidence).
- A model connected under the agent settings. Query translation can use a smaller, faster model than the AI investigator; you can choose a model per job.
1. Open Hunt and switch to NQL
Open Hunt. Above the query box are three modes: AQL, SQL and NQL. NQL is the plain-English mode. Choose it.
2. Ask
Type a question with the details you care about:
which client IPs requested php files under wp-content/plugins,
how many requests each, first and last seen
Press Enter. Arcsentry shows the translated query under your question:
filter event_type == "logs_nginx" && url ~= "(?i)wp-content/plugins/.*[.]php($|[?])"
group {remote_addr} (aggregate {
requests = count this,
first_seen = (earliest timestamp),
last_seen = (latest timestamp)
})
sort {-requests}
take 50
Then it runs it. In our demo case, the answer was two addresses: one with 8 requests, one with a single request. The single request turned out to be the exploit.
3. Read the assumptions
If your question is ambiguous, Arcsentry says how it read it. Asked “which commands did the web server account run”, it noted that the question does not name the account, so the query matches the usual web server accounts: www-data, nginx, apache and httpd.
Read these notes. They are where a translation is most likely to differ from what you meant.
4. Refine by hand
Switch to AQL. The translated query is in the box, ready to edit. AQL is a pipeline: each line feeds the next.
| Step | What it does |
|---|---|
filter |
Keeps rows that match a condition |
group … (aggregate …) |
Groups rows and computes counts, earliest and latest |
sort |
Orders rows; - means descending |
take |
Limits the number of rows |
select |
Picks the columns to show |
For example, to see each request from the busier address in order:
filter event_type == "logs_nginx" && remote_addr == "203.0.113.77"
sort {timestamp}
select {timestamp, remote_addr, url}
If a query is wrong, the error says why in plain words, for example that a field holds a list and needs a list function.
5. Look at the results
- The histogram shows when the matching events happened.
- Inspector shows one record at a time with every field.
- Table shows rows and columns.
From any event you can pivot to the minutes around it.
When to use SQL
AQL covers most hunting. Switch to SQL for joins across event types or window functions. SQL access is read-only.
See it on your own evidence. Free for 7 days.
Tell us what you want to investigate. A person replies within one business day with the download and a trial licence.
Request a trial