MCPcopy
hub / github.com/0x727/ShuiZe_0x727 / parse

Method parse

Plugins/Vul/CMS/Tomcat_AJP_LFI.py:186–199  ·  view source on GitHub ↗
(self, stream)

Source from the content-addressed store, hash-verified

184 "Location", "Set-Cookie", "Set-Cookie2", "Servlet-Engine", "Status", "WWW-Authenticate"
185 ]
186 def parse(self, stream):
187 # read headers
188 self.magic, self.data_length, self.prefix_code = unpack(stream, ">HHb")
189
190 if self.prefix_code == AjpResponse.SEND_HEADERS:
191 self.parse_send_headers(stream)
192 elif self.prefix_code == AjpResponse.SEND_BODY_CHUNK:
193 self.parse_send_body_chunk(stream)
194 elif self.prefix_code == AjpResponse.END_RESPONSE:
195 self.parse_end_response(stream)
196 elif self.prefix_code == AjpResponse.GET_BODY_CHUNK:
197 self.parse_get_body_chunk(stream)
198 else:
199 raise NotImplementedError
200
201 def parse_send_headers(self, stream):
202 self.http_status_code, = unpack(stream, ">H")

Callers 3

receiveMethod · 0.95
read_xml_payloadsFunction · 0.45
read_xml_errorsFunction · 0.45

Calls 5

parse_send_headersMethod · 0.95
parse_send_body_chunkMethod · 0.95
parse_end_responseMethod · 0.95
parse_get_body_chunkMethod · 0.95
unpackFunction · 0.85

Tested by

no test coverage detected