UDP port scanning

1

UDP is connectionless, so I can't expect a response packet, necessarily. If the port is closed, I might get an ICMP error message, but if the firewall could silently drop the ICMP packet How could I know if the UDP port is opened or closed is there another way to scan UDP port.

dana.ba

Posted 2014-08-23T13:42:07.437

Reputation: 43

Answers

0

Nmap tool has the -sU flag to scan UDP ports.

e.g :

# nmap -sU 192.168.0.39

Starting Nmap 5.21 ( http://nmap.org ) at 2014-08-23 19:02 CEST
Nmap scan report for 192.168.0.39
Host is up (0.00017s latency).
Not shown: 999 open|filtered ports
PORT    STATE SERVICE
137/udp open  netbios-ns
MAC Address: xx:xx:xx:xx:xx:xx (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 19.88 seconds

user2196728

Posted 2014-08-23T13:42:07.437

Reputation: 1 146

seems good, but how can I use it in my java code, and retrieve list of open ports ? – dana.ba – 2014-08-23T19:09:15.760

You were not talking about any Java code in your initial question ! However Java is able to run external programs http://www.rgagnon.com/javadetails/java-0014.html Search for "java run external program" within Google, and post on stackoverflow if you have programming problems

– user2196728 – 2014-08-23T19:13:26.017