id: dnsmasq-config

info:
  name: Dnsmasq Config - File Disclosure
  author: DhiyaneshDk
  severity: low
  description: |
    Dnsmasq Config file is exposed.
  reference:
    - https://github.com/imp/dnsmasq/blob/master/dnsmasq.conf.example
  metadata:
    verified: true
    max-request: 1
    fofa-query: body="dnsmasq.conf" && title="index"
  tags: exposure,dnsmasq,files,config

http:
  - method: GET
    path:
      - '{{BaseURL}}/dnsmasq.conf'

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_any(content_type, "application/octet-stream","application/x-zip-compressed","text/plain")'
          - 'contains_all(body, "server=/","ipset=/")'
        condition: and

      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_any(content_type, "application/octet-stream","application/x-zip-compressed","text/plain")'
          - 'contains_all(body, "dhcp-range=","dhcp-authoritative")'
        condition: and
# digest: 4a0a00473045022100e269a10d4f83f9fe457da6ff5c0186d1acc07a664e8c13f64d33184570345f11022077205a0670da3ea223206ae65daaca30ca093505cebd7bb8cffeefb42db6d6d5:922c64590222798bb761d5b6d8e72950