diff --git a/scripts/iax2-version.nse b/scripts/iax2-version.nse index ecc3328c4..a5f5260bf 100644 --- a/scripts/iax2-version.nse +++ b/scripts/iax2-version.nse @@ -27,9 +27,7 @@ portrule = shortport.version_port_or_service(4569, nil, "udp") action = function(host, port) -- see http://www.cornfed.com/iax.pdf for all options. - local poke = string.char(0x80, 0x00, 0x00, 0x00) - poke = poke .. string.char(0x00, 0x00, 0x00, 0x00) - poke = poke .. string.char(0x00, 0x00, 0x06, 0x1e) + local poke = "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x1e" local status, recv = comm.exchange(host, port, poke, {proto=port.protocol,timeout=10000}) @@ -38,13 +36,13 @@ action = function(host, port) end if (#recv) == 12 then - local byte11 = string.format("%02X", string.byte(recv, 11)) - local byte12 = string.format("%02X", string.byte(recv, 12)) + local byte11 = string.byte(recv, 11) + local byte12 = string.byte(recv, 12) -- byte11 must be \x06 IAX Control Frame -- and byte12 must be \x03 or \x04 - if ((byte11 == "06") and - (byte12 == ("03" or "04"))) + if ((byte11 == 6) and + (byte12 == 3 or byte12 == 4)) then nmap.set_port_state(host, port, "open") port.version.name = "iax2"