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