full page read is not needed in DNS exfiltration mode

This commit is contained in:
Miroslav Stampar 2012-05-26 21:28:43 +00:00
parent 4e6fcce9ca
commit 09f2144485

View File

@ -124,16 +124,19 @@ class Connect:
@staticmethod @staticmethod
def __connReadProxy(conn): def __connReadProxy(conn):
retVal = "" retVal = ""
while True:
_ = conn.read(MAX_CONNECTION_CHUNK_SIZE) if not kb.dnsMode:
if len(_) == MAX_CONNECTION_CHUNK_SIZE: while True:
warnMsg = "large response detected. This could take a while" _ = conn.read(MAX_CONNECTION_CHUNK_SIZE)
singleTimeWarnMessage(warnMsg) if len(_) == MAX_CONNECTION_CHUNK_SIZE:
_ = re.sub(r"(?si)%s.+?%s" % (kb.chars.stop, kb.chars.start), "%s%s%s" % (kb.chars.stop, LARGE_CHUNK_TRIM_MARKER, kb.chars.start), _) warnMsg = "large response detected. This could take a while"
retVal += _ singleTimeWarnMessage(warnMsg)
else: _ = re.sub(r"(?si)%s.+?%s" % (kb.chars.stop, kb.chars.start), "%s%s%s" % (kb.chars.stop, LARGE_CHUNK_TRIM_MARKER, kb.chars.start), _)
retVal += _ retVal += _
break else:
retVal += _
break
return retVal return retVal
@staticmethod @staticmethod