Nmap Development mailing list archives

Re: Uniquely identifying an Nmap install from NSE?


From: Ron <ron () skullsecurity net>
Date: Sun, 16 Aug 2009 18:23:08 -0500

So, I was about to implement this when I realized something: is there a good way to get the local MAC address being used by a connection? Or would that require the user to be running as root?

Implementing it with just the IP address should be sufficient, really, but more entropy could be better.

Also, here is the hash I threw together (note that this is supposed to have collisions, and does):
--
    local hash = 0
    local i
    for i = 1, #lhost, 1 do
        local str = string.sub(lhost, i, i)
        if(str ~= '.') then
            hash = bit.bxor(hash, tonumber(str))
            hash = bit.lshift(hash, 3)
            hash = bit.bxor(hash, 3)
        end
    end
--
In a quick test, it seems to have the appropriate number of collisions, but I'm happy to modify it if somebody thinks there's a better way. I avoided using the OpenSSL library on purpose -- I don't want to assume, at this point, that somebody has SSL support.

Thanks
Ron


--
Ron Bowes
http://www.skullsecurity.org/

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


Current thread: