Skip to main content

Phishing domain detection from Certificate Transparency logs.

Project description

PhishRadar

Detect phishing/scam domains from Certificate Transparency logs. Can be useful for internal security teams for monitoring company-specific domains, as well as for sectorial/national CERTs for monitoring the domains of their constituents.

Logs are retrieved via Certstream. Keywords are set in a YAML configuration file and detected via two methods:

  • for common subwords, results from WordSegment are scanned
  • for rarer words (e.g. brand names), we simply check if the domain contains the keyword - this is because WordSegment may not correctly separate unknown subwords.

For better customization, a minimal threshold of matching keywords can be set.

The idea was born after encountering phishing attacks and malware Command-and-Control communication involving domains impersonating Armenian government bodies (1, 2).

Installation and usage

pip install phishradar
phishradar --config ./config.yaml

Sample configuration

certstream_url: wss://certstream.calidog.io/
keywords:
  - test
  - keyword
  - yourbrand
whitelist:
  - exclude
  - these
threshold: 1  # Number of matched keywords to alert for
output:
  console: True
  file: output.log
  # Example use case of a webhook sink - a Telegram bot for alerting
  # The following templates are supported in messages (URL and body):
  #   $domain - defanged domain name
  #   $matches_list - bullet point list of matched keywords
  #   $matches_comma - comma-separated string of matched keywords
  webhook:
    url: "https://api.telegram.org/bot<INSERT_YOUR_BOT_TOKEN>/sendMessage"
    body: '{"chat_id": "<INSERT_YOUR_CHAT_ID>", "parse_mode": "html", "text": "<b>$domain</b> contains: <i>$matches_list</i>"}'

Further work

  • Try out alternative threshold mechanism (e.g. weighted keywords)
  • Experiment with word segmentation via a Small Language Model

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phishradar-0.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phishradar-0.3-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file phishradar-0.3.tar.gz.

File metadata

  • Download URL: phishradar-0.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for phishradar-0.3.tar.gz
Algorithm Hash digest
SHA256 cbf9a752409ae9b7de1646293db8ac392b8835b36d797b70caac9cdea43ff6ed
MD5 0a2a5ef5d30ca53fb54afa97f22e28f0
BLAKE2b-256 a67951b84b2617d9a8eb5cb6809b47933150f13a106167393d79e6797d9aefa9

See more details on using hashes here.

File details

Details for the file phishradar-0.3-py3-none-any.whl.

File metadata

  • Download URL: phishradar-0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for phishradar-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7e8d8ab8391fe73691272fb58a28d0873cce33d330eb8a54f6872b5c133de3
MD5 81080b463258c605086ed0bdcb871a36
BLAKE2b-256 567e5de55d5aa435b96c28da5ac17a6cef810c13fd755861bdc0e38ba0d203bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page