Monitoring your own sites and brand
This guide is for defenders of their own assets rather than hunters of someone else's: a security team watching its company's sites, or a brand protection team looking for its login page on other people's domains. It covers five jobs:
- catch changes to your own pages, such as an injected skimmer;
- find copies of your login page that already exist;
- spot lookalike host names;
- record new impersonations as they appear;
- act on what you find: takedowns, and watching that a copy stays down.
It uses urlquery-cli with jq. Replace example.com with your domain.
1. Watch your own pages
A page monitor rescans a page on a schedule and compares each scan with a baseline report, so you see what a visitor's browser sees: a card skimmer added to the checkout page, a compromised tag manager loading something new, a redirect to a scam.
# A private baseline of the page that matters: login, checkout, payment.
urlquery-cli submit 'https://www.example.com/login' --access private --wait --summary
# Rescan it every 6 hours, comparing every resource, third parties included.
urlquery-cli monitoring page create <report_id> --interval 6h --access private --scope all \
--checks redirect,http_status,new_hosts,certificate,new_detections \
--ignore 'https://www.google-analytics.com/*' --summary
# The same page as a phone sees it: a second baseline, and a monitor from it.
urlquery-cli submit 'https://www.example.com/login' --access private --device-type mobile --wait --summary
urlquery-cli monitoring page create <mobile_report_id> --interval 6h --access private --scope all \
--checks redirect,http_status,new_hosts,certificate,new_detections \
--ignore 'https://www.google-analytics.com/*' --summary
- Private scans, so your pages' scans aren't public reports.
- Ignore what changes by design, such as analytics and advertising, so a real change stands out.
- After a release, make the first scan that shows it the new baseline:
urlquery-cli monitoring page baseline <monitor_id> <run_report_id>. - More than one baseline. Compromised sites often show the malicious content only to some visitors. A monitor scans with its baseline's settings, so the mobile monitor above sees what phones are served.
Every scan is a submission on your account. See What counts as a change for the settings.
2. Find copies of your pages
A phishing copy of your login page keeps something of yours: the title, the logo, a stylesheet, or links back to your servers. Collect those fingerprints from a report of your real page:
urlquery-cli report get <report_id> > mine.json
# The title, and the hash of each file your page loads from your own domain.
jq -r '.final.title' mine.json
jq -r '.http[] | select(.url.domain == "example.com" and .response.data.size > 0)
| [.response.data.sha256, .response.data.mime_type, .url.addr] | @tsv' mine.json | sort -u
Then search for reports that use them away from your domain:
# Your page title on another domain.
urlquery-cli report search 'final.title:"Example - Sign in" AND NOT final.url.domain:example.com' --summary
# Your logo or stylesheet, copied: the same content served by another site.
urlquery-cli report search 'http.response.data.sha256:<logo sha256> AND NOT final.url.domain:example.com' --summary
# Your assets loaded from your servers by a page on another domain: hotlinking.
urlquery-cli report search 'http.url.domain:example.com AND NOT final.url.domain:example.com AND tags:phishing' --summary
Hotlinking is the easiest copy to find and the noisiest for a widely embedded brand. For a large social network's CDN, the hotlinking search without a tag found 9,401 reports, most of them ordinary embeds; with AND tags:phishing, 285. For a company whose assets nobody else embeds, the search without the tag is the sharper one.
Leave out empty responses: their hash, e3b0c442…b855, is the same for every empty body and matches nearly every report. Pick files only your site serves. Your logo and your own stylesheet are good; a JavaScript library or a font you load from a CDN matches every site that uses it.
3. Spot lookalike host names
Search the host names of reports for your brand and its common misspellings:
urlquery-cli report search 'url.fqdn:*example* AND NOT url.domain:example.com AND date:[now-7d TO now]' --summary
urlquery-cli report search 'url.fqdn:*examp1e* OR url.fqdn:*exarnple*' --summary
Expect noise. For a large brand, url.fqdn:*instagr*m* over 7 days found 123 hosts: fan blogs and follower services next to real phishing on serverless platforms. Read the titles and tags in the results, and keep the hosts with your logo, your title or a phishing tag.
This finds lookalikes that urlquery has analyzed, from anyone's submissions. It is not a list of registered domains: a lookalike nobody has submitted yet won't appear. Run the search on a schedule, daily with date:[now-1d TO now], and treat new results as leads.
Watchlists can't do this part: a watchlist matches exact host names and domains, and its URL patterns need a path, so a pattern for any host containing your brand isn't possible.
4. Record new impersonations
Once you know what copies of your pages keep, have urlquery record every new report that has it:
# Your own assets' hashes: matches any new report whose page, scripts or responses have them.
urlquery-cli monitoring watchlist create "Brand: example.com assets" '<logo sha256>' '<stylesheet sha256>' --summary
urlquery-cli monitoring watchlist reports <watchlist_id> --summary
- Your own scans match too. Your page monitors' and your colleagues' reports of your site load the same files. Skip reports on your own domain when you read the matches.
- Hashes, not your host, for a widely embedded brand: a watchlist with your static host records every report that loads anything from it, embeds included.
- A YARA rule catches copies that changed your files but kept your page's text or structure: the login form's field names, an error message, the copyright line. Your real page matches such a rule too, so test it against your own report and expect that match. See Writing a YARA rule from a report.
Matches can come to you as notifications, by email, chat or webhook.
5. Act on what you find
For each copy, the evidence for a takedown is the same as for any phishing page: the URL, the report ID and time, the screenshot, where it is hosted, and how you know it copies you. Brand owners usually get the fastest response from the hosting provider or platform, and from the registrar for a domain registered to look like yours.
For a copy that is still live, a page monitor on its URL tells you when it's taken down, and when it comes back.