On 2011-04-03 13:32:21 +0100, Nick Nikolaou wrote:
I also noticed that when the script captures a large number of IPs
(thousands - I tested this while on a Skype video call) it won't add the
targets with target.add(unpack(sniffed_targets)) :
NSE: targets-sniffer threw an error!
./targets-sniffer.nse:109: too many results to unpack
[C]: in function 'unpack'
./targets-sniffer.nse:109: in function <./targets-sniffer.nse:51>
(tail call): ?
Yes, you are adding lot of targets in a one call, actually there is a
check inside Lua 'LUAI_MAXCSTACK == 8000' to avoid consuming the stack,
and there is also another _global_ special argument 'max-newtargets',
wich can be used to limit the number of added targets to avoid memory
starvation, however this last one is subject of debate. I think an
argument like this can have its use case in this targets-sniffer script.
(remember 'max-newtargets' is a global one: for all the scripts).
We may have to change this back to the old method of adding one address
time. That would also make output of IP address easier since we could
for duplicates before printing the addresses.
The script doesn't output the IP address for now (except with -d) but
add that functionality once we decide how I should go about adding
Yes we must change it, and since the script can add lot of targets, and
since the pcap_receive() will yield, we can consider Lua coroutines .
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/