{"id":787,"date":"2010-07-08T01:22:17","date_gmt":"2010-07-07T18:22:17","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=787"},"modified":"2010-07-08T01:22:38","modified_gmt":"2010-07-07T18:22:38","slug":"how-to-test-a-listening-udp-port-using-nmap","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=787","title":{"rendered":"How to test a listening UDP port using nmap"},"content":{"rendered":"<p>quote from<a href=\"http:\/\/www.linuxquestions.org\/questions\/linux-security-4\/telneting-to-a-udp-port-353876\/\"> http:\/\/www.linuxquestions.org\/questions\/linux-security-4\/telneting-to-a-udp-port-353876\/<\/a><\/p>\n<blockquote><p>UDP is a connectionless protocol which means it basically just sends  packets out to the specified destination. TCP is connection-oriented  which means it establishes a connection to the other end using the  &#8216;3-way handshake&#8217;.<\/p>\n<p>So it makes sense to apply the &#8216;telnet&#8217; paradigm to TCP &#8211; you make  connection to a specific host and port, you still remain connected (for a  period of time) even if you aren&#8217;t sending any data and you can send  and receive data continuously without having to reconnect in between.<\/p>\n<p>UDP on the other hand doesn&#8217;t really fit the telnet model &#8211; its more of a  fire-and-forget system where you fire-off a series of packets towards  the destination. You then go on with something else (or just wait doing  nothing) until (or if) the remote process sends some packets back.<\/p><\/blockquote>\n<p>That is why we can&#8217;t use telnet to test udp port, in this tutorial i will try to use nmap, you need to install nmap first. Here is the command<\/p>\n<p># nmap -p [port] -sU -P0 [host name | ip address]<br \/>\n# nmap -p 5060 -sU -P0 example.com<br \/>\n# nmap -p 5060 -sU -P0 21.12.32.123<\/p>\n<p>From the command shown above, I am assuming that the host example.com(21.12.32.123)  is currently serving asterisk sip service on UDP port 5060.<\/p>\n<p>Sample opened UDP port output:<\/p>\n<p># nmap -p 5060 -sU -P0 21.12.32.123<\/p>\n<p>Starting Nmap 4.11 ( http:\/\/www.insecure.org\/nmap\/ ) at 2010-07-07 22:26 MSD<br \/>\nInteresting ports on 21.12.32.123:<br \/>\nPORT\u00a0\u00a0\u00a0\u00a0 STATE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SERVICE<br \/>\n5060\/udp open|filtered sip<\/p>\n<p>Nmap finished: 1 IP address (1 host up) scanned in 2.021 seconds<\/p>\n<p>If you have a closed UDP port, you should be seeing similar lines as  shown<\/p>\n<p>Interesting ports on localhost (127.0.0.1):<br \/>\nPORT STATE SERVICE<br \/>\n123\/udp closed ntp<\/p>\n","protected":false},"excerpt":{"rendered":"<p>quote from http:\/\/www.linuxquestions.org\/questions\/linux-security-4\/telneting-to-a-udp-port-353876\/ UDP is a connectionless protocol which means it basically just sends packets out to the specified destination. TCP is connection-oriented which means it establishes a connection to the other end using the &#8216;3-way handshake&#8217;. So it makes sense to apply the &#8216;telnet&#8217; paradigm to TCP &#8211; you make connection to a specific [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6483],"tags":[6482],"class_list":["post-787","post","type-post","status-publish","format-standard","hentry","category-nmap","tag-how-to-test-a-listening-udp-port-using-nmap"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=787"}],"version-history":[{"count":2,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/787\/revisions"}],"predecessor-version":[{"id":789,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/787\/revisions\/789"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}