id: servicenow-helpdesk-credential

info:
  name: ServiceNow Helpdesk Credential Exposure
  author: ok_bye_now
  severity: high
  description: Detection of exposed credentials in help the help desk JS file.
  reference:
    - https://jordanpotti.com/2021/02/21/ServiceNow-HelpTheHelpDeskAndTheHackers/
  metadata:
    max-request: 1
  tags: servicenow,exposure

http:
  - method: GET
    path:
      - "{{RootURL}}/HelpTheHelpDesk.jsdbx"

    host-redirects: true
    max-redirects: 2

    matchers-condition: and
    matchers:
      - type: word
        words:
          - 'var httpPassword = "encrypt:'

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        group: 1
        regex:
          - 'var server = "([a-z:/0-9.-]+)"'
# digest: 4b0a00483046022100e013ae4303135a622900ee1bbe3451683ffd227664cb8620584e8e722c468fa80221008cbed8bc48dde2ac9ace8a8f1f8112cf9663de85499caea77a09129f8dd12606:922c64590222798bb761d5b6d8e72950