id: torrent-magnet-detect

info:
  name: Torrent Magnet - Detect
  author: rxerium
  severity: info
  description: |
    Detects magnet links present on a website, which are commonly used for torrenting.
  reference:
    - https://www.zdnet.com/article/what-is-torrenting-and-how-does-it-work/
  metadata:
    verified: true
    max-request: 1
  tags: torrent,website,detect,piracy,osint

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    max-redirects: 1
    redirects: true

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "magnet:?xt=urn:btih:"

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: magnet-link
        part: body
        regex:
          - "magnet:\\?xt=urn:btih:[a-zA-Z0-9]*[^\"'\\s<]*"
# digest: 4b0a00483046022100d78f1a2c50c3708b9734da1a9fee27cf2a46ea5f8d73b09096ecdabc3ef47066022100f1908592153719dfa3d515de2a4f4ed4fd242115a87291a9bfc4855cd84cc3dd:922c64590222798bb761d5b6d8e72950