-
Notifications
You must be signed in to change notification settings - Fork 9
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
Always getting success, even when should get failure for UDP port scan #2
Comments
Hi, first of all, thank you for trying this library out. I really appreciate it. :) Secondly, pync is still in early development and there's so much more on my list I need to do. But thank you so much for raising this issue. If you don't mind, please could I have a bit more information on the linux OS you are running it on and also the version of netcat you are running. It's probably worth mentioning I have largely based pync on the netcat-openbsd 1.105-7 ubuntu/debian version as that's what I have installed on my VPS. Could I also confirm that you are running the latest version of pync and still getting the problem. Does GitHub allow gifs in comments too? Thank you. :) |
The library was exactly what I was working on writing myself, so it was a nice find :) I wish I'd found it sooner in my searches, I spent a day working on the UDP test myself, and it was getting quite out of hand. I may have isolated the issue a bit more since originally opening it - I am unable to reproduce the issue in my linux server. When I hit the IP and port configuration on the linux box (with netcat and with this library), I get the responses I expect. HOWEVER - when I am running this on a windows machine on the same network, I get the unreliable behavior I described before. UDP always says "success" even when I know the port is closed. This is a windows 10 machine, I can provide whatever other details you need. This is with the latest version of pync. |
Thanks for narrowing it down for me. I have a windows 10 machine at home so I will try and reproduce the problem myself and see if I can find what's causing it. 👍 I think I remember there being a problem with TCP port scans on Windows too (huge delay between port connections causing a very slow scan) so I'll have a look at that too. |
Few notes, as I was researching it... may be helpful, may not. https://stackoverflow.com/questions/70120916/how-to-check-if-udp-port-is-open-python Found this in an article, but not sure of veracity. I'm pretty green for networking stuff. Seems to suggest firewall issues may cause this.... not sure if there's a way to catch that situation and flag it differently in output or what.
|
Hi Caleb. I'm just wondering if you've tried installing netcat on your windows machine to see if it has the same behaviour (false positive UDP scan). 🤔 Also, I've noticed at the bottom of netcat's man page theres a "caveats" section that notes: "UDP port scans will always succeed (i.e. report the port as open), rendering the -uz combination of flags relatively useless." Maybe netcat isn't the right tool for what you want. 🤔 |
I can run the following netcat command on a linux box and get 'error, connection refused' -- but when I do the associated command in this library through pync, it says success.... on any port I try....
netcat command that gives me the success (on good port) and failure (on bad port)
nc -vnzu <some ip> <some port>
Associated pync I tried to use:
This returns: "Connection to port [udp/*] succeeded!" in all cases.
The text was updated successfully, but these errors were encountered: