id: besu-server-detect

info:
  name: Besu JSON-RPC HTTP Server - Detect
  author: Nullfuzz
  severity: info
  description: |
    Besu is an open source Ethereum client developed under the Apache 2.0 license and written in Java. By default Besu runs a JSON-RPC HTTP server on port 8545/TCP
  reference:
    - https://besu.hyperledger.org/
    - https://besu.hyperledger.org/public-networks/how-to/use-besu-api#service-ports
  metadata:
    verified: true
    max-request: 1
    shodan-query: product:"besu"
  tags: tech,besu,ethereum,web3,blockchain,discovery

http:
  - raw:
      - |
        POST / HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"method":"web3_clientVersion","params":[],"id":1,"jsonrpc":"2.0"}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(header, "application/json")'
          - 'contains(body, "besu")'
        condition: and

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - '(v[0-9.]+)'
# digest: 4a0a0047304502205099b16c8704c567e9925d880135f4ff3904134f4bcbec1f16cdd8e5ebca2e92022100a6a298ad0405c9a9b7af1a90cb20ac036fb862113b85056a6be9b2e35f727e9d:922c64590222798bb761d5b6d8e72950