id: redis-require-auth

info:
  name: Redis Require Authentication - Detect
  author: DhiyaneshDK
  severity: info
  description: |
    IsAuthenticated checks if the redis server requires authentication
  reference:
    - https://docs.projectdiscovery.io/templates/protocols/javascript/modules/redis#isauthenticated
  metadata:
    max-request: 1
    shodan-query:
      - product:"redis"
      - http.title:"airflow - dags" || http.html:"apache airflow"
      - http.title:"sign in - airflow"
    product: airflow
    vendor: apache
    fofa-query:
      - apache airflow
      - title="airflow - dags" || http.html:"apache airflow"
      - title="sign in - airflow"
    google-query:
      - intitle:"airflow - dags" || http.html:"apache airflow"
      - intitle:"sign in - airflow"
  tags: js,redis,network,enum

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);
    code: |
      const redis = require('nuclei/redis');
      const isAuthenticated = redis.IsAuthenticated(Host,Port);
      Export(isAuthenticated);

    args:
      Host: "{{Host}}"
      Port: "6379"

    matchers:
      - type: dsl
        dsl:
          - "success == true"
# digest: 4a0a004730450221008c7ef844d43781250504b834bb69ee1aee80df875dd107c3339b68a2ed0063ca022043df5116aa4afb77f0542b03ceeaceb10a0015f79a6978bb9d253ae0f649c688:922c64590222798bb761d5b6d8e72950