Skip to content

Commit

Permalink
Corrects a unit-of-measure mismatch between the desired packet delay and
Browse files Browse the repository at this point in the history
an observed roundtrip time. Closes #1038, closes #1037.
  • Loading branch information
nnposter committed Oct 24, 2017
1 parent 8366c90 commit 5fa53d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#s wa Nmap Changelog ($Id$); -*-text-*-

o [NSE][GH#1038][GH#1037] Script qscan was not observing interpacket delays
(parameter qscan.delay). [nnposter]

o [NSE][GH#1046] Script http-headers now fails properly if the target does not
return a valid HTTP response. [spacewander]

Expand Down
9 changes: 3 additions & 6 deletions scripts/qscan.nse
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,9 @@ action = function(host)

-- Unlike qscan.cc which loops around while waiting for
-- the delay, I just sleep here (depending on rtt)
if rtt < (3 * delay) / 2 then
if rtt < (delay / 2) then
stdnse.sleep(((delay / 2) + math.random(0, delay) - rtt))
else
stdnse.sleep(math.random((3 * delay) / 2 - rtt))
end
local sleep = delay * (0.5 + math.random()) - rtt / 1000000
if sleep > 0 then
stdnse.sleep(sleep)
end
end
end
Expand Down

0 comments on commit 5fa53d0

Please sign in to comment.