home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Networking / nmap-5.00-setup.exe / scripts / daytime.nse < prev    next >
Text File  |  2009-07-06  |  493b  |  23 lines

  1. description = [[
  2. Retrieves the day and time from the UDP Daytime service.
  3. ]]
  4.  
  5. author = "Diman Todorov <diman.todorov@gmail.com>"
  6.  
  7. license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
  8.  
  9. categories = {"discovery"}
  10.  
  11. require "comm"
  12. require "shortport"
  13.  
  14. portrule = shortport.port_or_service(13, "daytime", {"tcp", "udp"})
  15.  
  16. action = function(host, port)
  17.     local status, result = comm.exchange(host, port, "dummy", {lines=1, proto=port.protocol})
  18.  
  19.     if status then
  20.         return result
  21.     end
  22. end
  23.