id: rsync-version

info:
  name: Rsync Version - Detect
  author: DhiyaneshDK
  severity: info
  description: |
    Identify the Version of the Rsync Protocol
  metadata:
    verified: true
    max-request: 1
    shodan-query: port:"873"
  tags: js,network,rsync,enum,discovery

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);
    code: |
      let m = require('nuclei/rsync');
      let response = m.IsRsync(Host,Port);
      Export(response);

    args:
      Host: "{{Host}}"
      Port: 873

    matchers:
      - type: dsl
        dsl:
          - "len(version) != 0"

    extractors:
      - type: json
        name: version
        json:
          - .Banner
# digest: 4b0a00483046022100d6a9183a5481b727caa7583612d4318e591417947ce6b998cb3645d66e10b4a1022100c996bfbaace4fbce6587ed44d18bd94038c68bfd2e42d2b67e2819e0ae36fb23:922c64590222798bb761d5b6d8e72950