/waf_chunk

分块传输插件绕WAF

Primary LanguagePython

def assemble_body(headers, body_chunks):                                                                         
    if "chunked" in headers.get("transfer-encoding", "").lower() and  'test' not in headers.get("test", "").lower():                                                                                                               
        for chunk in body_chunks:                                                                                
            if chunk:                                                                                            
                yield b"%x\r\n%s\r\n" % (len(chunk), chunk)                                                      
        yield b"0\r\n\r\n"                                                                                       
    else:                                                                                                        
        for chunk in body_chunks:                                                                                
            yield chunk