36#include <netinet/in.h>
54#include <netinet/icmp6.h>
58#ifdef BSD_BYTE_ORDERING
62#define FIX(n) htons (n)
63#define UNFIX(n) ntohs (n)
77 register u_short answer = 0;
78 register long sum = 0;
90 *(u_char *) (&odd_byte) = *(u_char *) p;
94 sum = (sum >> 16) + (sum & 0xffff);
124 struct in6_addr *dst_addr;
133 if (dst_addr == NULL || (IN6_IS_ADDR_V4MAPPED (dst_addr) == 1))
140 retc->
size =
sizeof (
struct ip6_hdr) + data_len;
142 pkt = (
struct ip6_hdr *) g_malloc0 (
sizeof (
struct ip6_hdr) + data_len);
149 pkt->ip6_flow = htonl (version << 28 | tc << 20 | fl);
151 pkt->ip6_plen =
FIX (data_len);
158 inet_pton (AF_INET6, s, &pkt->ip6_src);
163 inet_pton (AF_INET6, s, &pkt->ip6_dst);
165 pkt->ip6_dst = *dst_addr;
169 bcopy (data, retc->
x.
str_val + sizeof (
struct ip6_hdr), data_len);
194 char ret_ascii[INET6_ADDRSTRLEN];
209 nasl_perror (lexic,
"%s: no valid 'ip6' argument\n", __func__);
216 nasl_perror (lexic,
"%s: no valid 'element' argument\n", __func__);
220 if (!strcmp (element,
"ip6_v"))
222 ret_int = ntohl (ip6->ip6_flow) >> 28;
225 else if (!strcmp (element,
"ip6_tc"))
227 ret_int = (ntohl (ip6->ip6_flow) >> 20) & 0xff;
230 else if (!strcmp (element,
"ip6_fl"))
232 ret_int = ntohl (ip6->ip6_flow) & 0x3ffff;
235 else if (!strcmp (element,
"ip6_plen"))
237 ret_int =
UNFIX (ip6->ip6_plen);
240 else if (!strcmp (element,
"ip6_nxt"))
242 ret_int = (ip6->ip6_nxt);
245 else if (!strcmp (element,
"ip6_hlim"))
247 ret_int = (ip6->ip6_hlim);
258 if (!strcmp (element,
"ip6_src"))
260 inet_ntop (AF_INET6, &ip6->ip6_src, ret_ascii, sizeof (ret_ascii));
263 else if (!strcmp (element,
"ip6_dst"))
265 inet_ntop (AF_INET6, &ip6->ip6_dst, ret_ascii, sizeof (ret_ascii));
271 nasl_perror (lexic,
"%s : unknown element '%s'\n", __func__, element);
276 retc->
size = strlen (ret_ascii);
277 retc->
x.
str_val = g_strdup (ret_ascii);
305 nasl_perror (lexic,
"%s: missing <ip6> field\n", __func__);
309 pkt = (
struct ip6_hdr *) g_malloc0 (size);
310 bcopy (o_pkt, pkt, size);
318 inet_pton (AF_INET6, s, &pkt->ip6_src);
339 char addr[INET6_ADDRSTRLEN];
350 printf (
"\tip6_v : %d\n", ntohl (ip6->ip6_flow) >> 28);
351 printf (
"\tip6_tc : %d\n", (ntohl (ip6->ip6_flow) >> 20) & 0xff);
352 printf (
"\tip6_fl : %d\n", ntohl (ip6->ip6_flow) & 0x3ffff);
353 printf (
"\tip6_plen : %d\n",
UNFIX (ip6->ip6_plen));
354 printf (
"\tip6_hlim : %d\n", ip6->ip6_hlim);
355 switch (ip6->ip6_nxt)
358 printf (
"\tip6_nxt : IPPROTO_TCP (%d)\n", ip6->ip6_nxt);
361 printf (
"\tip6_nxt : IPPROTO_UDP (%d)\n", ip6->ip6_nxt);
364 printf (
"\tip6_nxt : IPPROTO_ICMPV6 (%d)\n", ip6->ip6_nxt);
367 printf (
"\tip6_nxt : %d\n", ip6->ip6_nxt);
370 printf (
"\tip6_src : %s\n",
371 inet_ntop (AF_INET6, &ip6->ip6_src, addr, sizeof (addr)));
372 printf (
"\tip6_dst : %s\n",
373 inet_ntop (AF_INET6, &ip6->ip6_dst, addr, sizeof (addr)));
402 struct ip6_hdr *new_packet;
405 u_char uc_code, uc_len;
414 "Usage : %s(ip6:<ip6>, code:<code>, "
415 "length:<len>, value:<value>\n",
420 pad_len = 4 - ((
sizeof (uc_code) +
sizeof (uc_len) + value_size) % 4);
424 pl = 40 <
UNFIX (ip6->ip6_plen) ? 40 :
UNFIX (ip6->ip6_plen);
425 new_packet = g_malloc0 (size + 4 + value_size + pad_len);
426 bcopy (ip6, new_packet, pl);
428 uc_code = (u_char)
code;
429 uc_len = (u_char)
len;
431 p = (
char *) new_packet;
432 bcopy (&uc_code, p + pl,
sizeof (uc_code));
433 bcopy (&uc_len, p + pl +
sizeof (uc_code),
sizeof (uc_len));
434 bcopy (value, p + pl +
sizeof (uc_code) +
sizeof (uc_len), value_size);
437 for (i = 0; i < pad_len; i++)
440 p + pl +
sizeof (uc_code) +
sizeof (uc_len) + value_size + i, 1);
446 + (
sizeof (uc_code) +
sizeof (uc_len) + value_size + pad_len) + pl,
449 new_packet->ip6_plen =
450 FIX (size +
sizeof (uc_code) +
sizeof (uc_len) + value_size + pad_len);
453 retc->
size = size + value_size +
sizeof (uc_code) +
sizeof (uc_len) + pad_len;
454 retc->
x.
str_val = (
char *) new_packet;
504 struct tcp_opt_mss
mss;
505 struct tcp_opt_wscale
wscale;
507 struct tcp_opt_tstamp
tstamp;
535 struct ip6_hdr *ip6, *tcp_packet;
543 "forge_tcp_v6_packet: You must supply the 'ip6' argument\n");
558 (
struct ip6_hdr *) g_malloc0 (ipsz +
sizeof (
struct tcphdr) +
len);
559 retc->
x.
str_val = (
char *) tcp_packet;
561 bcopy (ip6, tcp_packet, ipsz);
563 tcp_packet->ip6_ctlun.ip6_un1.ip6_un1_plen =
564 FIX (
sizeof (
struct tcphdr) +
len);
565 tcp = (
struct tcphdr *) ((
char *) tcp_packet + 40);
579 bcopy (data, (
char *) tcp +
sizeof (
struct tcphdr),
len);
584 char *tcpsumdata = g_malloc0 (
sizeof (
struct v6pseudohdr) +
len + 1);
586 bzero (&pseudoheader, 38 +
sizeof (
struct tcphdr));
587 memcpy (&pseudoheader.
s6addr, &ip6->ip6_src, sizeof (
struct in6_addr));
588 memcpy (&pseudoheader.
d6addr, &ip6->ip6_dst, sizeof (
struct in6_addr));
590 pseudoheader.
protocol = IPPROTO_TCP;
591 pseudoheader.
length = htons (
sizeof (
struct tcphdr) +
len);
592 bcopy ((
char *) tcp, (
char *) &pseudoheader.
tcpheader,
593 sizeof (
struct tcphdr));
595 bcopy ((
char *) &pseudoheader, tcpsumdata,
sizeof (
struct v6pseudohdr));
597 bcopy ((
char *) data, tcpsumdata +
sizeof (
struct v6pseudohdr),
len);
598 tcp->th_sum =
np_in_cksum ((
unsigned short *) tcpsumdata,
599 38 +
sizeof (
struct tcphdr) +
len);
603 retc->
size = ipsz +
sizeof (
struct tcphdr) +
len;
632 nasl_perror (lexic,
"get_tcp_v6_element: No valid 'tcp' argument\n");
636 ip6 = (
struct ip6_hdr *) packet;
639 if (
UNFIX (ip6->ip6_plen) > ipsz)
642 tcp = (
struct tcphdr *) (packet + 40);
647 nasl_perror (lexic,
"get_tcp_v6_element: No valid 'element' argument\n");
651 if (!strcmp (element,
"th_sport"))
652 ret = ntohs (tcp->th_sport);
653 else if (!strcmp (element,
"th_dsport"))
654 ret = ntohs (tcp->th_dport);
655 else if (!strcmp (element,
"th_seq"))
656 ret = ntohl (tcp->th_seq);
657 else if (!strcmp (element,
"th_ack"))
658 ret = ntohl (tcp->th_ack);
659 else if (!strcmp (element,
"th_x2"))
661 else if (!strcmp (element,
"th_off"))
663 else if (!strcmp (element,
"th_flags"))
665 else if (!strcmp (element,
"th_win"))
666 ret = ntohs (tcp->th_win);
667 else if (!strcmp (element,
"th_sum"))
669 else if (!strcmp (element,
"th_urp"))
671 else if (!strcmp (element,
"data"))
674 retc->
size =
UNFIX (ip6->ip6_plen) - tcp->th_off * 4;
675 if (retc->
size < 0 || retc->
size > ipsz - 40 - tcp->th_off * 4)
678 "get_tcp_v6_element: Erroneous tcp header offset %d\n",
684 bcopy ((
char *) tcp + tcp->th_off * 4, retc->
x.
str_val, retc->
size);
689 nasl_perror (lexic,
"get_tcp_v6_element: Unknown tcp field %s\n",
712 opt_kind = (uint8_t *) options;
714 while (*opt_kind != 0)
719 tcp_all_options->
mss.
kind = *opt_kind;
720 tcp_all_options->
mss.
len = *(opt_kind + 1);
721 tcp_all_options->
mss.
mss = *((uint16_t *) (opt_kind + 2));
722 opt_kind = opt_kind + *(opt_kind + 1);
726 tcp_all_options->
wscale.
len = *(opt_kind + 1);
727 tcp_all_options->
wscale.
wscale = (uint8_t) * (opt_kind + 2);
728 opt_kind = opt_kind + *(opt_kind + 1);
730 case TCPOPT_SACK_PERMITTED:
733 opt_kind = opt_kind + *(opt_kind + 1);
735 case TCPOPT_TIMESTAMP:
737 tcp_all_options->
tstamp.
len = *(opt_kind + 1);
738 tcp_all_options->
tstamp.
tstamp = *((uint32_t *) (opt_kind + 2));
739 tcp_all_options->
tstamp.
e_tstamp = *((uint32_t *) (opt_kind + 6));
740 opt_kind = opt_kind + *(opt_kind + 1);
747 opt_kind = opt_kind + *(opt_kind + 1);
750 g_debug (
"%s: Unsupported %u TCP option. "
751 "Not all options are returned.",
752 __func__, *opt_kind);
791 nasl_perror (lexic,
"%s: No valid 'tcp' argument passed.\n", __func__);
799 "%s: No 'option' argument passed but required.\n."
800 "Usage: %s(tcp:<tcp>, option:<TCPOPT>)",
805 ip6 = (
struct ip6_hdr *) packet;
809 if (
UNFIX (ip6->ip6_plen) > ipsz)
812 tcp = (
struct tcphdr *) (packet + 40);
814 if (tcp->th_off <= 5)
818 options = (
char *) g_malloc0 (
sizeof (uint8_t) * 4 * (tcp->th_off - 5));
819 memcpy (options, (
char *) tcp + 20, (tcp->th_off - 5) * 4);
821 tcp_all_options = g_malloc0 (
sizeof (
struct tcp_options));
823 if (tcp_all_options == NULL)
825 nasl_perror (lexic,
"%s: No TCP options found in passed TCP packet.\n",
838 retc->
x.
i_val = ntohs ((uint16_t) tcp_all_options->
mss.
mss);
844 case TCPOPT_SACK_PERMITTED:
848 case TCPOPT_TIMESTAMP:
852 memset (&v, 0,
sizeof (v));
857 memset (&v, 0,
sizeof (v));
863 nasl_perror (lexic,
"%s: Invalid TCP option passed.\n", __func__);
867 g_free (tcp_all_options);
897 struct ip6_hdr *ip6 = (
struct ip6_hdr *) pkt;
908 lexic,
"set_tcp_v6_elements: Invalid value for the argument 'tcp'\n");
912 tcp = (
struct tcphdr *) (pkt + 40);
914 if (pktsz <
UNFIX (ip6->ip6_plen))
919 data_len =
UNFIX (ip6->ip6_plen) - (tcp->th_off * 4);
920 data = (
char *) ((
char *) tcp + tcp->th_off * 4);
923 npkt = g_malloc0 (40 + tcp->th_off * 4 + data_len);
924 bcopy (pkt, npkt,
UNFIX (ip6->ip6_plen) + 40);
926 ip6 = (
struct ip6_hdr *) (npkt);
927 tcp = (
struct tcphdr *) (npkt + 40);
945 bcopy (data, (
char *) tcp + tcp->th_off * 4, data_len);
949 ip6->ip6_plen =
FIX (tcp->th_off * 4 + data_len);
952 if (tcp->th_sum == 0)
955 char *tcpsumdata = g_malloc0 (
sizeof (
struct v6pseudohdr) + data_len + 1);
957 bzero (&pseudoheader, 38 +
sizeof (
struct tcphdr));
958 memcpy (&pseudoheader.
s6addr, &ip6->ip6_src, sizeof (
struct in6_addr));
959 memcpy (&pseudoheader.
d6addr, &ip6->ip6_dst, sizeof (
struct in6_addr));
961 pseudoheader.
protocol = IPPROTO_TCP;
962 pseudoheader.
length = htons (
sizeof (
struct tcphdr) + data_len);
963 bcopy ((
char *) tcp, (
char *) &pseudoheader.
tcpheader,
964 sizeof (
struct tcphdr));
966 bcopy ((
char *) &pseudoheader, tcpsumdata,
sizeof (
struct v6pseudohdr));
968 bcopy ((
char *) data, tcpsumdata +
sizeof (
struct v6pseudohdr),
970 tcp->th_sum =
np_in_cksum ((
unsigned short *) tcpsumdata,
971 38 +
sizeof (
struct tcphdr) + data_len);
976 retc->
size = 40 + (tcp->th_off * 4) + data_len;
1002 struct ip6_hdr *ip6 = (
struct ip6_hdr *) pkt;
1009 int tcp_opt, tcp_opt_val, tcp_opt_val2;
1010 int current_opt_len, total_opt_len, opt_size_allocated;
1011 char *opts, *ptr_opts_pos;
1023 lexic,
"set_tcp_v6_elements: Invalid value for the argument 'tcp'\n");
1026 opts = g_malloc0 (
sizeof (
char) * 4);
1027 ptr_opts_pos = opts;
1028 opt_size_allocated = 4;
1033 current_opt_len = total_opt_len;
1043 if (tcp_opt_val < (
int) TCP_MSS_DESIRED || tcp_opt_val > 65535)
1045 nasl_perror (lexic,
"%s: Invalid value for TCP option MSS\n",
1049 opt_mss = g_malloc0 (
sizeof (
struct tcp_opt_mss));
1050 total_opt_len += TCPOLEN_MAXSEG;
1051 opt_mss->
kind = TCPOPT_MAXSEG;
1052 opt_mss->
len = TCPOLEN_MAXSEG;
1053 opt_mss->
mss =
FIX (tcp_opt_val);
1056 if (total_opt_len > opt_size_allocated)
1058 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1059 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1060 ptr_opts_pos = opts + current_opt_len;
1063 memcpy (ptr_opts_pos, (u_char *) opt_mss,
1065 ptr_opts_pos = ptr_opts_pos +
sizeof (
struct tcp_opt_mss);
1071 if (tcp_opt_val < 0 || tcp_opt_val > 14)
1073 nasl_perror (lexic,
"%s: Invalid value for TCP option WScale\n",
1078 total_opt_len += TCPOLEN_WINDOW;
1079 opt_wscale->
kind = TCPOPT_WINDOW;
1080 opt_wscale->
len = TCPOLEN_WINDOW;
1081 opt_wscale->
wscale = tcp_opt_val;
1084 if (total_opt_len > opt_size_allocated)
1086 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1087 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1088 ptr_opts_pos = opts + current_opt_len;
1091 memcpy (ptr_opts_pos, (u_char *) opt_wscale,
1094 g_free (opt_wscale);
1096 case TCPOPT_SACK_PERMITTED:
1098 total_opt_len += TCPOLEN_SACK_PERMITTED;
1099 opt_sack_perm->
kind = TCPOPT_SACK_PERMITTED;
1100 opt_sack_perm->
len = TCPOLEN_SACK_PERMITTED;
1103 if (total_opt_len > opt_size_allocated)
1105 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1106 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1107 ptr_opts_pos = opts + current_opt_len;
1110 memcpy (ptr_opts_pos, (u_char *) opt_sack_perm,
1113 g_free (opt_sack_perm);
1115 case TCPOPT_TIMESTAMP:
1119 if (tcp_opt_val < 0)
1120 nasl_perror (lexic,
"%s: Invalid value for TCP option Timestamp\n",
1123 total_opt_len += TCPOLEN_TIMESTAMP;
1124 opt_tstamp->
kind = TCPOPT_TIMESTAMP;
1125 opt_tstamp->
len = TCPOLEN_TIMESTAMP;
1126 opt_tstamp->
tstamp = htonl (tcp_opt_val);
1127 opt_tstamp->
e_tstamp = htonl (tcp_opt_val2);
1130 if (total_opt_len > opt_size_allocated)
1132 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1133 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1134 ptr_opts_pos = opts + current_opt_len;
1137 memcpy (ptr_opts_pos, (u_char *) opt_tstamp,
1140 g_free (opt_tstamp);
1146 nasl_perror (lexic,
"%s: TCP option %d not supported\n", __func__,
1153 current_opt_len = total_opt_len;
1156 if (total_opt_len % 4 == 0)
1158 opt_size_allocated = opt_size_allocated + 4;
1159 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1160 ptr_opts_pos = opts + total_opt_len;
1162 if (current_opt_len < opt_size_allocated - 1)
1165 for (i = current_opt_len; i < opt_size_allocated - 1; i++)
1167 memcpy (ptr_opts_pos, &nop, 1);
1173 memcpy (ptr_opts_pos, &eol, 1);
1175 tcp = (
struct tcphdr *) (pkt + 40);
1177 if (pktsz <
UNFIX (ip6->ip6_plen))
1185 data_len =
UNFIX (ip6->ip6_plen) - (tcp->th_off * 4);
1186 data = (
char *) ((
char *) tcp + tcp->th_off * 4);
1190 npkt = g_malloc0 (40 + tcp->th_off * 4 + opt_size_allocated + data_len);
1191 memcpy (npkt, pkt,
UNFIX (ip6->ip6_plen) + 40);
1192 ip6 = (
struct ip6_hdr *) (npkt);
1193 tcp = (
struct tcphdr *) (npkt + 40);
1196 memcpy ((
char *) tcp + tcp->th_off * 4, opts, opt_size_allocated);
1197 tcp->th_off = tcp->th_off + (opt_size_allocated / 4);
1199 memcpy ((
char *) tcp + tcp->th_off * 4, data, data_len);
1201 ip6->ip6_plen =
FIX (tcp->th_off * 4 + data_len);
1205 g_malloc0 (
sizeof (
struct v6pseudohdr) + opt_size_allocated + data_len + 1);
1207 memset (&pseudoheader, 0, 38 +
sizeof (
struct tcphdr));
1208 memcpy (&pseudoheader.
s6addr, &ip6->ip6_src, sizeof (
struct in6_addr));
1209 memcpy (&pseudoheader.
d6addr, &ip6->ip6_dst, sizeof (
struct in6_addr));
1211 pseudoheader.
protocol = IPPROTO_TCP;
1213 htons (
sizeof (
struct tcphdr) + opt_size_allocated + data_len);
1218 memcpy ((
char *) &pseudoheader.
tcpheader, (
char *) tcp,
1219 sizeof (
struct tcphdr));
1222 memcpy (tcpsumdata, (
char *) &pseudoheader,
sizeof (
struct v6pseudohdr));
1223 memcpy (tcpsumdata +
sizeof (
struct v6pseudohdr), (
char *) opts,
1224 opt_size_allocated);
1226 memcpy (tcpsumdata +
sizeof (
struct v6pseudohdr) + opt_size_allocated,
1227 (
char *) data, data_len);
1230 38 +
sizeof (
struct tcphdr) + opt_size_allocated + data_len);
1232 g_free (tcpsumdata);
1235 retc->
size = 40 + (tcp->th_off * 4) + data_len;
1253 int options_len = 0;
1258 struct ip6_hdr *ip6 = (
struct ip6_hdr *) pkt;
1259 struct tcphdr *tcp = (
struct tcphdr *) (pkt + 40);
1266 printf (
"------\n");
1267 printf (
"\tth_sport : %d\n", ntohs (tcp->th_sport));
1268 printf (
"\tth_dport : %d\n", ntohs (tcp->th_dport));
1269 printf (
"\tth_seq : %u\n", (
unsigned int) ntohl (tcp->th_seq));
1270 printf (
"\tth_ack : %u\n", (
unsigned int) ntohl (tcp->th_ack));
1271 printf (
"\tth_x2 : %d\n", tcp->th_x2);
1272 printf (
"\tth_off : %d\n", tcp->th_off);
1273 printf (
"\tth_flags : ");
1274 if (tcp->th_flags & TH_FIN)
1279 if (tcp->th_flags & TH_SYN)
1286 if (tcp->th_flags & TH_RST)
1293 if (tcp->th_flags & TH_PUSH)
1300 if (tcp->th_flags & TH_ACK)
1307 if (tcp->th_flags & TH_URG)
1317 printf (
" (%d)", tcp->th_flags);
1319 printf (
"\tth_win : %d\n", ntohs (tcp->th_win));
1320 printf (
"\tth_sum : 0x%x\n", tcp->th_sum);
1321 printf (
"\tth_urp : %d\n", tcp->th_urp);
1323 options_len =
sizeof (uint8_t) * 4 * (tcp->th_off - 5);
1325 if (options_len > 5)
1330 options = (
char *) g_malloc0 (options_len);
1331 memcpy (options, (
char *) tcp + 20, options_len);
1333 tcp_all_options = g_malloc0 (
sizeof (
struct tcp_options));
1335 if (tcp_all_options != NULL)
1337 printf (
"\tTCP Options:\n");
1338 printf (
"\t\tTCPOPT_MAXSEG: %u\n",
1339 ntohs ((uint16_t) tcp_all_options->
mss.
mss));
1340 printf (
"\t\tTCPOPT_WINDOW: %u\n",
1342 printf (
"\t\tTCPOPT_SACK_PERMITTED: %u\n",
1344 printf (
"\t\tTCPOPT_TIMESTAMP TSval: %u\n",
1346 printf (
"\t\tTCPOPT_TIMESTAMP TSecr: %u\n",
1350 g_free (tcp_all_options);
1352 printf (
"\n\tData : ");
1353 c = (
char *) ((
char *) tcp +
sizeof (
struct tcphdr) + options_len);
1354 if (
UNFIX (ip6->ip6_plen) > (sizeof (
struct tcphdr) + options_len))
1356 j <
UNFIX (ip6->ip6_plen) -
sizeof (
struct tcphdr) - options_len
1359 printf (
"%c", isprint (c[j]) ? c[j] :
'.');
1405 struct ip6_hdr *udp_packet;
1408 pkt = g_malloc0 (
sizeof (
struct udphdr) + 40 + data_len);
1409 udp_packet = (
struct ip6_hdr *) pkt;
1410 udp = (
struct udphdr *) (pkt + 40);
1413 bcopy ((
char *) ip6, pkt, 40);
1418 lexic,
"uh_ulen", data_len +
sizeof (
struct udphdr)));
1420 if (data_len != 0 && data != NULL)
1421 bcopy (data, (pkt + 40 +
sizeof (
struct udphdr)), data_len);
1430 memcpy (&
pseudohdr.s6addr, &ip6->ip6_src, sizeof (
struct in6_addr));
1431 memcpy (&
pseudohdr.d6addr, &ip6->ip6_dst, sizeof (
struct in6_addr));
1434 pseudohdr.len = htons (
sizeof (
struct udphdr) + data_len);
1435 bcopy ((
char *) udp, (
char *) &
pseudohdr.udpheader,
1436 sizeof (
struct udphdr));
1440 bcopy ((
char *) data, udpsumdata +
sizeof (
pseudohdr), data_len);
1442 udp->uh_sum =
np_in_cksum ((
unsigned short *) udpsumdata,
1443 38 +
sizeof (
struct udphdr) + data_len);
1444 g_free (udpsumdata);
1447 if (
UNFIX (udp_packet->ip6_ctlun.ip6_un1.ip6_un1_plen) <= 40)
1452 udp_packet->ip6_ctlun.ip6_un1.ip6_un1_plen =
1453 FIX (ntohs (udp->uh_ulen));
1459 retc->
size = 8 + 40 + data_len;
1464 nasl_perror (lexic,
"forge_udp_v6_packet:'ip6' argument missing. \n");
1485 struct udphdr *udphdr;
1492 if (udp == NULL || element == NULL)
1495 lexic,
"get_udp_v6_element() usage :\n"
1496 "element = get_udp_v6_element(udp:<udp>,element:<element>\n");
1500 if (40 +
sizeof (
struct udphdr) > ipsz)
1503 udphdr = (
struct udphdr *) (udp + 40);
1504 if (!strcmp (element,
"uh_sport"))
1505 ret = ntohs (udphdr->uh_sport);
1506 else if (!strcmp (element,
"uh_dport"))
1507 ret = ntohs (udphdr->uh_dport);
1508 else if (!strcmp (element,
"uh_ulen"))
1509 ret = ntohs (udphdr->uh_ulen);
1510 else if (!strcmp (element,
"uh_sum"))
1511 ret = ntohs (udphdr->uh_sum);
1512 else if (!strcmp (element,
"data"))
1516 sz = ntohs (udphdr->uh_ulen) -
sizeof (
struct udphdr);
1518 if (ntohs (udphdr->uh_ulen) - 40 - sizeof (
struct udphdr) > ipsz)
1519 sz = ipsz - 40 -
sizeof (
struct udphdr);
1523 bcopy (udp + 40 +
sizeof (
struct udphdr), retc->
x.
str_val, sz);
1528 nasl_perror (lexic,
"%s is not a value of a udp packet\n", element);
1565 if (40 +
sizeof (
struct udphdr) > sz)
1571 sz = 40 +
sizeof (
struct udphdr) + data_len;
1572 pkt = g_malloc0 (sz);
1573 bcopy (ip6, pkt, 40 +
sizeof (
struct udphdr));
1577 pkt = g_malloc0 (sz);
1578 bcopy (ip6, pkt, sz);
1581 ip6 = (
struct ip6_hdr *) pkt;
1584 ip6->ip6_ctlun.ip6_un1.ip6_un1_plen =
FIX (sz - 40);
1586 udp = (
struct udphdr *) (pkt + 40);
1593 old_len = ntohs (udp->uh_ulen);
1600 bcopy (data, pkt + 40 +
sizeof (
struct udphdr), data_len);
1601 udp->uh_ulen = htons (
sizeof (
struct udphdr) + data_len);
1607 int len = old_len -
sizeof (
struct udphdr);
1618 ptr = (
char *) udp +
sizeof (
struct udphdr);
1625 pseudohdr.len = htons (
sizeof (
struct udphdr) + data_len);
1626 bcopy ((
char *) udp, (
char *) &
pseudohdr.udpheader,
1627 sizeof (
struct udphdr));
1628 memcpy (&
pseudohdr.s6addr, &ip6->ip6_src, sizeof (
struct in6_addr));
1629 memcpy (&
pseudohdr.d6addr, &ip6->ip6_dst, sizeof (
struct in6_addr));
1633 bcopy ((
char *) ptr, udpsumdata +
sizeof (
pseudohdr), data_len);
1635 udp->uh_sum =
np_in_cksum ((
unsigned short *) udpsumdata,
1636 38 +
sizeof (
struct udphdr)
1638 g_free (udpsumdata);
1647 "set_udp_v6_elements: You must supply the 'udp' argument !\n");
1667 struct udphdr *udp = (
struct udphdr *) (pkt +
sizeof (
struct ip6_hdr));
1671 printf (
"------\n");
1672 printf (
"\tuh_sport : %d\n", ntohs (udp->uh_sport));
1673 printf (
"\tuh_dport : %d\n", ntohs (udp->uh_dport));
1674 printf (
"\tuh_sum : 0x%x\n", udp->uh_sum);
1675 printf (
"\tuh_ulen : %d\n", ntohs (udp->uh_ulen));
1676 printf (
"\tdata : ");
1678 if (udp->uh_ulen > sizeof (
struct udphdr))
1679 for (j =
sizeof (
struct udphdr); j < ntohs (udp->uh_ulen) && j < limit;
1681 printf (
"%c", isprint (c[j]) ? c[j] :
'.');
1728 struct ip6_hdr *ip6;
1729 struct ip6_hdr *ip6_icmp;
1730 int ip6_sz, size = 0, sz = 0;
1731 struct icmp6_hdr *icmp;
1732 struct nd_router_solicit *routersolicit = NULL;
1733 struct nd_router_advert *routeradvert = NULL;
1734 struct nd_neighbor_solicit *neighborsolicit = NULL;
1735 struct nd_neighbor_advert *neighboradvert = NULL;
1754 pkt = g_malloc0 (ip6_sz + 8 +
len);
1755 ip6_icmp = (
struct ip6_hdr *) pkt;
1757 bcopy (ip6, ip6_icmp, ip6_sz);
1758 p = (
char *) (pkt + ip6_sz);
1759 icmp = (
struct icmp6_hdr *) p;
1762 icmp->icmp6_type = t;
1766 case ICMP6_ECHO_REQUEST:
1769 bcopy (data, &(p[8]),
len);
1772 size = ip6_sz + 8 +
len;
1776 case ND_ROUTER_SOLICIT:
1779 g_realloc (pkt, ip6_sz +
sizeof (
struct nd_router_solicit) +
len);
1780 p = (
char *) (pkt + ip6_sz);
1782 ip6_icmp = (
struct ip6_hdr *) pkt;
1783 routersolicit = (
struct nd_router_solicit *) p;
1784 ((
struct icmp6_hdr *) routersolicit)->icmp6_type = icmp->icmp6_type;
1785 ((
struct icmp6_hdr *) routersolicit)->icmp6_code = icmp->icmp6_code;
1786 ((
struct icmp6_hdr *) routersolicit)->icmp6_cksum =
1788 size = ip6_sz +
sizeof (
struct nd_router_solicit) +
len;
1792 case ND_ROUTER_ADVERT:
1795 g_realloc (pkt, ip6_sz +
sizeof (
struct nd_router_advert) +
len);
1796 p = (
char *) (pkt + ip6_sz);
1798 ip6_icmp = (
struct ip6_hdr *) pkt;
1800 routeradvert = (
struct nd_router_advert *) p;
1802 ((
struct icmp6_hdr *) routeradvert)->icmp6_type = icmp->icmp6_type;
1803 ((
struct icmp6_hdr *) routeradvert)->icmp6_code = icmp->icmp6_code;
1804 ((
struct icmp6_hdr *) routeradvert)->icmp6_cksum =
1806 routeradvert->nd_ra_reachable =
1808 routeradvert->nd_ra_retransmit =
1810 routeradvert->nd_ra_curhoplimit = ip6_icmp->ip6_hlim;
1811 routeradvert->nd_ra_flags_reserved =
1813 size = ip6_sz +
sizeof (
struct nd_router_advert) +
len;
1818 case ND_NEIGHBOR_SOLICIT:
1821 pkt = g_realloc (pkt, ip6_sz +
sizeof (
struct nd_neighbor_solicit)
1824 p = (
char *) (pkt + ip6_sz);
1826 ip6_icmp = (
struct ip6_hdr *) pkt;
1829 memmove (&(p[8 + 16]), data,
len);
1831 neighborsolicit = (
struct nd_neighbor_solicit *) p;
1833 ((
struct icmp6_hdr *) neighborsolicit)->icmp6_type =
1835 ((
struct icmp6_hdr *) neighborsolicit)->icmp6_code =
1837 ((
struct icmp6_hdr *) neighborsolicit)->icmp6_cksum =
1840 memcpy (&neighborsolicit->nd_ns_target, &ip6_icmp->ip6_dst,
1841 sizeof (
struct in6_addr));
1842 size = ip6_sz +
sizeof (
struct nd_neighbor_solicit) +
len;
1846 case ND_NEIGHBOR_ADVERT:
1848 pkt = g_realloc (pkt,
1849 ip6_sz +
sizeof (
struct nd_neighbor_advert) +
len);
1851 ip6_icmp = (
struct ip6_hdr *) pkt;
1852 p = (
char *) (pkt + 40);
1853 neighboradvert = (
struct nd_neighbor_advert *) p;
1855 ((
struct icmp6_hdr *) neighboradvert)->icmp6_type =
1857 ((
struct icmp6_hdr *) neighboradvert)->icmp6_code =
1859 ((
struct icmp6_hdr *) neighboradvert)->icmp6_cksum =
1861 neighboradvert->nd_na_flags_reserved =
1863 if (neighboradvert->nd_na_flags_reserved & 0x00000020)
1865 &neighboradvert->nd_na_target, &ip6_icmp->ip6_src,
1866 sizeof (
struct in6_addr));
1871 &neighboradvert->nd_na_target);
1875 "forge_icmp_v6_packet: missing 'target' "
1876 "parameter required for constructing response "
1877 "to a Neighbor Solicitation\n");
1882 size = ip6_sz +
sizeof (
struct nd_neighbor_advert) +
len;
1888 if (t < 0 || t > 255)
1890 nasl_perror (lexic,
"forge_icmp_v6_packet: illegal type %d\n",
1896 bcopy (data, &(p[8]),
len);
1899 size = ip6_sz + 8 +
len;
1905 if (
UNFIX (ip6_icmp->ip6_ctlun.ip6_un1.ip6_un1_plen) <= 40)
1909 ip6_icmp->ip6_ctlun.ip6_un1.ip6_un1_plen =
FIX (size - ip6_sz);
1919 memcpy (&
pseudohdr.s6addr, &ip6->ip6_src, sizeof (
struct in6_addr));
1920 memcpy (&
pseudohdr.d6addr, &ip6->ip6_dst, sizeof (
struct in6_addr));
1924 bcopy ((
char *) icmp, (
char *) &
pseudohdr.icmpheader, sz);
1927 bcopy ((
char *) data, icmpsumdata +
sizeof (
pseudohdr),
len);
1929 np_in_cksum ((
unsigned short *) icmpsumdata, size);
1930 g_free (icmpsumdata);
1937 case ICMP6_ECHO_REQUEST:
1939 case ND_ROUTER_SOLICIT:
1941 routersolicit->nd_rs_hdr.icmp6_cksum = icmp->icmp6_cksum;
1944 case ND_ROUTER_ADVERT:
1946 routeradvert->nd_ra_hdr.icmp6_cksum = icmp->icmp6_cksum;
1949 case ND_NEIGHBOR_SOLICIT:
1951 neighborsolicit->nd_ns_hdr.icmp6_cksum = icmp->icmp6_cksum;
1954 case ND_NEIGHBOR_ADVERT:
1956 neighboradvert->nd_na_hdr.icmp6_cksum = icmp->icmp6_cksum;
1968 nasl_perror (lexic,
"forge_icmp_v6_packet: missing 'ip6' parameter\n");
1986 struct icmp6_hdr *icmp;
1995 icmp = (
struct icmp6_hdr *) (p + 40);
1999 nasl_perror (lexic,
"%s: Missing 'element' argument\n", __func__);
2003 else if (!strcmp (elem,
"icmp_code"))
2004 value = icmp->icmp6_code;
2005 else if (!strcmp (elem,
"icmp_type"))
2006 value = icmp->icmp6_type;
2007 else if (!strcmp (elem,
"icmp_cksum"))
2008 value = ntohs (icmp->icmp6_cksum);
2009 else if (!strcmp (elem,
"icmp_id"))
2010 value = ntohs (icmp->icmp6_id);
2011 else if (!strcmp (elem,
"icmp_seq"))
2012 value = ntohs (icmp->icmp6_seq);
2013 else if (!strcmp (elem,
"data"))
2020 memcpy (retc->
x.
str_val, &(p[40 + 8]), retc->
size + 1);
2031 nasl_perror (lexic,
"%s: '%s' not a valid 'element' argument\n",
2041 nasl_perror (lexic,
"%s: missing 'icmp' parameter\n", __func__);
2062 struct ip6_hdr *ip6 = (
struct ip6_hdr *) pkt;
2063 struct icmp6_hdr *icmp;
2064 icmp = (
struct icmp6_hdr *) (pkt + 40);
2066 printf (
"------\n");
2067 printf (
"\ticmp6_id : %d\n", ntohs (icmp->icmp6_id));
2068 printf (
"\ticmp6_code : %d\n", icmp->icmp6_code);
2069 printf (
"\ticmp6_type : %u\n", icmp->icmp6_type);
2070 printf (
"\ticmp6_seq : %u\n", ntohs (icmp->icmp6_seq));
2071 printf (
"\ticmp6_cksum : %d\n", ntohs (icmp->icmp6_cksum));
2072 printf (
"\tData : ");
2073 c = (
char *) ((
char *) icmp +
sizeof (
struct icmp6_hdr));
2074 if (
UNFIX (ip6->ip6_plen) > (sizeof (
struct icmp6_hdr)))
2076 j <
UNFIX (ip6->ip6_plen) -
sizeof (
struct icmp6_hdr) && j < limit;
2078 printf (
"%c", isprint (c[j]) ? c[j] :
'.');
2118 u_char *pkt = g_malloc0 (
sizeof (
struct igmp6_hdr) + 40 +
len);
2119 struct ip6_hdr *ip6_igmp = (
struct ip6_hdr *) pkt;
2126 bcopy (ip6, ip6_igmp, ipsz);
2128 if (
UNFIX (ip6_igmp->ip6_ctlun.ip6_un1.ip6_un1_plen) <= 40)
2133 ip6_igmp->ip6_ctlun.ip6_un1.ip6_un1_plen =
2137 p = (
char *) (pkt + 40);
2146 inet_pton (AF_INET6, grp, &
igmp->
group);
2152 char *ptmp = (
char *) (pkt + 40 +
sizeof (
struct igmp6_hdr));
2153 bcopy (ptmp, data,
len);
2161 nasl_perror (lexic,
"forge_igmp_v6_packet: missing 'ip6' parameter\n");
2180 u_char packet[
sizeof (
struct ip6_hdr) + sizeof (struct tcphdr)];
2182 struct ip6_hdr *ip = (
struct ip6_hdr *) packet;
2183 struct tcphdr *tcp = (
struct tcphdr *) (packet +
sizeof (
struct ip6_hdr));
2186 struct in6_addr source;
2187 struct sockaddr_in6 soca;
2197#define rnd_tcp_port() (rand () % 65535 + 1024)
2198 int sports[] = {0, 0, 0, 0, 0, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2199 0, 0, 0, 0, 0, 53, 0, 0, 20, 0, 25, 0, 0, 0};
2200 int ports[] = {139, 135, 445, 80, 22, 515, 23, 21, 6000, 1025,
2201 25, 111, 1028, 9100, 1029, 79, 497, 548, 5000, 1917,
2202 53, 161, 9001, 65535, 443, 113, 993, 8080, 0};
2203 char addr[INET6_ADDRSTRLEN];
2205 if (!destination || (IN6_IS_ADDR_V4MAPPED (destination) == 1))
2208 for (i = 0; i <
sizeof (sports) /
sizeof (int); i++)
2214 soc = socket (AF_INET6, SOCK_RAW, IPPROTO_RAW);
2218 if (setsockopt (soc, IPPROTO_IPV6, IP_HDRINCL, (
char *) &opt,
sizeof (opt))
2220 perror (
"setsockopt");
2226 source = *destination;
2229 bzero (&source,
sizeof (source));
2233 snprintf (filter,
sizeof (filter),
"ip6 and src host %s",
2234 inet_ntop (AF_INET6, destination, addr,
sizeof (addr)));
2241 unsigned int num_ports =
sizeof (sports) /
sizeof (
int);
2242 for (i = 0; i < num_ports && !flag; i++)
2244 bzero (packet,
sizeof (packet));
2246 int version = 0x60, tc = 0, fl = 0;
2247 ip->ip6_ctlun.ip6_un1.ip6_un1_flow = version | tc | fl;
2248 ip->ip6_nxt = 0x06, ip->ip6_hlim = 0x40, ip->ip6_src = source;
2249 ip->ip6_dst = *destination;
2250 ip->ip6_ctlun.ip6_un1.ip6_un1_plen =
FIX (
sizeof (
struct tcphdr));
2253 tcp->th_sport = port ? htons (
rnd_tcp_port ()) : htons (sports[i]);
2254 tcp->th_flags = TH_SYN;
2255 tcp->th_dport = port ? htons (port) : htons (ports[i]);
2256 tcp->th_seq = rand ();
2260 tcp->th_win = htons (512);
2268 bzero (&pseudoheader, 38 +
sizeof (
struct tcphdr));
2269 memcpy (&pseudoheader.
s6addr, &ip->ip6_src,
2270 sizeof (
struct in6_addr));
2271 memcpy (&pseudoheader.
d6addr, &ip->ip6_dst,
2272 sizeof (
struct in6_addr));
2274 pseudoheader.
protocol = IPPROTO_TCP;
2275 pseudoheader.
length = htons (
sizeof (
struct tcphdr));
2276 bcopy ((
char *) tcp, (
char *) &pseudoheader.
tcpheader,
2277 sizeof (
struct tcphdr));
2278 tcp->th_sum =
np_in_cksum ((
unsigned short *) &pseudoheader,
2279 38 +
sizeof (
struct tcphdr));
2282 bzero (&soca,
sizeof (soca));
2283 soca.sin6_family = AF_INET6;
2284 soca.sin6_addr = ip->ip6_dst;
2285 if (sendto (soc, (
const void *) ip,
2286 sizeof (
struct tcphdr) +
sizeof (
struct ip6_hdr), 0,
2287 (
struct sockaddr *) &soca,
sizeof (
struct sockaddr_in6))
2294 tv.tv_usec = 100000;
2329 struct sockaddr_in6 sockaddr;
2331 struct ip6_hdr *sip = NULL;
2332 int vi = 0, b = 0,
len = 0;
2341 char name[INET6_ADDRSTRLEN];
2342 int allow_multicast = 0;
2344 if (dstip == NULL || (IN6_IS_ADDR_V4MAPPED (dstip) == 1))
2346 soc = socket (AF_INET6, SOCK_RAW, IPPROTO_RAW);
2350 if (setsockopt (soc, IPPROTO_IPV6, IP_HDRINCL, (
char *) &opt_on,
2353 perror (
"setsockopt");
2360 if ((
unsigned int) sz <
sizeof (
struct ip6_hdr))
2362 nasl_perror (lexic,
"send_v6packet: packet is too short\n");
2366 sip = (
struct ip6_hdr *) ip;
2367 if (use_pcap != 0 && bpf < 0)
2370 bzero (&sockaddr,
sizeof (
struct sockaddr_in6));
2371 sockaddr.sin6_family = AF_INET6;
2372 sockaddr.sin6_addr = sip->ip6_dst;
2374 if (allow_multicast)
2376 struct sockaddr_in6 multicast;
2378 if (setsockopt (soc, SOL_SOCKET, SO_BROADCAST, &opt_on,
2381 perror (
"setsockopt ");
2383 bzero (&multicast,
sizeof (
struct sockaddr_in6));
2384 sockaddr.sin6_family = AF_INET6;
2385 inet_pton (AF_INET6,
"ff02::1", &(multicast.sin6_addr));
2387 if (!IN6_ARE_ADDR_EQUAL (&sockaddr.sin6_addr, &multicast.sin6_addr))
2388 allow_multicast = 0;
2391 if (dstip != NULL && !IN6_ARE_ADDR_EQUAL (&sockaddr.sin6_addr, dstip)
2392 && !allow_multicast)
2394 char txt1[64], txt2[64];
2397 inet_ntop (AF_INET6, &sockaddr.sin6_addr,
name, INET6_ADDRSTRLEN),
2399 txt1[
sizeof (txt1) - 1] =
'\0';
2400 strncpy (txt2, inet_ntop (AF_INET6, dstip,
name, INET6_ADDRSTRLEN),
2402 txt2[
sizeof (txt2) - 1] =
'\0';
2404 "send_v6packet: malicious or buggy script is trying to "
2405 "send packet to %s instead of designated target %s\n",
2413 if (dfl_len > 0 && dfl_len < sz)
2418 b = sendto (soc, (u_char *) ip,
len, 0, (
struct sockaddr *) &sockaddr,
2419 sizeof (
struct sockaddr_in6));
2421 if (b >= 0 && use_pcap != 0 && bpf >= 0)
2428 && (!memcmp (answer, (
char *) ip,
sizeof (
struct ip6_hdr))))
2443 retc->
size = answer_sz;
u_char * bpf_next_tv(int bpf, int *caplen, struct timeval *tv)
Header file for module bpf_share.
struct ip6_hdr * capture_next_v6_packet(int bpf, int timeout, int *sz)
int init_v6_capture_device(struct in6_addr src, struct in6_addr dest, char *filter)
static struct timeval timeval(unsigned long val)
void nasl_perror(lex_ctxt *lexic, char *msg,...)
struct struct_lex_ctxt lex_ctxt
int get_var_size_by_name(lex_ctxt *, const char *)
int get_var_size_by_num(lex_ctxt *, int)
char * get_str_var_by_name(lex_ctxt *, const char *)
char * get_str_var_by_num(lex_ctxt *, int)
long int get_int_var_by_num(lex_ctxt *, int, int)
long int get_int_var_by_name(lex_ctxt *, const char *, int)
tree_cell * get_ip_v6_element(lex_ctxt *lexic)
Obtain IPv6 header element.
tree_cell * dump_ip_v6_packet(lex_ctxt *lexic)
Print IPv6 Header.
tree_cell * set_ip_v6_elements(lex_ctxt *lexic)
Set IPv6 header element.
tree_cell * dump_icmp_v6_packet(lex_ctxt *lexic)
Dump the ICMP part of a IP Datagram.
tree_cell * get_tcp_v6_element(lex_ctxt *lexic)
Get TCP Header element.
tree_cell * forge_ip_v6_packet(lex_ctxt *lexic)
Forge an IPv6 packet.
tree_cell * forge_igmp_v6_packet(lex_ctxt *lexic)
struct v6pseudo_udp_hdr __attribute__
static int np_in_cksum(u_short *p, int n)
tree_cell * set_udp_v6_elements(lex_ctxt *lexic)
tree_cell * dump_tcp_v6_packet(lex_ctxt *lexic)
Dump TCP part of an IPv6 Datagram.
tree_cell * set_tcp_v6_elements(lex_ctxt *lexic)
Set TCP Header element.
tree_cell * get_tcp_v6_option(lex_ctxt *lexic)
Get a TCP option from an IP datagram if present. Possible options are: TCPOPT_MAXSEG (2),...
tree_cell * insert_ip_v6_options(lex_ctxt *lexic)
Adds an IPv6 option to the datagram.
tree_cell * forge_tcp_v6_packet(lex_ctxt *lexic)
Forge TCP packet.
static void get_tcp_options(char *options, struct tcp_options *tcp_all_options)
Extract all TCP option from an IP datagram.
tree_cell * forge_udp_v6_packet(lex_ctxt *lexic)
tree_cell * get_icmp_v6_element(lex_ctxt *lexic)
tree_cell * insert_tcp_v6_options(lex_ctxt *lexic)
Add options to a TCP segment header. Possible options are: TCPOPT_MAXSEG (2), values between 536 and ...
tree_cell * nasl_tcp_v6_ping(lex_ctxt *lexic)
Performs TCP Connect to test if host is alive.
tree_cell * nasl_send_v6packet(lex_ctxt *lexic)
Send forged IPv6 Packets.
tree_cell * get_udp_v6_element(lex_ctxt *lexic)
tree_cell * dump_udp_v6_packet(lex_ctxt *lexic)
tree_cell * forge_icmp_v6_packet(lex_ctxt *lexic)
tree_cell * alloc_typed_cell(int typ)
void deref_cell(tree_cell *c)
int add_var_to_array(nasl_array *a, char *name, const anon_nasl_var *v)
struct st_a_nasl_var anon_nasl_var
struct st_nasl_array nasl_array
int v6_islocalhost(struct in6_addr *addr)
Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.
char * v6_routethrough(struct in6_addr *dest, struct in6_addr *source)
An awesome function to determine what interface a packet to a given destination should be routed thro...
Header file for module pcap.
unsigned int plug_get_host_open_port(struct script_infos *desc)
struct in6_addr * plug_get_host_ip(struct script_infos *args)
Header file for module plugutils.
union TC::@332262321161220155002104006201360276211317150140 x
union st_a_nasl_var::@154137074032032170165360023270032033276061363156 v
struct script_infos * script_infos
struct tcp_opt_wscale wscale
struct tcp_opt_tstamp tstamp
struct tcp_opt_sack_perm sack_perm
struct icmp6_hdr icmpheader