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.2.tar.gz (8.7 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.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for phishradar-0.2.tar.gz
Algorithm Hash digest
SHA256 d0f38efdb0439753f8c585f45c437d0ece32269b3c1b49c586af1ea4e8bcff53
MD5 b1d2dde2d829eaf44b2d52a93e046f39
BLAKE2b-256 588d8c0a2f43b15feec93474ea7ab75f2462f00cf4861002a2eb428a84a230d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phishradar-0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c670ab89a2f0d9adec4a07a216184d5218d6100f9bf6b656bd383ec8e7439c9
MD5 70c3e3a2b6989b34f594835bd0b5cf7a
BLAKE2b-256 509705698e6b712c19626f31a7ba9e82c425de63e3dd5af47018a2c3f72eb4b8

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