Home page logo
/
Zenmap screenshot
Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News
Example Nmap output

Library match

Buffered network I/O helper functions.

The functions in this module can be used for delimiting data received by the nmap.receive_buf function in the Network I/O API (which see).

Copyright© Same as Nmap--See http://nmap.org/book/man-legal.html

Source: http://nmap.org/svn/nselib/match.lua

Functions

numbytes (num)

Return a function that allows delimiting at a certain number of bytes.



Functions

numbytes (num)

Return a function that allows delimiting at a certain number of bytes.

This function can be used to get a buffered version of sock:receive_bytes(n) in case a script requires more than one fixed-size chunk, as the unbuffered version may return more bytes than requested and thus would require you to do the parsing on your own.

The keeppattern parameter to receive_buf should be set to true, otherwise the string returned will be 1 less than num

Parameters

  • num: Number of bytes.

Usage:

sock:receive_buf(match.numbytes(80), true)

See also:

Nmap Site Navigation

Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]