id: geth-server-detect

info:
  name: Go Ethereum JSON-RPC HTTP Server - Detect
  author: Nullfuzz
  severity: info
  description: |
    Go-ethereum (aka Geth) is an Ethereum client built in Go. Geth runs a JSON-RPC HTTP server on port 8545/TCP
  reference:
    - https://geth.ethereum.org/docs
    - https://github.com/ethereum/go-ethereum
  metadata:
    verified: true
    max-request: 1
    shodan-query: product:"Geth"
  tags: tech,geth,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, "Geth")'
        condition: and

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