Skip to content

Commit 09f2144

Browse files
committed
full page read is not needed in DNS exfiltration mode
1 parent 4e6fcce commit 09f2144

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

lib/request/connect.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,19 @@ def __retryProxy(**kwargs):
124124
@staticmethod
125125
def __connReadProxy(conn):
126126
retVal = ""
127-
while True:
128-
_ = conn.read(MAX_CONNECTION_CHUNK_SIZE)
129-
if len(_) == MAX_CONNECTION_CHUNK_SIZE:
130-
warnMsg = "large response detected. This could take a while"
131-
singleTimeWarnMessage(warnMsg)
132-
_ = 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), _)
133-
retVal += _
134-
else:
135-
retVal += _
136-
break
127+
128+
if not kb.dnsMode:
129+
while True:
130+
_ = conn.read(MAX_CONNECTION_CHUNK_SIZE)
131+
if len(_) == MAX_CONNECTION_CHUNK_SIZE:
132+
warnMsg = "large response detected. This could take a while"
133+
singleTimeWarnMessage(warnMsg)
134+
_ = 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), _)
135+
retVal += _
136+
else:
137+
retVal += _
138+
break
139+
137140
return retVal
138141

139142
@staticmethod

0 commit comments

Comments
 (0)