udp port scanner required

Posted By: broozar

udp port scanner required - 06/14/08 21:39

i require an udp port scanner. as it's not tcp, this is not trivial, since all port scanners i tried were highly unreliable. a command-line driven tool would be the best.

i tried already with php sockets, but failed. tools like portmap or pcap are too heavy. i just need to check if udp port abcde is open (test package received) or closed (no package received, retry for 5 secs).

could you direct me to such a program? or write a dll for me (not for 3dgs - i use it in a winbinder application)? thnaks in advance
Posted By: checkbutton

Re: udp port scanner required - 06/14/08 21:58

won't work because of the design of the UDProtcol. As it does not establish a connection, you will never get response as long as the services behind the port does not send a respond. You don't have a handshake procedure.
The only way is that the service behind the port only responses when it gets a UDP packet.
Posted By: broozar

Re: udp port scanner required - 06/14/08 22:20

so the design would be

client->send packet->remote server gets packet->send packet to client
if(firewall) client gets no response
else udp port xxxxxx open

so, anyone who could code such thing would be my hero.
Posted By: checkbutton

Re: udp port scanner required - 06/14/08 22:36

Yes, but this will only work if you have a service on the server wich responds to your packet, and this would mean that you have a service, which binds all Ports to itself.
Get the clue? You don't know if the port is open or not unless you have your own program on the server which binds the port. So if the port is open, the port is useless becaus it's already bound.
Or do you just want to test your firewall?
Posted By: broozar

Re: udp port scanner required - 06/14/08 23:30

i want to test if a certain port on the client computer is open (meaning firewall test, kinda). if so, i will allow the client to start a game server. if it's closed, starting the game server would be useless as noone would be allowed to connect.
Posted By: broozar

Re: udp port scanner required - 06/15/08 13:35

wellwell, interested?
Posted By: testDummy

Re: udp port scanner required - 06/16/08 21:09

rooz-post-ps-def-conflict-wick

proto-serv-num-wick
proto-serv-num-nana

bind-free-wick
proto-warlock
proto-reply-bait-quiz

fub-flood-wick

esteemed-eye
loch-nessie-table-lice
free-range-nessie

micro-bound-oy-wormus

???
NULL: open or blocked
ICMP: closed
???

Quoting broozar.
Quote:
Interested?

NA
Posted By: broozar

Re: udp port scanner required - 06/16/08 22:59



even nmap has problems.
Posted By: Marco_Grubert

Re: udp port scanner required - 06/16/08 23:31

Well as you can tell from the error message nmap is having trouble because you are scanning 127.0.0.1 and not some random server. From what I understand with UDP you can only get rejection messages back to the scanner. Thus if you do not get a message it either means that there is a listener or that the rejection (ICMP) message was filtered.

I am still not sure what you are trying to do. If you are on the client you could just run 'netstat -a -p udp' to see the bound ports and pick one which is not listed there.
Posted By: broozar

Re: udp port scanner required - 06/16/08 23:57

here is my scenario:

we are developing a game. a multiplayer game. player A wants to host.
Player A has a router or is part of a greater network and so has no "direct" wire to the net. Player A is a gamer and does not know about ports. so he starts the server and wants his friends to join him. but they can't because they cannot connect, because the router is blocking the UDP port the game uses. player A blames the game and spams our support forum.

to prevent this, i wanted to include a small port checker utility that alerts the user if udp port xxxxx is closed, so he has to open it first before others can play with him.

i found the solution for nmap: i have to use my "real" (net) IP. so with 77.169.xxx.xxx it works just fine.

the problem remains: it's nmap which requires winpcap which are both no lightweight tools... i'd prefer something dead simple, something that doesn't install 2 unwanted programs on the client system.
Posted By: Marco_Grubert

Re: udp port scanner required - 06/17/08 00:53

Originally Posted By: broozar
i found the solution for nmap: i have to use my "real" (net) IP. so with 77.169.xxx.xxx it works just fine.
This is not going to help you with your scenario- how far does the packet travel? Will it stay inside the IP stack? Go past MS firewall? Maybe reach your router? Maybe reach your ISP? There could be a blocking system anywhere along the path that the client would not be able to find on his own. The only reliable thing is to set up a known server somewhere on the internet and ask it to send you a message. If you receive it then the port is unblocked.

In other words you'd need to
a) write a client that sends a request to your server containing your desired UDP port, ideally to some webhost that can be reached via TCP 80.
b) on the webhost when you get a request by a client, send a UDP package to the requested port
c) the client needs to bind to the UDP port and if it gets a response from the webhost it knows that there is no firewall in the way

Maybe use the script these guys have in place: http://www.utorrent.com/testport.php?port=6881
Posted By: broozar

Re: udp port scanner required - 06/17/08 06:56

nmap: i suppose it reaches my ISP as it displays "interesting ports at brln-xxxxxx.xxxx.<my_isp>.de:"

however, the script solution seems to be much more elegant. where can i get the source?

[edit] as most online port checking solutions, this script did not see my port that i just opened for testing purposes. so far, nmap has been the only reliable one.
Posted By: checkbutton

Re: udp port scanner required - 06/17/08 09:28

Try nmap not wiht localhost but with your local network address, or even with your Internet IP, perhaps this works...
Otherwise, use two computers wink
Posted By: broozar

Re: udp port scanner required - 06/17/08 14:11

Quote:
or even with your Internet IP
that's exactly what i wrote 2 posts above, and it works. but i'd prefer something smaller... really. for nmap, you need to install nmap and winpcap, both are no lightweight tools.
Posted By: checkbutton

Re: udp port scanner required - 06/17/08 16:13

er... ok... I understand. You don't just want to test, you want to embed this in your server.
Well, do you really think, this is neccessary? I think it's the users task to ensure, the specific port is open.
Posted By: Marco_Grubert

Re: udp port scanner required - 06/17/08 17:29

Originally Posted By: broozar
nmap: i suppose it reaches my ISP as it displays "interesting ports at brln-xxxxxx.xxxx.<my_isp>.de:"
That just tells you it could resolve the address using DNS - it's unrelated to actual route taken. You could do a tracert (or traceroute on unix) to see where the packet goes- but again, that is specific to your setup. With a different system the packet might stay local, not telling you anything about firewalls. You need an external server for port checking. Since you are familiar with PHP can't you write a script that sends a UDP packet to a specified IP and port ?
© 2024 lite-C Forums