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,vuln

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: 4a0a0047304502204589f02ade27901ed6adcb92c2db641c7d1155bfe34c80af8ed41894ebb08c46022100e782a6f1f31e682f48476a2ab878fbedd01276dfa95f807beb081be3f0e58365:922c64590222798bb761d5b6d8e72950