Zenmap nse4/19/2023 ![]() – set_timeout: sets the timeout value to a socket – receive: receive some data from the socket ![]() We can create a socket with the new_socket function call, which returns a new socket object that has the following methods: With the Nsock library, we can achieve something like the following scenario: we can create a socket that connects to a specific IP address and port, send or receive some data, and then close the socket at the end. We can use the Nsock library to perform parallel non-blocking operations, which provides a powerful mechanism that allows running several scripts at the same time efficiently. When writing NSE scripts, we also have direct access to Nsock, which is the Nmap socket library. – port.state: what state the target port is in: open, open|filtered, filtered, closed. – port.version: additional information about the service running on the target host – rvice: the service running on the target host – port.protocol: the protocol of the target host – port.number: the port number of the target host The port object has the following members: – host.times: contains the RTT, SRTT, RTTVAR and timeout information about the target host – host.bin_ip: the IP address of the target host – host.interface_mtu: maximum transmission unit of our own interface – host.interface: our own network interface – host.mac_addr: the MAC address of the target host (only available if host.directly_connected is true) – host.directly_connected: specifies if the scanning host is on the same local network as the scanned host – host.targetname: the name of the host specified in the Nmap command – host.name: the reverse DNS of the target host – host.ip: the IP address of the target host The host object has the following members: We can then use the host and port objects in the NSE script to request specific information that we require. The host argument passed into the action function contains information about the host we’re about to scan while the port argument contains the port about to be scanned. We can see that the action function accepts two parameters, the host and port.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |