Skip to content

Commit 7fd6bb3

Browse files
committed
Minor update
1 parent 103a0e6 commit 7fd6bb3

4 files changed

Lines changed: 26 additions & 17 deletions

File tree

data/txt/sha256sums.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ c2db614a3ce7dda889152bea8bd6d709e5d8c2b556741fdbfe44469f27ce266b lib/core/enums
189189
9bf174058f15d14e24e94f9aaf42df045119d3617c6c54bd2f3af79b462f331d lib/core/replication.py
190190
0b8c38a01bb01f843d94a6c5f2075ee47520d0c4aa799cecea9c3e2c5a4a23a6 lib/core/revision.py
191191
888daba83fd4a34e9503fe21f01fef4cc730e5cde871b1d40e15d4cbc847d56c lib/core/session.py
192-
d9b2dc6104456fa679f827d16baeb1ed7ca377a961d163d12cd2b7eba09f24c6 lib/core/settings.py
192+
415708a1c10d98f964bc34ddd8dd597ec0ebb216a6e3f3aad391d9283d499f89 lib/core/settings.py
193193
c7804223319e18eb0b8e2cbf0a8b6896d1cefb7b0b1a2e9f1cf826a8a3b56750 lib/core/shell.py
194194
a2e98a94b231432736d6b304fc75525c8b5fdb4768c418387c5b4c1a610dad64 lib/core/subprocessng.py
195195
15d36cdac9389d0a54a6c33fbb89f32bb65e303f50de573773dcb6d4618bca64 lib/core/target.py
@@ -215,7 +215,7 @@ bc61bc944b81a7670884f82231033a6ac703324b34b071c9834886a92e249d0e lib/request/ch
215215
4fd1957e31b14e7670b09d85a634fa6772a1cd90babe149f39a1c945fe306f0a lib/request/comparison.py
216216
4a3b997a83b1724e8bd025be95ec5d84c6bf41d533ba097fcab1eab763352111 lib/request/connect.py
217217
8e06682280fce062eef6174351bfebcb6040e19976acff9dc7b3699779783498 lib/request/direct.py
218-
b1f07e0571f249eedf294b7827c530b0de8c0524d445b33fdb2d0a639c0f123a lib/request/dns.py
218+
c968a04d3de9256d56c423d46556441223607e4573627f2af4e772e084aef5fc lib/request/dns.py
219219
7344978ac1c52060716b7837c88a62768c6a445eafe189ea3232b8a498fdd038 lib/request/http2.py
220220
92c81cc31ff4a396723242058fb2152c9e9745f8412d01ea74480b048a53af6c lib/request/httpshandler.py
221221
1966ca704961fb987ab757f0a4afddbf841d1a880631b701487c75cef63d60c3 lib/request/__init__.py
@@ -613,7 +613,7 @@ fa85881aa8d082a65aeacb2b03fcb5d2abb1daa9a02ee24ff048d54fbc904b90 tests/test_dia
613613
41bb0981cb7372753dbaa328c8be3678d328b736e6b97f7bd2573b465753af01 tests/test_dialect.py
614614
993a2d4d87c4fbaf261663b069629acc95ee4405aa0c42cf5a8f39649fdb0fff tests/test_dicts.py
615615
62a4386524d0ef269cba3bd6dcadc5a2a11c0d2bdd198773b79bcd8589324328 tests/test_dns_engine.py
616-
a9db98cbb4d16c42118fb6f612edd5bfedc77298e38d06d50e7ecc2faaa7fdc1 tests/test_dns_server.py
616+
6047483d7fb41e0dbf4b067394d8a9e2b39b99faf473db963de6f2f67c052b03 tests/test_dns_server.py
617617
3dc788fd3adba8b6f766281e0a50025b1ee9150d80ab9a738c6c43f2eaf805b3 tests/test_dump_format.py
618618
118d1987861ed0df978474329adce8c23009b3964210c13fbaf667e0019bbd15 tests/test_dump_jsonl.py
619619
2bbe4b01f79992cfa8884651fc0a28dbd0e3abb0cbea9eb7eadf1f98ca3c3420 tests/test_encoding.py

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty import six
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.10.7.26"
23+
VERSION = "1.10.7.27"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/request/dns.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ class InteractshDNSServer(object):
235235
is a drop-in for conf.dnsServer.
236236
"""
237237

238+
_POLL_TRIES = 6 # a triggered lookup surfaces at interactsh within a couple of seconds;
239+
_POLL_DELAY = 1.0 # poll up to ~6s per retrieval before treating the channel as silent
240+
238241
def __init__(self, server=None):
239242
from lib.request.interactsh import Interactsh, hasCrypto
240243

@@ -259,25 +262,30 @@ def pop(self, prefix=None, suffix=None):
259262
"""
260263
Returns a captured DNS lookup name matching the given prefix/suffix
261264
(prefix.<query result>.suffix.<correlation domain>), mirroring DNSServer.pop().
265+
266+
Unlike the synchronous local DNSServer (which reads a query captured during the
267+
very request), interactsh is remote and eventually-consistent: a just-triggered
268+
lookup takes a moment to reach the collector and surface via its poll API. So we
269+
poll a few times before giving up, instead of reading once.
262270
"""
263271

264-
retVal = None
272+
for attempt in range(self._POLL_TRIES):
273+
for name in self._client.dnsNames():
274+
if name in self._seen:
275+
continue
265276

266-
for name in self._client.dnsNames():
267-
if name in self._seen:
268-
continue
277+
if prefix is None and suffix is None:
278+
self._seen.add(name)
279+
return name
269280

270-
if prefix is None and suffix is None:
271-
self._seen.add(name)
272-
retVal = name
273-
break
281+
if prefix and suffix and re.search(r"%s\..+\.%s" % (re.escape(prefix), re.escape(suffix)), name, re.I):
282+
self._seen.add(name)
283+
return name
274284

275-
if prefix and suffix and re.search(r"%s\..+\.%s" % (re.escape(prefix), re.escape(suffix)), name, re.I):
276-
self._seen.add(name)
277-
retVal = name
278-
break
285+
if attempt < self._POLL_TRIES - 1:
286+
time.sleep(self._POLL_DELAY)
279287

280-
return retVal
288+
return None
281289

282290
if __name__ == "__main__":
283291
server = None

tests/test_dns_server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def dnsNames(self): return list(names)
342342
srv._seen = set()
343343
srv._running = True
344344
srv._initialized = True
345+
srv._POLL_TRIES = 1 # no real sleeps in unit tests
345346
return srv
346347

347348
def test_pop_matches_prefix_suffix_and_dedups(self):

0 commit comments

Comments
 (0)