id: teslamate-unauth-access

info:
  name: TeslaMate - Unauthenticated Access
  author: For3stCo1d
  severity: medium
  description: |
    A misconfig in Teslamate allows unauthorized access to /settings endpoint.
  classification:
    cpe: cpe:2.3:a:teslamate_project:teslamate:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: teslamate_project
    product: teslamate
    shodan-query: http.favicon.hash:-1478287554
    fofa-query: title="teslamate"
  tags: misconfig,teslamate,unauth

http:
  - method: GET
    path:
      - "{{BaseURL}}/settings"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "Settings · TeslaMate"
          - "URLs</h2>"
        condition: and

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - "<td>([0-9.]+)<strong>"
# digest: 490a00463044022008ad38323c61deeaf638f915bdd66684125f2cc2a94b51e3a5e934996d967ff4022047b5379249be90dc7fbfab2b6bd6730526e29c706fec51d1df377ba9034adb8e:922c64590222798bb761d5b6d8e72950