Agent Wranglers

TNS-19Recommended

Check links in user content against phishing and malware lists

Check every link in a post, message, profile or listing against a list of known phishing and malware addresses. Check it when it is posted and again when it is clicked. Hide each match and open a case.

How to do it

Scammers post links to fake sign-in pages and to malware, and a link that was clean when posted can turn bad later. Check at post time to block, and at click time through your own redirect page. Sign the target on that page, so it never becomes an open redirect. Lists come from services such as Google Web Risk, because Google says its Safe Browsing API is for non-commercial use only. Its version 5 lookup sends only a 4-byte hash prefix of each address. Expand short links on the server, within the limits of Fetch only allowed addresses, and check the final address too. A matched link from a new account is a strong signal for Score every sign-up for risk.

Examples

JavaScript example

export async function checkLinks(item) {
  const urls = extractUrls(item.text);
  const finalUrls = await Promise.all(urls.map(expandShortLink));
  const matches = await threatList.lookup(finalUrls);
  if (matches.length) await cases.create({ itemId: item.id, reason: 'scam', source: 'link-scan', matches });
  return matches.length === 0;
}

Python example

async def check_links(item) -> bool:
    final_urls = [await expand_short_link(url) for url in extract_urls(item.text)]
    matches = await threat_list.lookup(final_urls)
    if matches:
        await cases.create(item_id=item.id, reason="scam", source="link-scan", matches=matches)
    return not matches

How to check

A test posts the list provider's test phishing address and a clean address. The first is hidden and a case opens, and the second shows. A short link that redirects to the test address is caught too. A list change after posting makes the click page warn instead of redirecting.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/trust-and-safety/sign-up-fraud-and-abuse/link-scanning">Agent Wranglers trust and safety playbook</a>. In code you write, add a comment next to it with the same link.