1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-18 15:14:10 +01:00

Fix meterpreter.py indentation

Commit b5372d2a98a47509b2ddf0b60a90de5a43f32f23 messed up the indentation
(mixing spaces and tabs) for some parts of the code. This commit fixes it.
This commit is contained in:
Jonas Lieb 2018-01-09 10:43:26 +01:00
parent 95f594c2c0
commit cd433fb2cf

@ -642,21 +642,21 @@ class HttpTransport(Transport):
packet = None packet = None
xor_key = None xor_key = None
request = urllib.Request(self.url, None, self._http_request_headers) request = urllib.Request(self.url, None, self._http_request_headers)
try: try:
url_h = urllib.urlopen(request, timeout=self.communication_timeout) url_h = urllib.urlopen(request, timeout=self.communication_timeout)
packet = url_h.read() packet = url_h.read()
for _ in range(1): for _ in range(1):
if packet == '': if packet == '':
break break
if len(packet) < PACKET_HEADER_SIZE: if len(packet) < PACKET_HEADER_SIZE:
packet = None # looks corrupt packet = None # looks corrupt
break break
xor_key = struct.unpack('BBBB', packet[:PACKET_XOR_KEY_SIZE]) xor_key = struct.unpack('BBBB', packet[:PACKET_XOR_KEY_SIZE])
header = xor_bytes(xor_key, packet[:PACKET_HEADER_SIZE]) header = xor_bytes(xor_key, packet[:PACKET_HEADER_SIZE])
pkt_length = struct.unpack('>I', header[PACKET_LENGTH_OFF:PACKET_LENGTH_OFF+PACKET_LENGTH_SIZE])[0] - 8 pkt_length = struct.unpack('>I', header[PACKET_LENGTH_OFF:PACKET_LENGTH_OFF+PACKET_LENGTH_SIZE])[0] - 8
if len(packet) != (pkt_length + PACKET_HEADER_SIZE): if len(packet) != (pkt_length + PACKET_HEADER_SIZE):
packet = None # looks corrupt packet = None # looks corrupt
except: except:
debug_traceback('Failure to receive packet from ' + self.url) debug_traceback('Failure to receive packet from ' + self.url)
if not packet: if not packet: