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

bug on sr function #4275

Open
giovanni-bellini-argo opened this issue Feb 8, 2024 · 4 comments
Open

bug on sr function #4275

giovanni-bellini-argo opened this issue Feb 8, 2024 · 4 comments

Comments

@giovanni-bellini-argo
Copy link

Brief description

i'm trying to make some netbios queryes to do an host discovery and when querying an host sr returns no answers even tho wireshark says otherwise, i compared the answers of both working (with socket module) and non working (with scapy module) examples but couldn't find any difference to justify a drop by scapy

Scapy version

2.5.0

Python version

3.10.12

Operating system

Ubuntu 22.04.2 LTS

Additional environment information

No response

How to reproduce

scapy code which i use to request ndstats

ans, unans = sr(IP(dst=str(ip)) / UDP(sport=randint(1024, 65534), dport=137) / data, timeout=3, verbose=0)

socket basic send receive which works

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.settimeout(2)
        s.sendto(data, (addr, 137))
        rep = s.recv(2000)

Actual result

No response

Expected result

No response

Related resources

No response

@giovanni-bellini-argo
Copy link
Author

activating sniff in a thread with the appropriate filters and then sending the packets i can see the answers which i should receive with sr or sr1.

@gpotter2
Copy link
Member

gpotter2 commented Feb 10, 2024

What's data ? Could you provide a pcap? Scapy is not matching the answer to your request.

@giovanni-bellini-argo
Copy link
Author

data contains the NetBios wildcard name padded with nulls, nothing special. it's just a string.

i can't provide pcap files as of now but i can attest that wireshark sees and recognizes the packets sent as well as the received one. just scapy dosen't seem to see it

@gpotter2
Copy link
Member

Yeah, please either provide a pcap or a reproducible example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants