Skip to main content

Tracking a campaign over time

A campaign is one operator, or one kit, behind many deployments. You usually meet it as a handful of hosts from a case. This guide grows them into the campaign, measures it, and keeps it watched so new deployments are recorded as they appear. It starts where Investigating a phishing URL leaves off.

It uses urlquery-cli with jq. The example numbers come from a real campaign: fake "Meta for Business" appeal pages that send logins to a Telegram bot.

1. Start from what you have​

Collect the case's reports, and the facts they share:

urlquery-cli report get <report_id> > seed.json

jq '{title: .final.title, dom_hash: .final.dom.dom_hash,
bots: [.artifacts.telegram[].bot.username],
rare_scripts: [.javascript.script[] | select(.times_seen <= 5) | .sha256],
hosts: [.hosts[] | {fqdn, domain_rank, first_seen}]}' seed.json

Write the facts down with the report they came from. Every pivot below starts from one of them, and the campaign is only as solid as the facts that connect it.

2. Find the deployments​

Search for each fact, and keep the ones that find the campaign without finding everyone else:

urlquery-cli report search "final.dom.dom_hash:$(jq -r .final.dom.dom_hash seed.json)" --summary
urlquery-cli report search 'artifacts.telegram.bot.username:<bot>' --summary
urlquery-cli report search 'javascript.script.sha256:<sha256>' --summary
urlquery-cli report search 'final.title:"<title>" AND tags:phishing' --summary

In the example, the page structure (final.dom.dom_hash) found 541 reports and the Telegram bot 539, while none of the kit's scripts was rare enough to pivot on.

3. Measure it​

Collect the reports of the strongest pivot, then summarize them:

for offset in 0 100 200 300 400 500; do
urlquery-cli report search "final.dom.dom_hash:<dom_hash>" --limit 100 --offset $offset
done | jq -s '[.[].items[]] | {
reports: length,
hosts: ([.[].url.fqdn] | unique | length),
first: (map(.date) | min), last: (map(.date) | max),
networks: ([.[].ip.as] | group_by(.) | map({as: .[0], reports: length}) | sort_by(-.reports))
}'

The example campaign: 553 reports on 287 hosts, from 28 October to today, every one on Cloudflare. The dates tell you whether it is still active; the host count against the report count tells you how fast it moves to new hosts.

Signed in on urlquery.net, Report trends draws the same thing for an alert, a title or a bot: reports per day, and the hosts, networks and certificates they share.

4. Pivot on infrastructure, carefully​

Host Profile finds hosts that share a fact, including hosts whose reports you can't see. For one of the campaign's hosts:

urlquery-cli host get <host> --summary

# Hosts with the same certificate, cookie or response header.
urlquery-cli host list --certificate <sha256> --summary
urlquery-cli host list --cookie <cookie_name> --summary
urlquery-cli host list --header <header_name> --summary

# Who calls the same unusual service: a behaviour, not a fact.
urlquery-cli host relations <service_host> --direction incoming --type calls --summary

Not every shared fact connects hosts. Judge each pivot by how many unrelated hosts share it:

PivotStrengthWhy
A script or response body seen in a handful of reportsStrongCode a kit wrote; unrelated sites don't serve it.
The page structure (final.dom.dom_hash)StrongThe same template, even with other text or tokens in it.
A Telegram bot, a webhook, an exfiltration endpointStrongThe operator's own channel.
A certificate issued to the campaign's own domain or accountStrong within itIn the example, the certificate for one Workers account (s2470-9b6.workers.dev) found that account's 4 hosts, and no others.
An unusual service the kit calls, such as a visitor-location APIMediumIn the example, the latest 50 hosts calling api.db-ip.com were all the campaign's; but legitimate sites use such services too, and the pivot weakens as they do.
A custom cookie or response headerMedium to strongStrong when the kit sets it; weak when it is a framework's default.
An IP address or ASNWeakShared hosting and CDNs put thousands of unrelated sites behind one address. All 553 example reports were on Cloudflare.
A common certificate issuer, technology or JavaScript libraryWeakLet's Encrypt, WordPress or jQuery describe half the web.
A free hosting or serverless platform (workers.dev, netlify.app)WeakThe platform, not the operator. Its account part (s2470-9b6 in x.s2470-9b6.workers.dev) can be stronger.

A fact that connects hosts is a lead. Confirm a link with a second, independent fact, such as the page structure and the bot, before you call two hosts one campaign. See Host Profile for what its facts mean.

5. Watch for new sightings​

A campaign keeps moving, so record the new deployments as they appear:

# A watchlist: every new report that observes the campaign's indicators.
urlquery-cli monitoring watchlist create "Meta appeal kit" \
'<rare script sha256>' '<exfiltration host>' '*/<kit path>/*' --summary

# What it has caught, and how busy the campaign is.
urlquery-cli monitoring watchlist reports <watchlist_id> --summary
urlquery-cli monitoring watchlist stats <watchlist_id> --days 30 --summary
  • Indicators the operator can't change easily: content hashes, exfiltration endpoints, a distinctive URL path. Hosts on a serverless platform last hours; put them in only when the campaign reuses them.
  • Nothing shared: no CDN address, cloud storage domain, or common library hash. A noisy indicator stands out on the watchlist's page; remove it.
  • For what changes every time, such as the host and the tokens in the page, a YARA rule matches the kit's code wherever it is hosted.

Watchlist and YARA matches can come to you as notifications, and a webhook can feed them to a SIEM.

6. Keep the case current​

Every week or so:

  • Re-run the strongest searches with a date range, such as final.dom.dom_hash:<dom_hash> AND date:[now-7d TO now], and compare the counts with last week's.
  • Check the watchlist's statistics for indicators that stopped matching, a sign the kit changed, and for new ones to add.
  • Read a fresh report of the newest deployment. When the page structure or the exfiltration channel changed, the campaign moved to a new version: go back to step 1 with it.

Write down each finding with the report IDs and the date range it covers. Counts here are urlquery's observations of reports you can see, not how often the campaign reaches people; see Reading report trends.