Nmap Development mailing list archives

[NSE] Script for TIME protocol


From: Dirk Loss <lists () dirk-loss de>
Date: Sat, 19 Jul 2008 18:56:27 +0200

Hi,

the attached NSE script gets the current date and time from a server
that implements the TIME protocol (UDP port 37, RFC 868):

# nmap -p 37 -sU --script time-rfc868.nse time-a.nist.gov

Starting Nmap 4.68 ( http://nmap.org ) at 2008-07-19 18:30 CEST
Interesting ports on time-a.nist.gov (129.6.15.28):
PORT   STATE SERVICE
37/udp open  time
|_ TIME: Sat Jul 19 18:30:37 2008

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

I wrote the script just to introduce myself to Lua and NSE programming
so if you have any comments or suggestions for improvement, please let
me know.
 
From the manual [1] it seemed bin.unpack() could be used to parse the
response, but I haven't been able to find the Binlib library in my Nmap
installation (SVN trunk). What would be right way to install and use it?

Regards
Dirk

[1] http://nmap.org/book/nse-library.html#nse-binlib

Attachment: time-rfc868.nse
Description:


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: