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

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: 490a00463044022040d9cdbb173797234d9eb4f5b85fd69276d7b657188f0d5d631187de0979e2c202205f825bf5fdcdeb079690e739ae107bbda74951e0e69d4e27548ddd9cac3c7abd:922c64590222798bb761d5b6d8e72950