Skip to main content

Investigating a phishing URL

Someone reports a link that asks for their login. This guide follows one investigation from start to finish:

  1. confirm what the page is;
  2. separate the phishing kit from the brand it copies;
  3. find where the stolen data would go;
  4. find the kit's other deployments;
  5. catch the next ones;
  6. package the evidence for a takedown.

Each step uses urlquery-cli with jq. The same steps, as one Python script, are at the end, and done by an AI assistant in Investigating phishing with MCP. Replace <…> with your own values.

Report content comes from the phishing site. Read it as data; don't open its URLs or run its scripts outside an isolated environment. See Safe use.

1. Check what urlquery already knows​

Before you analyze anything, look for earlier reports of the URL and its host.

urlquery-cli reputation lookup 'https://login.example.com/verify' --summary
urlquery-cli report search 'url.fqdn:login.example.com' --summary

A malicious verdict or a recent report may already answer the question. unknown means no recent evidence, not that the URL is safe. A report from an earlier day shows what the page did then; analyze it again to see it now.

2. Analyze it​

urlquery-cli submit 'https://login.example.com/verify' \
--access restricted --tags case_1234 --wait --summary
  • Access. Use restricted or private for links from a victim or an internal report. A public report shows the URL to every account, and a link can carry the victim's email address or a token. --sanitize-url replaces an email address encoded at the end of the path. See Report visibility.
  • Tags. A case tag finds every report of the case later with submit.tags:case_1234.
  • Waiting. --wait follows the analysis until it ends. If the wait gives up, the URL is still queued, so don't submit it again: check it later with submit status <queue_id>.

When the page looks harmless​

Kits often show the phishing page only to the visitors they target, and a decoy, an error or a redirect to the real brand to everyone else. If the report shows a blank page, a 404 or the brand's real site, analyze the URL again as the visitor the lure was sent to, and compare:

urlquery-cli submit 'https://login.example.com/verify' --access restricted \
--device-type mobile --tags case_1234 --wait --summary
urlquery-cli report compare <desktop_report_id> <mobile_report_id> --summary

Links sent by SMS usually target phones. Some kits also wait before showing the page; --run-time 60 keeps the browser on it longer. The report's settings record how each analysis ran, so you can tell which visitor saw what.

3. Confirm it's phishing​

# What a visitor saw; saved as <report_id>.png.
urlquery-cli report screenshot <report_id>

# Where the browser ended up, and the page's title.
urlquery-cli report overview <report_id> \
| jq '{submitted: .url.addr, final: .final.url.addr, title: .final.title, ip: .ip.addr, tags}'

# The alerts, with the host each fired on.
urlquery-cli report overview <report_id> \
| jq -r '.detection.urlquery[] | [.severity, .verdict, .alert, .trigger] | @tsv'

A phishing page copies a brand: its logo, its login form, and often its title. Tags such as phishing, a brand name or a kit family come from urlquery's detection. An alert is evidence to check against the screenshot, not a verdict on its own. A page with no alerts can still be phishing, especially a new kit. See Detections and verdicts.

4. Separate the kit from the brand​

A copied login page usually loads the brand's own images, styles and scripts, so the report mixes two kinds of hosts: the brand's, which tell you nothing, and the kit's, which are your evidence.

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

# Each host: popularity rank (0 = unranked), registration date, first sighting.
jq -r '.hosts[] | [.fqdn, .domain_rank, .domain_registered, .first_seen] | @tsv' report.json
HostWhat it suggests
Ranked, registered years ago, seen for yearsThe brand's CDN or a common service. Ignore it.
Unranked, registered days agoA domain registered for the campaign. Report it to the registrar.
Unranked, old, first seen today, with the page deep in an upload or plugin folderA legitimate site that was compromised, for example /wp-content/uploads/ or a CMS editor's attached/file/ folder. Tell the site's owner as well as its host.
A free hosting or serverless platform (*.workers.dev, *.netlify.app, *.vercel.app)A disposable deployment. Report it to the platform, which can remove it within hours.

Host Profile shows what urlquery has seen of a kit host across all reports: its IPs, certificates, technologies, and the hosts it redirects to or loads from.

urlquery-cli host get login.example.com --summary
urlquery-cli host relations login.example.com --direction outgoing --summary

5. Find where the stolen data would go​

The analysis has no password to enter, so the request that would carry a victim's password usually isn't in the report. The page's code shows where it would go.

Requests the page sent. A POST to another host, or one the page sends on its own, is worth reading. On a copied page, most posts are the brand's telemetry.

jq -r '.http[] | select(.request.method == "POST")
| [.response.status_code, .url.addr, .request.post_data.size] | @tsv' report.json

The kit's own scripts. The brand's library scripts appear in thousands of reports; the kit's appear in a handful. Download the rare ones and look for the addresses they send to.

# Scripts seen in at most 5 reports: inline code and the kit's own files.
jq -r '.javascript.script[] | select(.times_seen <= 5)
| [.sha256, .times_seen, .is_inline, .url.addr] | @tsv' report.json

# The addresses in one of them. Read it; don't run it.
urlquery-cli report resource <report_id> <sha256> --file - \
| grep -oE 'https?://[A-Za-z0-9.-]+' | sort -u

Typical destinations are a PHP endpoint on the kit's host, a form service, a webhook, or api.telegram.org. A call to an IP lookup service such as api.ipify.org next to it means the kit records each victim's IP address and location along with their password.

