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

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: 4b0a0048304602210084b74ddec13a5494f0fee066000c76bc565a7cb3e0985c4bd0725716e86cb034022100e449d5fea34d334f574e008dd9f5b5bec2d2700fae1f7f3adfa49d67073b9e44:922c64590222798bb761d5b6d8e72950