OpenVAS Scanner 23.23.1
nasl_frame_forgery.h File Reference

Header file for module nasl_frame_forgery. More...

#include "nasl_lex_ctxt.h"

Go to the source code of this file.

Functions

tree_cellnasl_send_arp_request (lex_ctxt *)
 Send an arp request to an IP host.
tree_cellnasl_get_local_mac_address_from_ip (lex_ctxt *)
 Get the MAC address of host.
tree_cellnasl_forge_frame (lex_ctxt *)
 Forge a datalink layer frame.
tree_cellnasl_send_frame (lex_ctxt *)
 Send a frame and listen to the answer.
tree_cellnasl_dump_frame (lex_ctxt *)
 Dump a datalink layer frame.

Detailed Description

Header file for module nasl_frame_forgery.

Function Documentation

◆ nasl_dump_frame()

tree_cell * nasl_dump_frame ( lex_ctxt * lexic)

Dump a datalink layer frame.

@naslparam


  • frame The frame to be dumped.
Parameters
lexicLexical context of NASL interpreter.
Returns
Null

◆ nasl_forge_frame()

tree_cell * nasl_forge_frame ( lex_ctxt * lexic)

Forge a datalink layer frame.

@naslparams


  • src_haddr Source MAC address to use.

  • dst_haddr Destination MAC address to use.

  • ether_proto Ethernet type integer in hex format. Default 0x0800 (ETHER_P_IP)

  • payload Payload to be attached to the frame. E.g a forged tcp datagram.
  • @naslreturn the forged frame.
Parameters
lexicLexical context of NASL interpreter.
Returns
tree_cell element or null.

◆ nasl_get_local_mac_address_from_ip()

tree_cell * nasl_get_local_mac_address_from_ip ( lex_ctxt * lexic)

Get the MAC address of host.

@naslparam

  • ip_address Local IP address

    @naslreturn The MAC address of the host. NULL otherwise

Parameters
[in]lexicLexical context of NASL interpreter.

◆ nasl_send_arp_request()

tree_cell * nasl_send_arp_request ( lex_ctxt * lexic)

Send an arp request to an IP host.

NASL Returns:\n The MAC address of the target. NULL otherwise
Parameters
[in]lexicLexical context of NASL interpreter.
Returns
A tree cell or NULL.

◆ nasl_send_frame()

tree_cell * nasl_send_frame ( lex_ctxt * lexic)

Send a frame and listen to the answer.

@naslparams


  • frame The frame to be sent.

  • pcap_active TRUE by default. Otherwise, NASL does not listen for the answers.

  • pcap_filter BPF filter.

  • pcap_timeout Capture timeout. 5 by default.
  • @naslreturn Sniffed answer.
Parameters
lexicLexical context of NASL interpreter.
Returns
tree_cell element or null.