{"slug": "anyone-can-call-themselves-ccbot-here-s-the-30-line-check-that-tells-the-real", "title": "Anyone can call themselves CCBot. Here's the 30-line check that tells the real one apart", "summary": "A developer analyzing their site's logs found that of 610 requests claiming to be Common Crawl's CCBot, only 358 were genuine, while 252 came from 44 unrelated addresses probing for sensitive files like /.bash_profile and /docker-compose.yaml. After Common Crawl confirmed CCBot impersonation is common and pointed to reverse DNS verification, the developer published a roughly 30-line Python script combining published IP-range checks with forward-confirmed reverse DNS, which correctly flagged all 252 fakes and none of the real crawlers. The method also works for Google's published crawler ranges with only the URL and DNS suffix changed.", "body_md": "A user agent is a string. Anyone can type it.\n\nOn my site, 610 requests have said \"I'm CCBot\", Common Crawl's crawler, since the logs began (counted 3 December 2026). Only 358 of them actually were. The other 252 came from 44 addresses that have nothing to do with Common Crawl, and they weren't crawling: they were asking for `/.bash_profile`, `/docker-compose.yaml`, `/proc/self/cmdline`. That's a scanner wearing a crawler's badge, hoping you whitelisted the badge.\n\nIf your analytics, your firewall rules or your \"AI bots visited us\" chart trust the user agent, you're counting those 252 as Common Crawl.\n\nI wrote to them on 2 December with the numbers. An engineer answered the same day:\n\n\"Sadly, many instances of CCBot impersonation have been observed for quite some time. Yes, you can use RDNS to verify whether a request comes from the real CCBot. This is covered in our FAQ and also on the CCBot page.\"\n\nSo there are two official methods:\n\n`crawl.commoncrawl.org`, and that name resolves back to the same IP. Reverse DNS alone isn't enough: whoever owns an IP can point its reverse record at any name they like. The forward lookup is what closes the loop.\nOn my logs both methods give the same verdict, request by request: 358 real, 252 not. Not one of the fakes passes either check.\n\nGoogle publishes its crawler ranges in the same JSON shape (`prefixes` → `ipv4Prefix` / `ipv6Prefix`), so the same function works for both; only the URL and the DNS suffix change.\n\n``` python\nimport ipaddress, json, socket, sys, urllib.request\n\ndef in_list(ip, url):\n    \"\"\"Is the IP inside one of the prefixes the operator publishes?\"\"\"\n    data = json.load(urllib.request.urlopen(url, timeout=15))\n    addr = ipaddress.ip_address(ip)\n    for p in data[\"prefixes\"]:\n        net = p.get(\"ipv4Prefix\") or p.get(\"ipv6Prefix\")\n        if addr in ipaddress.ip_network(net):\n            return True\n    return False\n\ndef fcrdns(ip, suffixes):\n    \"\"\"Forward-confirmed reverse DNS: IP -> name -> same IP.\"\"\"\n    try:\n        name = socket.gethostbyaddr(ip)[0]\n    except OSError:\n        return False, None\n    if not name.endswith(suffixes):\n        return False, name\n    try:\n        forward = {a[4][0] for a in socket.getaddrinfo(name, None)}\n    except OSError:\n        return False, name\n    return ip in forward, name\n\nif __name__ == \"__main__\":\n    ip = sys.argv[1]\n    print(\"in ccbot.json:\", in_list(ip, \"https://index.commoncrawl.org/ccbot.json\"))\n    print(\"FCrDNS:\", fcrdns(ip, (\".crawl.commoncrawl.org\",)))\nbash\n$ python verify_crawler.py 18.97.14.84\nin ccbot.json: True\nFCrDNS: (True, '18-97-14-84.crawl.commoncrawl.org')\n\n$ python verify_crawler.py 8.8.8.8\nin ccbot.json: False\nFCrDNS: (False, 'dns.google')\n```\n\nIn production, cache the JSON (it changes rarely) and the DNS answers. Don't do two lookups on every hit.\n\nThe whole thing (verified vs unconfirmed crawlers on one small site, monthly, CC BY 4.0) is on Zenodo: [https://doi.org/10.5281/zenodo.24628027](https://doi.org/10.5281/zenodo.24628027). Live numbers: [https://stats.lake8.dev](https://stats.lake8.dev). It's one site, so read it as a sample, not a census.\n\nHow do you verify bots on your side, list, reverse DNS, or not at all?", "url": "https://wpnews.pro/news/anyone-can-call-themselves-ccbot-here-s-the-30-line-check-that-tells-the-real", "canonical_source": "https://dev.to/tommy2970/anyone-can-call-themselves-ccbot-heres-the-30-line-check-that-tells-the-real-one-apart-2icp", "published_at": "2026-12-04 08:11:38+00:00", "updated_at": "2026-12-04 08:16:03.701814+00:00", "lang": "en", "topics": ["ai-crawlers", "ai-search", "generative-engine-optimization"], "entities": ["Common Crawl", "CCBot", "Google", "Zenodo"], "also_reported_by": [], "takeaway": "Verify crawler identity with both the operator's published IP prefixes and forward-confirmed reverse DNS (IP to name and back to the same IP), since user agents are trivially spoofed and reverse DNS alone can be forged by IP owners.", "recommendation": {"advice": "When gating access or analytics on crawler identity, check the operator's published IP ranges plus FCrDNS, and cache both since the JSON and DNS answers change rarely.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/anyone-can-call-themselves-ccbot-here-s-the-30-line-check-that-tells-the-real", "markdown": "https://wpnews.pro/news/anyone-can-call-themselves-ccbot-here-s-the-30-line-check-that-tells-the-real.md", "text": "https://wpnews.pro/news/anyone-can-call-themselves-ccbot-here-s-the-30-line-check-that-tells-the-real.txt", "jsonld": "https://wpnews.pro/news/anyone-can-call-themselves-ccbot-here-s-the-30-line-check-that-tells-the-real.jsonld"}}