1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-19 12:49:02 +00:00

Fix NSE hangs when service sends non-matching data to receive_buf

This commit is contained in:
dmiller
2017-03-29 20:41:59 +00:00
parent 85e10c6b2b
commit 3dec043ead
26 changed files with 92 additions and 39 deletions

View File

@@ -1,4 +1,5 @@
local creds = require "creds"
local match = require "match"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
@@ -52,7 +53,7 @@ portrule = shortport.port_or_service(51010, "mmouse", "tcp")
local function receiveData(socket, cmd)
local status, data = ""
repeat
status, data = socket:receive_buf("\04", true)
status, data = socket:receive_buf(match.pattern_limit("\04", 2048), true)
if ( not(status) ) then
return false, "Failed to receive data from server"
end