Skip to content

Commit f5ee402

Browse files
committed
Fixes CI/CD issue
1 parent 87a3a2e commit f5ee402

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

data/txt/sha256sums.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ ccc4a717e887652b1fcce073d9409d9c59a3b28548c703a9e453d15845f90cd7 lib/core/patch
189189
9bf174058f15d14e24e94f9aaf42df045119d3617c6c54bd2f3af79b462f331d lib/core/replication.py
190190
0b8c38a01bb01f843d94a6c5f2075ee47520d0c4aa799cecea9c3e2c5a4a23a6 lib/core/revision.py
191191
888daba83fd4a34e9503fe21f01fef4cc730e5cde871b1d40e15d4cbc847d56c lib/core/session.py
192-
61354a9fbf94b67744b3a850475ff8ec7408979f23e2709d1f15b4642021d673 lib/core/settings.py
192+
c041ad865180b79c4b3e798530638d00ca1f9fa14e4c9e1506a2bf7c8c811b9f lib/core/settings.py
193193
c7804223319e18eb0b8e2cbf0a8b6896d1cefb7b0b1a2e9f1cf826a8a3b56750 lib/core/shell.py
194194
a2e98a94b231432736d6b304fc75525c8b5fdb4768c418387c5b4c1a610dad64 lib/core/subprocessng.py
195195
19f1e3c5e3ba703d28d510cd7a9ab8284d5fbe9df5ce7e77c86e5931571364b7 lib/core/target.py
@@ -587,7 +587,7 @@ a48c411fea864e6bcd6a1c7e1a35094b8cda8d15088fd9e7b0270542ae20daa9 tests/test_com
587587
9c0a0cd0b2d52a53f75c98c60f87a022354b7c3dc4baaf3fe1e272a0af5b7f0a tests/test_dialectdbms.py
588588
e40a49cfa73c45b3c3c6d1d1d00738861e270cb7a07b28f5a5356f9c7c800cf2 tests/test_dialect.py
589589
993a2d4d87c4fbaf261663b069629acc95ee4405aa0c42cf5a8f39649fdb0fff tests/test_dicts.py
590-
a38f3257aa218fa706ddb903c181715b2286619c46aea0097b7d365d18c410c5 tests/test_dns_engine.py
590+
7f12466974394312dad3d98651ef8a50d1585bee0f8cd25da0b77b08c2047e46 tests/test_dns_engine.py
591591
703faac01f38224ba85bd0fc398d939ea034f1d7fd641cdc15da4f77ec049443 tests/test_dns_server.py
592592
9cd5841349bc4db818658d12184929a96f7f279eff1f53ad18a54dbefbd6b276 tests/test_dump_jsonl.py
593593
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.6.144"
23+
VERSION = "1.10.6.145"
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)

tests/test_dns_engine.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
import lib.techniques.dns.use as dnsmod
5353
import lib.techniques.dns.test as dnstestmod
5454

55-
DNS_PORT = 5355
56-
5755
def _build_query(name, tid=b"\x12\x34"):
5856
pkt = tid + b"\x01\x00" + b"\x00\x01" + b"\x00\x00" + b"\x00\x00" + b"\x00\x00"
5957
for label in name.split("."):
@@ -63,15 +61,23 @@ def _build_query(name, tid=b"\x12\x34"):
6361

6462
class _HighPortDNSServer(DNSServer):
6563
# same logic as the real server (parse/pop/run), just bound high so no root is needed
66-
def __init__(self, port):
64+
def __init__(self, port=0):
6765
self._requests = []
6866
self._lock = threading.Lock()
6967
self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
7068
self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
7169
self._socket.bind(("127.0.0.1", port))
70+
self.port = self._socket.getsockname()[1]
7271
self._running = False
7372
self._initialized = False
7473

74+
def close(self):
75+
self._running = False
76+
try:
77+
self._socket.close()
78+
except socket.error:
79+
pass
80+
7581
_CONF = {"dnsDomain": "exfil.test", "hexConvert": False, "api": False, "verbose": 0, "forceDns": False}
7682
_KB = {"dnsTest": True, "dnsMode": False, "bruteMode": False, "safeCharEncode": False}
7783

@@ -81,11 +87,18 @@ class _DnsCase(unittest.TestCase):
8187

8288
@classmethod
8389
def setUpClass(cls):
84-
cls.server = _HighPortDNSServer(DNS_PORT)
90+
cls.server = _HighPortDNSServer()
8591
cls.server.run()
8692
while not cls.server._initialized:
8793
time.sleep(0.02)
8894

95+
@classmethod
96+
def tearDownClass(cls):
97+
server = getattr(cls, "server", None)
98+
if server is not None:
99+
server.close()
100+
cls.server = None
101+
89102
def setUp(self):
90103
self._saved_conf = {k: conf.get(k) for k in _CONF}
91104
self._saved_kb = {k: kb.get(k) for k in _KB}
@@ -156,7 +169,7 @@ def oracle(payload=None, *args, **kwargs):
156169
host = "%s.%s.%s.%s" % (prefix, binascii.hexlify(chunk).decode(), suffix, conf.dnsDomain)
157170
c = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
158171
c.settimeout(3)
159-
c.sendto(_build_query(host), ("127.0.0.1", DNS_PORT))
172+
c.sendto(_build_query(host), ("127.0.0.1", self.server.port))
160173
try:
161174
c.recvfrom(512)
162175
finally:

0 commit comments

Comments
 (0)