Skip to content Skip to sidebar Skip to footer

Scapy Oserror: [errno 9] Bad File Descriptor

I'm using python 2.7 and scapy-2.2.0 in windows xp. I'm trying dns spoofing and it works well in python. but when I make to .exe and execute it, I got this error Traceback (most re

Solution 1:

I had the same error when I tried send(IP(dst="1.2.3.4")/ICMP()), and I found on github that my problem was that I was using IDLE instead of the Command Prompt/Powershell on windows. This is the output in the Powershell:

>>>send(IP(dst="1.2.3.4")/ICMP())
.
Sent 1 packets.

Maybe this is not the problem OP had, but this is the first thread on Google so it might help someone.

Solution 2:

It looks like a wrong file descriptor (handle) is being used. E.g. something open as stdout (pipe) is used as a socket.

If I understand correctly, same program works from source and fails when rolled into an exe. Am I right?

If you ran it on linux, you would use strace to figure out which.

Equivalent tools on windows are Process Monitor and Logger.exe.

Post a Comment for "Scapy Oserror: [errno 9] Bad File Descriptor"