nopasaran 0.2.110__tar.gz → 0.2.112__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nopasaran-0.2.110 → nopasaran-0.2.112}/PKG-INFO +1 -1
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/udp_dns_socket_server.py +36 -20
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran.egg-info/PKG-INFO +1 -1
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran.egg-info/requires.txt +1 -1
- {nopasaran-0.2.110 → nopasaran-0.2.112}/setup.py +1 -1
- {nopasaran-0.2.110 → nopasaran-0.2.112}/LICENSE +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/README.md +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/__main__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/controllers/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/controllers/controller.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/controllers/factory.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/controllers/protocol.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/decorators.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/definitions/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/definitions/commands.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/definitions/control_channel.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/definitions/events.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/definitions/transitions.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/errors/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/errors/parsing_error.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/http_2_utils.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/interpreters/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/interpreters/action_interpreter.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/interpreters/condition_interpreter.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/interpreters/interpreter.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/interpreters/transition_interpreter.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/machines/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/machines/action_queue.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/machines/state_machine.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/parsers/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/parsers/interpreter_parser.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/parsers/state_machine_parser.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/action_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/certificate_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/client_echo_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/control_channel_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/data_channel_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/data_manipulation.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/dns_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/event_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/http_1_request_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/http_1_response_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/http_2_client_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/http_2_server_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/http_simple_client_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/https_1_request_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/https_1_response_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/icmp_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/io_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/ip_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/nested_machine_utils.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/probing_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/replay_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/server_echo_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/signaling_primitive.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/tcp_dns_request_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/tcp_dns_response_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/tcp_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/timing_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/tls_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/udp_dns_request_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/udp_dns_response_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/udp_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/condition_primitives/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/condition_primitives/condition_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/condition_primitives/variable_comparisons.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/transition_primitives/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/transition_primitives/assignment_transitions.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/transition_primitives/transition_primitives.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/sniffers/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/sniffers/sniffer.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/__init__.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/checks.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/echo_socket_server.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/http_1_socket_server.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/http_2_overwrite.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/http_2_socket_base.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/http_2_socket_client.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/http_2_socket_server.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/https_1_socket_server.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/tools/tcp_dns_socket_server.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/utils.py +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran.egg-info/SOURCES.txt +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran.egg-info/dependency_links.txt +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran.egg-info/entry_points.txt +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran.egg-info/top_level.txt +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/setup.cfg +0 -0
- {nopasaran-0.2.110 → nopasaran-0.2.112}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nopasaran
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.112
|
4
4
|
Summary: NoPASARAN is an advanced network tool designed to detect, fingerprint, and locate network middleboxes in a unified framework.
|
5
5
|
Home-page: https://github.com/BenIlies/NoPASARAN
|
6
6
|
Author: Ilies Benhabbour
|
@@ -2,6 +2,7 @@ import socket
|
|
2
2
|
from dnslib import DNSRecord, RR, QTYPE, A, CNAME, MX, TXT, NS, SOA, PTR, AAAA, SRV, DS, RRSIG, NSEC, DNSKEY
|
3
3
|
from nopasaran.definitions.events import EventNames
|
4
4
|
import logging
|
5
|
+
import time
|
5
6
|
|
6
7
|
class UDPDNSSocketServer:
|
7
8
|
def __init__(self):
|
@@ -18,31 +19,46 @@ class UDPDNSSocketServer:
|
|
18
19
|
self.sock.settimeout(timeout)
|
19
20
|
logging.info(f"Waiting for UDP packets on port {self.sock.getsockname()[1]} with timeout {timeout} seconds")
|
20
21
|
|
21
|
-
|
22
|
-
data, client_addr = self.sock.recvfrom(512) # max size of a DNS UDP packet
|
23
|
-
logging.debug(f"Received {len(data)} bytes from {client_addr}")
|
22
|
+
start_time = time.time()
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
while True:
|
25
|
+
try:
|
26
|
+
remaining_time = timeout - (time.time() - start_time)
|
27
|
+
if remaining_time <= 0:
|
28
|
+
logging.warning("Timeout reached while waiting for a valid DNS query.")
|
29
|
+
return {"received": None}, EventNames.TIMEOUT.name
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
+
self.sock.settimeout(remaining_time)
|
32
|
+
data, client_addr = self.sock.recvfrom(512) # max size of a DNS UDP packet
|
33
|
+
logging.debug(f"Received {len(data)} bytes from {client_addr}")
|
31
34
|
|
32
|
-
|
33
|
-
|
34
|
-
logging.info("DNS response sent successfully.")
|
35
|
+
logging.debug("Parsing DNS query...")
|
36
|
+
parsed_query = DNSRecord.parse(data)
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
# Check if query section is empty
|
39
|
+
if not parsed_query.questions:
|
40
|
+
logging.debug("Received DNS packet with no query section. Continuing to wait...")
|
41
|
+
continue
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
logging.info(f"Parsed query:\n{parsed_query.toZone()}")
|
44
|
+
|
45
|
+
logging.debug("Building DNS response...")
|
46
|
+
response = self.build_response(parsed_query, response_spec)
|
47
|
+
|
48
|
+
logging.debug("Sending DNS response...")
|
49
|
+
self.send_dns_response(client_addr, response)
|
50
|
+
logging.info("DNS response sent successfully.")
|
51
|
+
|
52
|
+
return {
|
53
|
+
"received": str(parsed_query.q)
|
54
|
+
}, EventNames.REQUEST_RECEIVED.name
|
55
|
+
|
56
|
+
except socket.timeout:
|
57
|
+
logging.warning("Timeout reached while waiting for a valid DNS query.")
|
58
|
+
return {"received": None}, EventNames.TIMEOUT.name
|
59
|
+
except Exception as e:
|
60
|
+
logging.error(f"Error while handling DNS query: {e}", exc_info=True)
|
61
|
+
return {"received": None}, EventNames.ERROR.name
|
46
62
|
|
47
63
|
def build_response(self, query_record, response_spec=None):
|
48
64
|
qname = str(query_record.q.qname)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nopasaran
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.112
|
4
4
|
Summary: NoPASARAN is an advanced network tool designed to detect, fingerprint, and locate network middleboxes in a unified framework.
|
5
5
|
Home-page: https://github.com/BenIlies/NoPASARAN
|
6
6
|
Author: Ilies Benhabbour
|
@@ -13,7 +13,7 @@ with open(requirements_file, "r") as f:
|
|
13
13
|
# Version will automatically be updated when pushed on the main branch
|
14
14
|
setup(
|
15
15
|
name="nopasaran",
|
16
|
-
version='0.2.
|
16
|
+
version='0.2.112',
|
17
17
|
author="Ilies Benhabbour",
|
18
18
|
author_email="ilies.benhabbour@kaust.edu.sa",
|
19
19
|
description="NoPASARAN is an advanced network tool designed to detect, fingerprint, and locate network middleboxes in a unified framework.",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/action_primitives.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/data_manipulation.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/dns_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/event_primitives.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/icmp_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/io_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/ip_primitives.py
RENAMED
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/probing_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/replay_primitives.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/tcp_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/timing_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/tls_primitives.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/action_primitives/udp_primitives.py
RENAMED
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/condition_primitives/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{nopasaran-0.2.110 → nopasaran-0.2.112}/nopasaran/primitives/transition_primitives/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|