id: xff-403-bypass

info:
  name: X-Forwarded-For 403-forbidden bypass
  author: vavkamil
  severity: info
  description: Template to detect 403 forbidden endpoint bypass behind Nginx/Apache proxy & load balancers, based on X-Forwarded-For header.
  metadata:
    max-request: 3
  tags: fuzzing,xff-403-bypass,vuln

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Accept: */*

      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Accept: */*
        X-Forwarded-For: 127.0.0.1, 0.0.0.0, 192.168.0.1, 10.0.0.1, 172.16.0.1

    matchers:
      - type: dsl
        dsl:
          - "status_code_1 == 403 && status_code_2 != 403"
# digest: 4a0a00473045022100bb66f17033680ed9f2457b855aa7208a5db6a26cd16d803f13c203dcea51963d022077542910d0bb95abbbf5d5c63c1f1c1515594fe97f5c5d8d3f0ac4be655589c3:922c64590222798bb761d5b6d8e72950