id: wordpress-ad-inserter

info:
  name: Ad Inserter – Ad Manager & AdSense Ads Detection
  author: ricardomaia
  severity: info
  reference:
    - https://wordpress.org/plugins/ad-inserter/
  metadata:
    plugin_namespace: ad-inserter
    wpscan: https://wpscan.com/plugin/ad-inserter
  tags: tech,wordpress,wp-plugin,top-200,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/ad-inserter/readme.txt"

    payloads:
      last_version: helpers/wordpress/plugins/ad-inserter.txt

    extractors:
      - type: regex
        part: body
        internal: true
        name: internal_detected_version
        group: 1
        regex:
          - '(?i)Stable.tag:\s?([\w.]+)'

      - type: regex
        part: body
        name: detected_version
        group: 1
        regex:
          - '(?i)Stable.tag:\s?([\w.]+)'

    matchers-condition: or
    matchers:
      - type: dsl
        name: "outdated_version"
        dsl:
          - compare_versions(internal_detected_version, concat("< ", last_version))

      - type: regex
        part: body
        regex:
          - '(?i)Stable.tag:\s?([\w.]+)'
# digest: 4a0a00473045022100979a29997c09e92de2b83955bb9734a3699f5b17c45e65352a0be7b3a54dc6b00220118e01f19b0c19bf8a4ebba14b3e1195ba7677a23e69b7753095c5f234eb9893:922c64590222798bb761d5b6d8e72950