Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with saving measurement graph on domain-based run #68

Open
KourosZanbouri opened this issue Jun 19, 2022 · 1 comment
Open

Problem with saving measurement graph on domain-based run #68

KourosZanbouri opened this issue Jun 19, 2022 · 1 comment
Labels
bug Something isn't working enhancement New feature or request priority/medium

Comments

@KourosZanbouri
Copy link

Today I tried to run tracevis with a specific target ( with the domain name and "-i" parameter"), and everything went smooth until saving the measurement graph, in which I got a traceback

  • data and config measurements were saved successfully

Traceback (most recent call last): File "./tracevis.py", line 342, in <module> main(get_args(sys.argv[1:])) File "./tracevis.py", line 335, in main if utils.vis.vis( File "C:\Users\Kouros\desktop\tracevis\utils\vis.py", line 277, in vis dst_addr_id = 'x' + str(int(ipaddress.IPv4Address(dst_addr))) + 'x' File "C:\Users\Kouros\AppData\Local\Programs\Python\Python38\lib\ipaddress.py", line 1252, in __init__ self._ip = self._ip_int_from_string(addr_str) File "C:\Users\Kouros\AppData\Local\Programs\Python\Python38\lib\ipaddress.py", line 1144, in _ip_int_from_string raise AddressValueError("Expected 4 octets in %r" % ip_str) ipaddress.AddressValueError: Expected 4 octets in 'TARGET.DOMAIN.DOMAIN'

@xhdix xhdix added bug Something isn't working enhancement New feature or request priority/medium labels Jun 19, 2022
@xhdix
Copy link
Contributor

xhdix commented Jun 19, 2022

Thank you for reporting this issue! ❤️ 🌺

-i == --ips but:

  1. There is no timeout in getaddrinfo() and there is no easy and cross platform workaround to stop it. So, to make sure that we don't get stuck on nslookup we MUST do it manually with scapy. Therefore, we need to work on something like this:

    def nslookup(user_iface=None):
    # there is no timeout in getaddrinfo(), so we have to do it ourselves
    # Raw packets bypasses the firewall so it may not work as intended in some cases
    dns_request = IP(
    dst="1.1.1.1", id=RandShort(), ttl=128)/UDP(
    sport=utils.ephemeral_port.ephemeral_port_reserve("udp"), dport=53)/DNS(
    rd=1, id=RandShort(), qd=DNSQR(qname="speed.cloudflare.com"))
    try:
    request_and_answers, _ = sr(
    dns_request, iface=user_iface, verbose=0, timeout=1)
    except:
    return False
    if request_and_answers is not None and len(request_and_answers) != 0:
    if request_and_answers[0][1].haslayer(DNS):
    return True
    # return request_and_answers[0][1][DNSRR].rdata
    return False

  2. We should stop and show error when the inputs are not IP (for now IPv4, unless we fix support IPv6 #25 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request priority/medium
Projects
None yet
Development

No branches or pull requests

2 participants