id: wordpress-git-config

info:
  name: Wordpress Git Config
  author: nerrorsec
  severity: info
  description: Searches for the pattern /.git/config inside themes and plugins folder.
  reference:
    - https://hackerone.com/reports/248693
  metadata:
    max-request: 2
  tags: hackerone,config,git,exposure,wordpress,wp-plugin,wp-theme

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/.git/config"
      - "{{BaseURL}}/wp-content/themes/.git/config"

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "[core]"

      - type: dsl
        dsl:
          - "!contains(tolower(body), '<html')"
          - "!contains(tolower(body), '<body')"
        condition: and

      - type: status
        status:
          - 200
# digest: 4a0a00473045022100ba7198d863c7b22dc43ffb3b53b2a27f5a521c7ecd6d77430af1ee8dfc1e29bf0220667a9a594cf7aede5affcfffe54e59ac9377b5ebcefbffec4e5485e374762ddf:922c64590222798bb761d5b6d8e72950