2 Commits

Author SHA1 Message Date
Mohit Gupta 1d2137c0f9 bumps to 1.0.1 2026-04-27 12:49:10 +01:00
Mohit Gupta e1b12cc8cd supports PTR 2026-04-27 12:48:04 +01:00
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "encap-attack"
version = "1.0.0"
version = "1.0.1"
license = {file = "LICENSE"}
description = "Network sniffing and attacks using IP-in-IP and VXLAN"
requires-python = ">= 3.7"
+2 -2
View File
@@ -140,7 +140,7 @@ def ipip_http(ctx, dst_port: int, http_request: str) -> None:
ctx.obj["model"].sendHTTP(http_request, ctx.obj["dst_ip"], dst_port=dst_port, src_port=ctx.obj["src_port"])
@ipip_request.command("dns")
@click.option("-t", "--query-type", type=click.Choice(["SRV", "A", "AAAA", "CNAME"]), help="DNS record query type", required=True)
@click.option("-t", "--query-type", type=click.Choice(["SRV", "A", "AAAA", "CNAME", "PTR"]), help="DNS record query type", required=True)
@click.option("-pd", "--dst-port", type=int, help="Destination port [DEFAULT: 53]", default=53)
@click.argument("query_name")
@click.pass_context
@@ -211,7 +211,7 @@ def vxlan_http(ctx, dst_port: int, http_request: str) -> None:
ctx.obj["model"].sendHTTP(http_request, ctx.obj["dst_ip"], dst_port=dst_port, src_port=ctx.obj["src_port"])
@vxlan_request.command("dns")
@click.option("-t", "--query-type", type=click.Choice(["SRV", "A", "AAAA", "CNAME"]), help="DNS record query type", required=True)
@click.option("-t", "--query-type", type=click.Choice(["SRV", "A", "AAAA", "CNAME", "PTR"]), help="DNS record query type", required=True)
@click.option("-pd", "--dst-port", type=int, help="Destination port [DEFAULT: 53]", default=53)
@click.argument("query_name")
@click.pass_context
@@ -185,6 +185,9 @@ class EncapsulationModel(ABC):
def __submitDNS(self, dst_ip: str, qname: str, qtype: str, dst_port: int, src_port: int) -> dict[str, Union[str, int]]:
"""Send an encapsulated DNS request and return the response."""
if qtype == "PTR":
qname = ".".join(qname.split(".")[::-1]) + ".in-addr.arpa"
packet = self._getPacketHeader() / IP(src = self._iface_ip, dst=dst_ip) / UDP(sport=src_port, dport=dst_port) / DNS(rd=1, qd=DNSQR(qname=qname,qtype=qtype))
sniff = self._getAsyncSniffer(filter=f"udp and port {src_port}", count=1)