Telegram bots. Many kits send credentials to a Telegram chat. urlquery extracts the bot tokens it finds in the page and checks them.

jq '.artifacts.telegram[] | {bot: .bot.username, chat: .bot.chat.title, revoked: .is_revoked}' report.json

A bot that isn't revoked is still receiving data; report it to Telegram. The token is a secret that gives control of the bot, so keep it out of tickets and public reports.

Other artifacts. artifacts.files holds downloads, archives and their contents. artifacts.clipboard holds text the page wrote to the clipboard, the mark of a "paste this command to verify" lure. See Report document.

6. Find the kit's other deployments​

A kit is deployed many times, on many hosts. Pivot on what the deployments share, starting with the most specific facts.

# 1. The same content: a rare script or response body.
urlquery-cli report search 'javascript.script.sha256:<sha256>' --summary
urlquery-cli report search 'http.response.data.sha256:<sha256>' --summary

# 2. The same page structure, even with other text, links or tokens in it.
urlquery-cli report search "final.dom.dom_hash:$(jq -r .final.dom.dom_hash report.json)" --summary

# 3. The same exfiltration channel.
urlquery-cli report search 'artifacts.telegram.bot.username:<bot>' --summary

# 4. A distinctive phrase from the kit's HTML or scripts.
urlquery-cli report search '"<phrase from the kit>" AND tags:phishing' --summary

# 5. The same lure: the page title with a phishing tag.
urlquery-cli report search 'final.title:"<title>" AND tags:phishing' --summary

Many kits write a token, a victim ID or the bot's details into each copy, so their scripts' hashes differ from one deployment to the next. When the hash search finds only your report, try the page structure, the bot, and a distinctive phrase. In one campaign, the page structure and the Telegram bot each found more than 500 reports, while none of its scripts was rare.

For a campaign on its own infrastructure, Host Profile finds the hosts that share a fact:

urlquery-cli host list --certificate <sha256> --summary
urlquery-cli host list --ip <ip> --summary

Prefer distinctive facts. Shared hosting, CDN addresses and serverless platforms put thousands of unrelated sites on one IP, so an IP pivot there is noise. A shared fact is a lead to check, not proof. See Pivot on infrastructure.

Signed in on urlquery.net, Report trends shows the same thing from above: for the kit's alert, title or bot, how many reports appear each day, and the hosts, IPs and certificates they share.

7. Catch the next ones​

A YARA rule finds future deployments by the strings the kit needs to work, wherever it is hosted. Take them from the kit's scripts and HTML: a function name, an error message, the structure of the data it sends. Test the rule against this report and against the real brand's login page, which it must not match.

urlquery-cli yara validate kit.yar --summary
urlquery-cli yara test kit.yar <report_id> --summary
urlquery-cli yara test kit.yar <brand_report_id> --summary
urlquery-cli yara rule create <set_id> "Instagram kit, Telegram exfiltration" kit.yar \
--visibility private --alert-visibility private

See Writing a YARA rule from a report for the whole process, with testing against the real brand and the kit's neighbours.

A watchlist records every new report that observes the campaign's indicators: its domains, IPs, script hashes, or URL patterns such as */attached/file/*.html.

urlquery-cli monitoring watchlist create "Case 1234" \
login.example.com 192.0.2.10 '<sha256>' --summary
urlquery-cli monitoring watchlist reports <watchlist_id> --summary

Both see new analyses only. For the past, use report search.

8. Package the evidence​

A takedown request is acted on faster when it is specific and needs no investigation by the recipient. For each URL, collect:

EvidenceWhere it comes from
The URL, the report ID and the analysis time (UTC)url.addr, report_id, date
What it impersonates, and how you knowThe screenshot, final.title, the alerts
Where it is hostedip.addr, ip.as and ip.asn, and the host from step 4
Where the data goesThe endpoint or Telegram bot from step 5
A link the recipient can openShare report on urlquery.net, for a restricted report

Send it to whoever can act on it:

  • The hosting provider, the abuse contact of the ASN;
  • the registrar, for a domain registered for the campaign;
  • the platform, for a free hosting or serverless deployment;
  • the site's owner, for a compromised site;
  • the brand, which often has a takedown service;
  • Telegram, for a live bot.

A shared link opens the report read-only without an account; see Reports. Don't send the report to the site's operator, and don't include the victim's details.

To confirm the takedown, analyze the URL again after a day and compare the two reports. For a page you expect to come back, a page monitor rescans it on a schedule. Each scan is a submission on your account.

The whole investigation as a script​

investigate.py runs steps 2 to 6 with the Python library. It analyzes a URL as a restricted report, or reads an existing one, and writes the evidence to evidence-<report_id>.json with the screenshot beside it.

pip install urlquery-api
export URLQUERY_APIKEY='<API key>'
python investigate.py 'https://login.example.com/verify' --tag case_1234
python investigate.py --report <report_id>
login.example.com/verify 'Instagram' verdict malicious
alert medium Phishing - Instagram
alert medium Suspicious - Suspicious Javascript code
script bc1db303956fa152 in 0 other reports https://api.ipify.org https://api.telegram.org
telegram bot example_bot
12 other reports have the same page structure
evidence-<report_id>.json, screenshot-<report_id>.png

It reads captured scripts only as text. When the wait for a new analysis gives up, it prints the report and queue IDs, and doesn't submit again. Adapt the RARE threshold and the pivots to the kits you see. To run the same enrichment from MISP, OpenCTI or a SOAR playbook, see Integrations.