35#ifdef BSD_BYTE_ORDERING
39#define FIX(n) htons (n)
40#define UNFIX(n) ntohs (n)
55 register u_short answer;
56 register long sum = 0;
68 *(u_char *) (&odd_byte) = *(u_char *) p;
72 sum = (sum >> 16) + (sum & 0xffff);
110 struct in6_addr *dst_addr;
116 if (dst_addr == NULL || (IN6_IS_ADDR_V4MAPPED (dst_addr) != 1))
118 nasl_perror (lexic,
"forge_ip_packet: No valid dst_addr could be "
119 "determined via call to plug_get_host_ip().\n");
127 retc->
size =
sizeof (
struct ip) + data_len;
129 pkt = (
struct ip *) g_malloc0 (
sizeof (
struct ip) + data_len);
137 pkt->ip_len =
FIX (20 + data_len);
141 pkt->ip_off =
FIX (pkt->ip_off);
148 inet_aton (s, &pkt->ip_src);
155 inet_aton (s, &pkt->ip_dst);
157 pkt->ip_dst.s_addr = dst_addr->s6_addr32[3];
161 bcopy (data, retc->
x.
str_val + sizeof (
struct ip), data_len);
167 pkt->ip_sum =
np_in_cksum ((u_short *) pkt,
sizeof (
struct ip));
194 nasl_perror (lexic,
"get_ip_element: no valid 'ip' argument\n");
200 nasl_perror (lexic,
"get_ip_element: no valid 'element' argument\n");
204 if (!strcmp (element,
"ip_v"))
209 else if (!strcmp (element,
"ip_id"))
211 ret_int =
UNFIX (ip->ip_id);
214 else if (!strcmp (element,
"ip_hl"))
219 else if (!strcmp (element,
"ip_tos"))
221 ret_int = ip->ip_tos;
224 else if (!strcmp (element,
"ip_len"))
226 ret_int =
UNFIX (ip->ip_len);
229 else if (!strcmp (element,
"ip_off"))
231 ret_int =
UNFIX (ip->ip_off);
234 else if (!strcmp (element,
"ip_ttl"))
236 ret_int = ip->ip_ttl;
239 else if (!strcmp (element,
"ip_p"))
244 else if (!strcmp (element,
"ip_sum"))
246 ret_int =
UNFIX (ip->ip_sum);
257 if (!strcmp (element,
"ip_src"))
259 snprintf (ret_ascii,
sizeof (ret_ascii),
"%s", inet_ntoa (ip->ip_src));
262 else if (!strcmp (element,
"ip_dst"))
264 snprintf (ret_ascii,
sizeof (ret_ascii),
"%s", inet_ntoa (ip->ip_dst));
270 nasl_perror (lexic,
"%s: unknown element '%s'\n", __func__, element);
275 retc->
size = strlen (ret_ascii);
276 retc->
x.
str_val = g_strdup (ret_ascii);
312 nasl_perror (lexic,
"set_ip_elements: missing <ip> field\n");
316 pkt = (
struct ip *) g_malloc0 (size);
317 bcopy (o_pkt, pkt, size);
332 inet_aton (s, &pkt->ip_src);
335 if (pkt->ip_sum == 0)
336 pkt->ip_sum =
np_in_cksum ((u_short *) pkt,
sizeof (
struct ip));
365 struct ip *new_packet;
368 u_char uc_code, uc_len;
376 nasl_perror (lexic,
"Usage : insert_ip_options(ip:<ip>, code:<code>, "
377 "length:<len>, value:<value>\n");
381 pad_len = 4 - ((
sizeof (uc_code) +
sizeof (uc_len) + value_size) % 4);
385 hl = ip->ip_hl * 4 <
UNFIX (ip->ip_len) ? ip->ip_hl * 4 :
UNFIX (ip->ip_len);
386 new_packet = g_malloc0 (size + 4 + value_size + pad_len);
387 bcopy (ip, new_packet, hl);
389 uc_code = (u_char)
code;
390 uc_len = (u_char)
len;
392 p = (
char *) new_packet;
393 bcopy (&uc_code, p + hl,
sizeof (uc_code));
394 bcopy (&uc_len, p + hl +
sizeof (uc_code),
sizeof (uc_len));
395 bcopy (value, p + hl +
sizeof (uc_code) +
sizeof (uc_len), value_size);
398 for (i = 0; i < pad_len; i++)
401 p + hl +
sizeof (uc_code) +
sizeof (uc_len) + value_size + i, 1);
407 + (
sizeof (uc_code) +
sizeof (uc_len) + value_size + pad_len) + hl,
411 (hl + (
sizeof (uc_code) +
sizeof (uc_len) + value_size + pad_len)) / 4;
413 FIX (size +
sizeof (uc_code) +
sizeof (uc_len) + value_size + pad_len);
414 new_packet->ip_sum = 0;
416 (u_short *) new_packet, new_packet->ip_hl * 4 >
UNFIX (new_packet->ip_len)
417 ?
UNFIX (new_packet->ip_len)
418 : new_packet->ip_hl * 4);
421 retc->
size = size + value_size +
sizeof (uc_code) +
sizeof (uc_len) + pad_len;
422 retc->
x.
str_val = (
char *) new_packet;
446 printf (
"\tip_hl : %d\n", ip->ip_hl);
447 printf (
"\tip_v : %d\n", ip->ip_v);
448 printf (
"\tip_tos : %d\n", ip->ip_tos);
449 printf (
"\tip_len : %d\n",
UNFIX (ip->ip_len));
450 printf (
"\tip_id : %d\n", ntohs (ip->ip_id));
451 printf (
"\tip_off : %d\n",
UNFIX (ip->ip_off));
452 printf (
"\tip_ttl : %d\n", ip->ip_ttl);
456 printf (
"\tip_p : IPPROTO_TCP (%d)\n", ip->ip_p);
459 printf (
"\tip_p : IPPROTO_UDP (%d)\n", ip->ip_p);
462 printf (
"\tip_p : IPPROTO_ICMP (%d)\n", ip->ip_p);
465 printf (
"\tip_p : %d\n", ip->ip_p);
468 printf (
"\tip_sum : 0x%x\n", ntohs (ip->ip_sum));
469 printf (
"\tip_src : %s\n", inet_ntoa (ip->ip_src));
470 printf (
"\tip_dst : %s\n", inet_ntoa (ip->ip_dst));
482 struct in_addr
saddr;
483 struct in_addr
daddr;
560 struct ip *ip, *tcp_packet;
568 "forge_tcp_packet: You must supply the 'ip' argument\n");
573 if (ipsz > ip->ip_hl * 4)
574 ipsz = ip->ip_hl * 4;
580 tcp_packet = (
struct ip *) g_malloc0 (ipsz +
sizeof (
struct tcphdr) +
len);
581 retc->
x.
str_val = (
char *) tcp_packet;
583 bcopy (ip, tcp_packet, ipsz);
585 if (
UNFIX (tcp_packet->ip_len) <= tcp_packet->ip_hl * 4)
590 FIX (tcp_packet->ip_hl * 4 + sizeof (
struct tcphdr) +
len);
591 tcp_packet->ip_sum = 0;
593 np_in_cksum ((u_short *) tcp_packet,
sizeof (
struct ip));
596 tcp = (
struct tcphdr *) ((
char *) tcp_packet + tcp_packet->ip_hl * 4);
610 bcopy (data, (
char *) tcp +
sizeof (
struct tcphdr),
len);
615 char *tcpsumdata = g_malloc0 (
sizeof (
struct pseudohdr) +
len + 1);
616 struct in_addr source, dest;
618 source.s_addr = ip->ip_src.s_addr;
619 dest.s_addr = ip->ip_dst.s_addr;
621 bzero (&pseudoheader, 12 +
sizeof (
struct tcphdr));
622 pseudoheader.
saddr.s_addr = source.s_addr;
623 pseudoheader.
daddr.s_addr = dest.s_addr;
625 pseudoheader.
protocol = IPPROTO_TCP;
626 pseudoheader.
length = htons (
sizeof (
struct tcphdr) +
len);
627 bcopy ((
char *) tcp, (
char *) &pseudoheader.
tcpheader,
628 sizeof (
struct tcphdr));
630 bcopy ((
char *) &pseudoheader, tcpsumdata,
sizeof (
struct pseudohdr));
632 bcopy ((
char *) data, tcpsumdata +
sizeof (
struct pseudohdr),
len);
633 tcp->th_sum =
np_in_cksum ((
unsigned short *) tcpsumdata,
634 12 +
sizeof (
struct tcphdr) +
len);
638 retc->
size = ipsz +
sizeof (
struct tcphdr) +
len;
666 nasl_perror (lexic,
"get_tcp_element: No valid 'tcp' argument\n");
670 ip = (
struct ip *) packet;
672 if (ip->ip_hl * 4 > ipsz)
675 if (
UNFIX (ip->ip_len) > ipsz)
678 tcp = (
struct tcphdr *) (packet + ip->ip_hl * 4);
683 nasl_perror (lexic,
"get_tcp_element: No valid 'element' argument\n");
687 if (!strcmp (element,
"th_sport"))
688 ret = ntohs (tcp->th_sport);
689 else if (!strcmp (element,
"th_dsport"))
690 ret = ntohs (tcp->th_dport);
691 else if (!strcmp (element,
"th_seq"))
692 ret = ntohl (tcp->th_seq);
693 else if (!strcmp (element,
"th_ack"))
694 ret = ntohl (tcp->th_ack);
695 else if (!strcmp (element,
"th_x2"))
697 else if (!strcmp (element,
"th_off"))
699 else if (!strcmp (element,
"th_flags"))
701 else if (!strcmp (element,
"th_win"))
702 ret = ntohs (tcp->th_win);
703 else if (!strcmp (element,
"th_sum"))
705 else if (!strcmp (element,
"th_urp"))
707 else if (!strcmp (element,
"data"))
710 retc->
size =
UNFIX (ip->ip_len) - (tcp->th_off + ip->ip_hl) * 4;
712 bcopy ((
char *) tcp + tcp->th_off * 4, retc->
x.
str_val, retc->
size);
717 nasl_perror (lexic,
"get_tcp_element: Unknown tcp field %s\n", element);
739 opt_kind = (uint8_t *) options;
741 while (*opt_kind != 0)
746 tcp_all_options->
mss.
kind = *opt_kind;
747 tcp_all_options->
mss.
len = *(opt_kind + 1);
748 tcp_all_options->
mss.
mss = *((uint16_t *) (opt_kind + 2));
749 opt_kind = opt_kind + *(opt_kind + 1);
753 tcp_all_options->
wscale.
len = *(opt_kind + 1);
754 tcp_all_options->
wscale.
wscale = (uint8_t) * (opt_kind + 2);
755 opt_kind = opt_kind + *(opt_kind + 1);
757 case TCPOPT_SACK_PERMITTED:
760 opt_kind = opt_kind + *(opt_kind + 1);
762 case TCPOPT_TIMESTAMP:
764 tcp_all_options->
tstamp.
len = *(opt_kind + 1);
765 tcp_all_options->
tstamp.
tstamp = *((uint32_t *) (opt_kind + 2));
766 tcp_all_options->
tstamp.
e_tstamp = *((uint32_t *) (opt_kind + 6));
767 opt_kind = opt_kind + *(opt_kind + 1);
774 opt_kind = opt_kind + *(opt_kind + 1);
777 g_debug (
"%s: Unsupported %u TCP option. "
778 "Not all options are returned.",
779 __func__, *opt_kind);
818 nasl_perror (lexic,
"%s: No valid 'tcp' argument passed.\n", __func__);
827 "Usage: %s(tcp:<tcp>, option:<TCPOPT>)",
832 ip = (
struct ip *) packet;
835 if (ip->ip_hl * 4 > ipsz)
838 if (
UNFIX (ip->ip_len) > ipsz)
841 tcp = (
struct tcphdr *) (packet + ip->ip_hl * 4);
843 if (tcp->th_off <= 5)
847 options = (
char *) g_malloc0 (
sizeof (uint8_t) * 4 * (tcp->th_off - 5));
848 memcpy (options, (
char *) tcp + 20, (tcp->th_off - 5) * 4);
850 tcp_all_options = g_malloc0 (
sizeof (
struct tcp_options));
852 if (tcp_all_options == NULL)
854 nasl_perror (lexic,
"%s: No TCP options found in passed TCP packet.\n",
867 retc->
x.
i_val = ntohs ((uint16_t) tcp_all_options->
mss.
mss);
873 case TCPOPT_SACK_PERMITTED:
877 case TCPOPT_TIMESTAMP:
881 memset (&v, 0,
sizeof (v));
886 memset (&v, 0,
sizeof (v));
892 nasl_perror (lexic,
"%s: Invalid TCP option passed.\n", __func__);
896 g_free (tcp_all_options);
932 struct ip *ip = (
struct ip *) pkt;
943 "set_tcp_elements: Invalid value for the argument 'tcp'\n");
947 if (ip->ip_hl * 4 > pktsz)
949 (
struct tcphdr *) (pkt
952 tcp = (
struct tcphdr *) (pkt + ip->ip_hl * 4);
954 if (pktsz <
UNFIX (ip->ip_len))
959 data_len =
UNFIX (ip->ip_len) - (ip->ip_hl * 4) - (tcp->th_off * 4);
960 data = (
char *) ((
char *) tcp + tcp->th_off * 4);
963 npkt = g_malloc0 (ip->ip_hl * 4 + tcp->th_off * 4 + data_len);
964 bcopy (pkt, npkt,
UNFIX (ip->ip_len));
966 ip = (
struct ip *) (npkt);
967 tcp = (
struct tcphdr *) (npkt + ip->ip_hl * 4);
984 bcopy (data, (
char *) tcp + tcp->th_off * 4, data_len);
988 ip->ip_len = ip->ip_hl * 4 + tcp->th_off * 4 + data_len;
990 ip->ip_sum =
np_in_cksum ((u_short *) pkt, ip->ip_hl * 4);
993 if (tcp->th_sum == 0)
996 char *tcpsumdata = g_malloc0 (
sizeof (
struct pseudohdr) + data_len + 1);
997 struct in_addr source, dest;
999 source.s_addr = ip->ip_src.s_addr;
1000 dest.s_addr = ip->ip_dst.s_addr;
1002 bzero (&pseudoheader,
sizeof (pseudoheader));
1003 pseudoheader.
saddr.s_addr = source.s_addr;
1004 pseudoheader.
daddr.s_addr = dest.s_addr;
1006 pseudoheader.
protocol = IPPROTO_TCP;
1007 pseudoheader.
length = htons (
sizeof (
struct tcphdr) + data_len);
1008 bcopy ((
char *) tcp, (
char *) &pseudoheader.
tcpheader,
1009 sizeof (
struct tcphdr));
1011 bcopy ((
char *) &pseudoheader, tcpsumdata,
sizeof (
struct pseudohdr));
1012 bcopy ((
char *) data, tcpsumdata +
sizeof (
struct pseudohdr), data_len);
1013 tcp->th_sum =
np_in_cksum ((
unsigned short *) tcpsumdata,
1014 sizeof (pseudoheader) + data_len);
1015 g_free (tcpsumdata);
1019 retc->
size = (ip->ip_hl * 4) + (tcp->th_off * 4) + data_len;
1045 struct ip *ip = (
struct ip *) pkt;
1052 int tcp_opt, tcp_opt_val, tcp_opt_val2;
1053 int current_opt_len, total_opt_len, opt_size_allocated;
1054 char *opts, *ptr_opts_pos;
1065 nasl_perror (lexic,
"%s: Invalid value for the argument 'tcp'\n",
1070 opts = g_malloc0 (
sizeof (
char) * 4);
1071 ptr_opts_pos = opts;
1072 opt_size_allocated = 4;
1077 current_opt_len = total_opt_len;
1087 if (tcp_opt_val < (
int) TCP_MSS_DEFAULT || tcp_opt_val > 65535)
1089 nasl_perror (lexic,
"%s: Invalid value for TCP option MSS\n",
1093 opt_mss = g_malloc0 (
sizeof (
struct tcp_opt_mss));
1094 total_opt_len += TCPOLEN_MAXSEG;
1095 opt_mss->
kind = TCPOPT_MAXSEG;
1096 opt_mss->
len = TCPOLEN_MAXSEG;
1097 opt_mss->
mss =
FIX (tcp_opt_val);
1100 if (total_opt_len > opt_size_allocated)
1102 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1103 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1104 ptr_opts_pos = opts + current_opt_len;
1107 memcpy (ptr_opts_pos, (u_char *) opt_mss,
1109 ptr_opts_pos = ptr_opts_pos +
sizeof (
struct tcp_opt_mss);
1115 if (tcp_opt_val < 0 || tcp_opt_val > 14)
1117 nasl_perror (lexic,
"%s: Invalid value for TCP option WScale\n",
1122 total_opt_len += TCPOLEN_WINDOW;
1123 opt_wscale->
kind = TCPOPT_WINDOW;
1124 opt_wscale->
len = TCPOLEN_WINDOW;
1125 opt_wscale->
wscale = tcp_opt_val;
1128 if (total_opt_len > opt_size_allocated)
1130 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1131 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1132 ptr_opts_pos = opts + current_opt_len;
1135 memcpy (ptr_opts_pos, (u_char *) opt_wscale,
1138 g_free (opt_wscale);
1140 case TCPOPT_SACK_PERMITTED:
1142 total_opt_len += TCPOLEN_SACK_PERMITTED;
1143 opt_sack_perm->
kind = TCPOPT_SACK_PERMITTED;
1144 opt_sack_perm->
len = TCPOLEN_SACK_PERMITTED;
1147 if (total_opt_len > opt_size_allocated)
1149 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1150 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1151 ptr_opts_pos = opts + current_opt_len;
1154 memcpy (ptr_opts_pos, (u_char *) opt_sack_perm,
1157 g_free (opt_sack_perm);
1159 case TCPOPT_TIMESTAMP:
1163 if (tcp_opt_val < 0)
1164 nasl_perror (lexic,
"%s: Invalid value for TCP option Timestamp\n",
1167 total_opt_len += TCPOLEN_TIMESTAMP;
1168 opt_tstamp->
kind = TCPOPT_TIMESTAMP;
1169 opt_tstamp->
len = TCPOLEN_TIMESTAMP;
1170 opt_tstamp->
tstamp = htonl (tcp_opt_val);
1171 opt_tstamp->
e_tstamp = htonl (tcp_opt_val2);
1174 if (total_opt_len > opt_size_allocated)
1176 opt_size_allocated = ((total_opt_len / 4) + 1) * 4;
1177 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1178 ptr_opts_pos = opts + current_opt_len;
1181 memcpy (ptr_opts_pos, (u_char *) opt_tstamp,
1184 g_free (opt_tstamp);
1190 nasl_perror (lexic,
"%s: TCP option %d not supported\n", __func__,
1197 current_opt_len = total_opt_len;
1200 if (total_opt_len % 4 == 0)
1202 opt_size_allocated = opt_size_allocated + 4;
1203 opts = g_realloc (opts,
sizeof (
char) * opt_size_allocated);
1204 ptr_opts_pos = opts + total_opt_len;
1206 if (current_opt_len < opt_size_allocated - 1)
1209 for (i = current_opt_len; i < opt_size_allocated - 1; i++)
1211 memcpy (ptr_opts_pos, &nop, 1);
1217 memcpy (ptr_opts_pos, &eol, 1);
1219 if (ip->ip_hl * 4 > pktsz)
1221 tcp = (
struct tcphdr *) (pkt + 20);
1223 tcp = (
struct tcphdr *) (pkt + ip->ip_hl * 4);
1225 if (pktsz <
UNFIX (ip->ip_len))
1233 data_len =
UNFIX (ip->ip_len) - (ip->ip_hl * 4) - (tcp->th_off * 4);
1234 data = (
char *) ((
char *) tcp + tcp->th_off * 4);
1239 g_malloc0 (ip->ip_hl * 4 + tcp->th_off * 4 + opt_size_allocated + data_len);
1240 memcpy (npkt, pkt,
UNFIX (ip->ip_len));
1241 ip = (
struct ip *) (npkt);
1242 tcp = (
struct tcphdr *) (npkt + ip->ip_hl * 4);
1245 memcpy ((
char *) tcp + tcp->th_off * 4, opts, opt_size_allocated);
1247 tcp->th_off = tcp->th_off + (opt_size_allocated / 4);
1248 memcpy ((
char *) tcp + tcp->th_off * 4, data, data_len);
1251 ip->ip_len =
FIX (ip->ip_hl * 4 + tcp->th_off * 4 + data_len);
1253 ip->ip_sum =
np_in_cksum ((u_short *) npkt, ip->ip_hl * 4);
1258 g_malloc0 (
sizeof (
struct pseudohdr) + opt_size_allocated + data_len + 1);
1259 struct in_addr source, dest;
1261 source.s_addr = ip->ip_src.s_addr;
1262 dest.s_addr = ip->ip_dst.s_addr;
1264 memset (&pseudoheader, 0,
sizeof (
struct pseudohdr));
1265 pseudoheader.
saddr.s_addr = source.s_addr;
1266 pseudoheader.
daddr.s_addr = dest.s_addr;
1268 pseudoheader.
protocol = IPPROTO_TCP;
1271 htons (
sizeof (
struct tcphdr) + opt_size_allocated + data_len);
1276 memcpy ((
char *) &pseudoheader.
tcpheader, (
char *) tcp,
1277 sizeof (
struct tcphdr));
1280 memcpy (tcpsumdata, (
char *) &pseudoheader,
sizeof (
struct pseudohdr));
1281 memcpy (tcpsumdata +
sizeof (
struct pseudohdr), (
char *) opts,
1282 opt_size_allocated);
1283 memcpy (tcpsumdata +
sizeof (
struct pseudohdr) + opt_size_allocated,
1284 (
char *) data, data_len);
1287 sizeof (
struct pseudohdr) + opt_size_allocated + data_len);
1289 g_free (tcpsumdata);
1292 retc->
size = (ip->ip_hl * 4) + (tcp->th_off * 4) + data_len;
1311 struct ip *ip = (
struct ip *) pkt;
1312 struct tcphdr *tcp = (
struct tcphdr *) (pkt + ip->ip_hl * 4);
1317 printf (
"------\n");
1318 printf (
"\tth_sport : %d\n", ntohs (tcp->th_sport));
1319 printf (
"\tth_dport : %d\n", ntohs (tcp->th_dport));
1320 printf (
"\tth_seq : %u\n", (
unsigned int) ntohl (tcp->th_seq));
1321 printf (
"\tth_ack : %u\n", (
unsigned int) ntohl (tcp->th_ack));
1322 printf (
"\tth_x2 : %d\n", tcp->th_x2);
1323 printf (
"\tth_off : %d\n", tcp->th_off);
1324 printf (
"\tth_flags : ");
1325 if (tcp->th_flags & TH_FIN)
1330 if (tcp->th_flags & TH_SYN)
1337 if (tcp->th_flags & TH_RST)
1344 if (tcp->th_flags & TH_PUSH)
1351 if (tcp->th_flags & TH_ACK)
1358 if (tcp->th_flags & TH_URG)
1368 printf (
" (%d)", tcp->th_flags);
1370 printf (
"\tth_win : %d\n", ntohs (tcp->th_win));
1371 printf (
"\tth_sum : 0x%x\n", ntohs (tcp->th_sum));
1372 printf (
"\tth_urp : %d\n", ntohs (tcp->th_urp));
1374 if (tcp->th_off > 5)
1380 (
char *) g_malloc0 (
sizeof (uint8_t) * 4 * (tcp->th_off - 5));
1381 memcpy (options, (
char *) tcp + 20, (tcp->th_off - 5) * 4);
1383 tcp_all_options = g_malloc0 (
sizeof (
struct tcp_options));
1385 if (tcp_all_options != NULL)
1387 printf (
"\tTCP Options:\n");
1388 printf (
"\t\tTCPOPT_MAXSEG: %u\n",
1389 ntohs ((uint16_t) tcp_all_options->
mss.
mss));
1390 printf (
"\t\tTCPOPT_WINDOW: %u\n",
1392 printf (
"\t\tTCPOPT_SACK_PERMITTED: %u\n",
1394 printf (
"\t\tTCPOPT_TIMESTAMP TSval: %u\n",
1396 printf (
"\t\tTCPOPT_TIMESTAMP TSecr: %u\n",
1400 g_free (tcp_all_options);
1403 printf (
"\n\tData : ");
1404 c = (
char *) ((
char *) tcp +
sizeof (
struct tcphdr)
1405 +
sizeof (uint8_t) * 4 * (tcp->th_off - 5));
1406 if (
UNFIX (ip->ip_len) > (sizeof (
struct ip) +
sizeof (
struct tcphdr)))
1407 for (j = 0; j <
UNFIX (ip->ip_len) -
sizeof (
struct ip)
1408 - sizeof (struct tcphdr)
1409 - sizeof (uint8_t) * 4 * (tcp->th_off - 5)
1412 printf (
"%c", isprint (c[j]) ? c[j] :
'.');
1461 struct ip *udp_packet;
1464 pkt = g_malloc0 (
sizeof (
struct udphdr) + ip->ip_hl * 4
1465 + sizeof (
struct udphdr) + data_len);
1467 udp_packet = (
struct ip *) pkt;
1468 udp = (
struct udphdr *) (pkt + ip->ip_hl * 4);
1473 lexic,
"uh_ulen", data_len +
sizeof (
struct udphdr)));
1476 if (data_len != 0 && data != NULL)
1477 bcopy (data, (pkt + ip->ip_hl * 4 + sizeof (
struct udphdr)), data_len);
1480 bcopy ((
char *) ip, pkt, ip->ip_hl * 4);
1481 if (udp->uh_sum == 0)
1484 struct in_addr source, dest;
1488 source.s_addr = ip->ip_src.s_addr;
1489 dest.s_addr = ip->ip_dst.s_addr;
1496 pseudohdr.len = htons (
sizeof (
struct udphdr) + data_len);
1497 bcopy ((
char *) udp, (
char *) &
pseudohdr.udpheader,
1498 sizeof (
struct udphdr));
1502 bcopy ((
char *) data, udpsumdata +
sizeof (
pseudohdr), data_len);
1504 udp->uh_sum =
np_in_cksum ((
unsigned short *) udpsumdata,
1505 12 +
sizeof (
struct udphdr) + data_len);
1506 g_free (udpsumdata);
1509 if (
UNFIX (udp_packet->ip_len) <= udp_packet->ip_hl * 4)
1514 udp_packet->ip_len =
1515 FIX (ntohs (udp->uh_ulen) + (udp_packet->ip_hl * 4));
1516 udp_packet->ip_sum = 0;
1517 udp_packet->ip_sum =
1518 np_in_cksum ((u_short *) udp_packet, udp_packet->ip_hl * 4);
1524 retc->
size = 8 + ip->ip_hl * 4 + data_len;
1529 "forge_udp_packet: Invalid value for the argument 'ip'\n");
1551 struct udphdr *udphdr;
1558 if (udp == NULL || element == NULL)
1560 nasl_perror (lexic,
"get_udp_element: usage :\nelement = "
1561 "get_udp_element(udp:<udp>,element:<element>\n");
1564 ip = (
struct ip *) udp;
1566 if (ip->ip_hl * 4 + sizeof (
struct udphdr) > ipsz)
1569 udphdr = (
struct udphdr *) (udp + ip->ip_hl * 4);
1570 if (!strcmp (element,
"uh_sport"))
1571 ret = ntohs (udphdr->uh_sport);
1572 else if (!strcmp (element,
"uh_dport"))
1573 ret = ntohs (udphdr->uh_dport);
1574 else if (!strcmp (element,
"uh_ulen"))
1575 ret = ntohs (udphdr->uh_ulen);
1576 else if (!strcmp (element,
"uh_sum"))
1577 ret = ntohs (udphdr->uh_sum);
1578 else if (!strcmp (element,
"data"))
1582 sz = ntohs (udphdr->uh_ulen) -
sizeof (
struct udphdr);
1584 if (ntohs (udphdr->uh_ulen) - ip->ip_hl * 4 - sizeof (
struct udphdr)
1586 sz = ipsz - ip->ip_hl * 4 - sizeof (
struct udphdr);
1590 bcopy (udp + ip->ip_hl * 4 + sizeof (
struct udphdr), retc->
x.
str_val, sz);
1595 nasl_perror (lexic,
"%s: '%s' is not a value of a udp packet\n", __func__,
1634 if (ip->ip_hl * 4 + sizeof (
struct udphdr) > sz)
1639 sz = ip->ip_hl * 4 +
sizeof (
struct udphdr) + data_len;
1640 pkt = g_malloc0 (sz);
1641 bcopy (ip, pkt, ip->ip_hl * 4 + sizeof (
struct udphdr));
1645 pkt = g_malloc0 (sz);
1646 bcopy (ip, pkt, sz);
1649 ip = (
struct ip *) pkt;
1652 ip->ip_len =
FIX (sz);
1654 ip->ip_sum =
np_in_cksum ((u_short *) ip, ip->ip_hl * 4);
1656 udp = (
struct udphdr *) (pkt + ip->ip_hl * 4);
1662 old_len = ntohs (udp->uh_ulen);
1669 bcopy (data, pkt + ip->ip_hl * 4 + sizeof (
struct udphdr), data_len);
1670 udp->uh_ulen = htons (
sizeof (
struct udphdr) + data_len);
1673 if (udp->uh_sum == 0)
1676 struct in_addr source, dest;
1677 int len = old_len -
sizeof (
struct udphdr);
1688 ptr = (
char *) udp +
sizeof (
struct udphdr);
1693 source.s_addr = ip->ip_src.s_addr;
1694 dest.s_addr = ip->ip_dst.s_addr;
1702 bcopy ((
char *) udp, (
char *) &
pseudohdr.udpheader,
1703 sizeof (
struct udphdr));
1707 bcopy ((
char *) ptr, udpsumdata +
sizeof (
pseudohdr),
len);
1709 udp->uh_sum =
np_in_cksum ((
unsigned short *) udpsumdata,
1710 12 +
sizeof (
struct udphdr) +
len);
1711 g_free (udpsumdata);
1720 "set_udp_elements: Invalid value for the argument 'udp'.");
1738 struct udphdr *udp = (
struct udphdr *) (pkt +
sizeof (
struct ip));
1742 printf (
"------\n");
1743 printf (
"\tuh_sport : %d\n", ntohs (udp->uh_sport));
1744 printf (
"\tuh_dport : %d\n", ntohs (udp->uh_dport));
1745 printf (
"\tuh_sum : 0x%x\n", udp->uh_sum);
1746 printf (
"\tuh_ulen : %d\n", ntohs (udp->uh_ulen));
1747 printf (
"\tdata : ");
1749 if (udp->uh_ulen > sizeof (
struct udphdr))
1750 for (j =
sizeof (
struct udphdr);
1751 j < (ntohs (udp->uh_ulen)) && j < limit; j++)
1752 printf (
"%c", isprint (c[j]) ? c[j] :
'.');
1798 if (t == 13 || t == 14)
1799 len += 3 *
sizeof (time_t);
1801 if (ip->ip_hl * 4 > ip_sz)
1804 pkt = g_malloc0 (
sizeof (
struct icmp) + ip_sz +
len);
1805 ip_icmp = (
struct ip *) pkt;
1807 bcopy (ip, ip_icmp, ip_sz);
1808 if (
UNFIX (ip_icmp->ip_len) <= (ip_icmp->ip_hl * 4))
1812 ip_icmp->ip_len =
FIX (ip->ip_hl * 4 + 8 +
len);
1813 ip_icmp->ip_sum = 0;
1818 p = (
char *) (pkt + (ip->ip_hl * 4));
1819 icmp = (
struct icmp *) p;
1822 icmp->icmp_type = t;
1827 bcopy (data, &(p[8]),
len);
1839 nasl_perror (lexic,
"forge_icmp_packet: missing 'ip' parameter\n");
1863 struct ip *ip = (
struct ip *) p;
1866 icmp = (
struct icmp *) (p + ip->ip_hl * 4);
1871 "get_icmp_element: missing 'element' parameter\n");
1875 if (!strcmp (elem,
"icmp_id"))
1876 value = ntohs (icmp->icmp_id);
1877 else if (!strcmp (elem,
"icmp_code"))
1878 value = icmp->icmp_code;
1879 else if (!strcmp (elem,
"icmp_type"))
1880 value = icmp->icmp_type;
1881 else if (!strcmp (elem,
"icmp_seq"))
1882 value = ntohs (icmp->icmp_seq);
1883 else if (!strcmp (elem,
"icmp_cksum"))
1884 value = ntohs (icmp->icmp_cksum);
1885 else if (!strcmp (elem,
"data"))
1893 memcpy (retc->
x.
str_val, &(p[ip->ip_hl * 4 + 8]), retc->
size + 1);
1906 "get_icmp_element: Element '%s' is not a valid element to get.\n",
1916 nasl_perror (lexic,
"get_icmp_element: missing 'icmp' parameter\n");
1934 struct ip *ip = (
struct ip *) pkt;
1936 icmp = (
struct icmp *) (pkt + ip->ip_hl * 4);
1937 printf (
"------\n");
1938 printf (
"\ticmp_id : %d\n", ntohs (icmp->icmp_id));
1939 printf (
"\ticmp_code : %d\n", icmp->icmp_code);
1940 printf (
"\ticmp_type : %u\n", icmp->icmp_type);
1941 printf (
"\ticmp_seq : %u\n", ntohs (icmp->icmp_seq));
1942 printf (
"\ticmp_cksum : %d\n", ntohs (icmp->icmp_cksum));
1943 printf (
"\tData : %s\n", icmp->icmp_data);
1982 u_char *pkt = g_malloc0 (
sizeof (
struct igmp) + ip->ip_hl * 4 +
len);
1983 struct ip *ip_igmp = (
struct ip *) pkt;
1990 bcopy (ip, ip_igmp, ipsz);
1992 if (
UNFIX (ip_igmp->ip_len) <= ip_igmp->ip_hl * 4)
1998 FIX (ip->ip_hl * 4 + sizeof (
struct igmp) +
len);
1999 ip_igmp->ip_sum = 0;
2004 p = (
char *) (pkt + ip_igmp->ip_hl * 4);
2019 char *ptmp = (
char *) (pkt + ip->ip_hl * 4 + sizeof (
struct igmp));
2020 bcopy (ptmp, data,
len);
2024 retc->
size = ip->ip_hl * 4 +
sizeof (
struct igmp) +
len;
2028 nasl_perror (lexic,
"forge_igmp_packet: missing 'ip' parameter\n");
2052 if (IN6_IS_ADDR_V4MAPPED (dst) != 1)
2058 u_char packet[
sizeof (
struct ip) + sizeof (struct tcphdr)];
2060 struct ip *ip = (
struct ip *) packet;
2061 struct tcphdr *tcp = (
struct tcphdr *) (packet +
sizeof (
struct ip));
2063 struct sockaddr_in soca;
2072#define rnd_tcp_port() (rand () % 65535 + 1024)
2073 int sports[] = {0, 0, 0, 0, 0, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2074 0, 0, 0, 0, 0, 53, 0, 0, 20, 0, 25, 0, 0, 0};
2075 int ports[] = {139, 135, 445, 80, 22, 515, 23, 21, 6000, 1025,
2076 25, 111, 1028, 9100, 1029, 79, 497, 548, 5000, 1917,
2077 53, 161, 9001, 65535, 443, 113, 993, 8080};
2078 struct in_addr inaddr;
2080 if (dst == NULL || (IN6_IS_ADDR_V4MAPPED (dst) != 1))
2082 inaddr.s_addr = dst->s6_addr32[3];
2083 for (i = 0; i <
sizeof (sports) /
sizeof (int); i++)
2089 soc = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
2092 if (setsockopt (soc, IPPROTO_IP, IP_HDRINCL, (
char *) &opt,
sizeof (opt)) < 0)
2093 perror (
"setsockopt ");
2100 src.s_addr = dst->s6_addr32[3];
2103 bzero (&src,
sizeof (src));
2107 snprintf (filter,
sizeof (filter),
"ip and src host %s", inet_ntoa (inaddr));
2114 for (i = 0; i <
sizeof (sports) /
sizeof (int) && !flag; i++)
2116 bzero (packet,
sizeof (packet));
2119 ip->ip_off =
FIX (0);
2121 ip->ip_len =
FIX (40);
2123 ip->ip_p = IPPROTO_TCP;
2124 ip->ip_id = rand ();
2127 ip->ip_dst = inaddr;
2132 tcp->th_sport = port ? htons (
rnd_tcp_port ()) : htons (sports[i]);
2133 tcp->th_flags = TH_SYN;
2134 tcp->th_dport = port ? htons (port) : htons (ports[i]);
2135 tcp->th_seq = rand ();
2145 struct in_addr source, dest;
2147 source.s_addr = ip->ip_src.s_addr;
2148 dest.s_addr = ip->ip_dst.s_addr;
2150 bzero (&pseudoheader, 12 +
sizeof (
struct tcphdr));
2151 pseudoheader.
saddr.s_addr = source.s_addr;
2152 pseudoheader.
daddr.s_addr = dest.s_addr;
2155 pseudoheader.
length = htons (
sizeof (
struct tcphdr));
2156 bcopy ((
char *) tcp, (
char *) &pseudoheader.
tcpheader,
2157 sizeof (
struct tcphdr));
2158 tcp->th_sum =
np_in_cksum ((
unsigned short *) &pseudoheader,
2159 12 +
sizeof (
struct tcphdr));
2162 bzero (&soca,
sizeof (soca));
2163 soca.sin_family = AF_INET;
2164 soca.sin_addr = ip->ip_dst;
2165 if (sendto (soc, (
const void *) ip, 40, 0, (
struct sockaddr *) &soca,
2168 g_warning (
"sendto: %s", strerror (errno));
2170 tv.tv_usec = 100000;
2208 struct sockaddr_in sockaddr;
2210 struct ip *sip = NULL;
2211 int vi = 0, b,
len = 0;
2220 struct in_addr inaddr;
2221 int allow_broadcast = 0;
2223 if (dstip == NULL || (IN6_IS_ADDR_V4MAPPED (dstip) != 1))
2225 inaddr.s_addr = dstip->s6_addr32[3];
2226 soc = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
2229 if (setsockopt (soc, IPPROTO_IP, IP_HDRINCL, (
char *) &opt_on,
2232 perror (
"setsockopt ");
2240 if ((
unsigned int) sz <
sizeof (
struct ip))
2242 nasl_perror (lexic,
"send_packet: packet is too short\n");
2246 sip = (
struct ip *) ip;
2247 if (use_pcap != 0 && bpf < 0)
2250 bzero (&sockaddr,
sizeof (
struct sockaddr_in));
2251 sockaddr.sin_family = AF_INET;
2252 sockaddr.sin_addr = sip->ip_dst;
2254 if (allow_broadcast)
2256 if (setsockopt (soc, SOL_SOCKET, SO_BROADCAST, &opt_on,
2259 perror (
"setsockopt ");
2260 if (sockaddr.sin_addr.s_addr != INADDR_BROADCAST)
2261 allow_broadcast = 0;
2264 if (sockaddr.sin_addr.s_addr != inaddr.s_addr && !allow_broadcast)
2266 char txt1[64], txt2[64];
2267 strncpy (txt1, inet_ntoa (sockaddr.sin_addr), sizeof (txt1));
2268 txt1[
sizeof (txt1) - 1] =
'\0';
2269 strncpy (txt2, inet_ntoa (inaddr),
sizeof (txt2));
2270 txt2[
sizeof (txt2) - 1] =
'\0';
2272 "send_packet: malicious or buggy script is trying to "
2273 "send packet to %s instead of designated target %s\n",
2281 sip->ip_dst = inaddr;
2282 sip->ip_sum =
np_in_cksum ((u_short *) sip,
sizeof (
struct ip));
2286 if (dfl_len > 0 && dfl_len < sz)
2291 b = sendto (soc, (u_char *) ip,
len, 0, (
struct sockaddr *) &sockaddr,
2294 if (b >= 0 && use_pcap != 0 && bpf >= 0)
2299 while (answer != NULL
2300 && (!memcmp (answer, (
char *) ip,
sizeof (
struct ip))))
2313 retc->
size = answer_sz;
2342 static char errbuf[PCAP_ERRBUF_SIZE];
2344 struct ip *ret = NULL;
2345 struct ip6_hdr *ret6 = NULL;
2347 pcap_if_t *alldevsp = NULL;
2352 struct in_addr inaddr;
2358 int v4_addr = IN6_IS_ADDR_V4MAPPED (dst);
2359 if (interface == NULL)
2364 bzero (&src,
sizeof (src));
2365 inaddr.s_addr = dst->s6_addr32[3];
2370 struct in6_addr src;
2371 bzero (&src,
sizeof (src));
2374 if (interface == NULL)
2376 if (pcap_findalldevs (&alldevsp, errbuf) < 0)
2377 g_message (
"Error for pcap_findalldevs(): %s", errbuf);
2378 if (alldevsp != NULL)
2379 interface = alldevsp->
name;
2383 if (interface != NULL)
2390 nasl_perror (lexic,
"pcap_next: Could not get a bpf\n");
2400 gettimeofday (&then, NULL);
2410 gettimeofday (&now, NULL);
2411 if (now.tv_sec - then.tv_sec >= timeout)
2423 ip = (
struct ip *) (packet + dl_len);
2424 sz =
UNFIX (ip->ip_len);
2425 ret = g_malloc0 (sz);
2427 is_ip = (ip->ip_v == 4);
2431 bcopy (ip, ret, sz);
2436 bcopy (ip, ret, sz);
2442 ip = (
struct ip6_hdr *) (packet + dl_len);
2443 sz =
UNFIX (ip->ip6_plen);
2444 ret6 = g_malloc0 (sz);
2446 is_ip = ((ip->ip6_flow & 0x3ffff) == 96);
2449 bcopy (ip, ret6, sz);
2454 bcopy (ip, ret6, sz);
2472 if (alldevsp != NULL)
2473 pcap_freealldevs (alldevsp);
2492 static char errbuf[PCAP_ERRBUF_SIZE];
2494 struct ip *ret = NULL;
2495 struct ip6_hdr *ret6 = NULL;
2497 pcap_if_t *alldevsp = NULL;
2502 struct in_addr inaddr;
2507 int v4_addr = IN6_IS_ADDR_V4MAPPED (dst);
2508 if (interface == NULL)
2513 bzero (&src,
sizeof (src));
2514 inaddr.s_addr = dst->s6_addr32[3];
2519 struct in6_addr src;
2520 bzero (&src,
sizeof (src));
2523 if (interface == NULL)
2525 if (pcap_findalldevs (&alldevsp, errbuf) < 0)
2526 g_message (
"Error for pcap_findalldevs(): %s", errbuf);
2527 if (alldevsp != NULL)
2528 interface = alldevsp->
name;
2532 if (interface != NULL)
2537 nasl_perror (lexic,
"pcap_next: Could not get a bpf\n");
2538 if (alldevsp != NULL)
2539 pcap_freealldevs (alldevsp);
2552 gettimeofday (&then, NULL);
2562 gettimeofday (&now, NULL);
2563 if (now.tv_sec - then.tv_sec >= timeout)
2573 ip = (
struct ip *) (packet + dl_len);
2574 sz =
UNFIX (ip->ip_len);
2575 ret = g_malloc0 (sz);
2577 is_ip = (ip->ip_v == 4);
2580 bcopy (ip, ret, sz);
2585 bcopy (ip, ret, sz);
2591 ip = (
struct ip6_hdr *) (packet + dl_len);
2592 sz =
UNFIX (ip->ip6_plen);
2593 ret6 = g_malloc0 (sz);
2594 is_ip = ((ip->ip6_flow & 0x3ffff) == 96);
2597 bcopy (ip, ret6, sz);
2602 bcopy (ip, ret6, sz);
2608 if (alldevsp != NULL)
2609 pcap_freealldevs (alldevsp);
2622 if (alldevsp != NULL)
2623 pcap_freealldevs (alldevsp);
int bpf_open_live(char *iface, char *filter)
int bpf_datalink(int bpf)
u_char * bpf_next_tv(int bpf, int *caplen, struct timeval *tv)
u_char * bpf_next(int bpf, int *caplen)
Header file for module bpf_share.
int init_capture_device(struct in_addr src, struct in_addr dest, char *filter)
Set up the pcap filter, and select the correct interface.
struct ip * capture_next_packet(int bpf, int timeout, int *sz)
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 * insert_ip_options(lex_ctxt *lexic)
Add option datagram.
tree_cell * nasl_tcp_ping(lex_ctxt *lexic)
Launches a âTCP pingâ against the target host.
tree_cell * set_udp_elements(lex_ctxt *lexic)
Modify UDP fields of an IP datagram.
tree_cell * get_tcp_element(lex_ctxt *lexic)
Extracts TCP field from an IP datagram.
static int np_in_cksum(u_short *p, int n)
tree_cell * get_tcp_option(lex_ctxt *lexic)
Get a TCP option from an IP datagram if present. Possible options are: TCPOPT_MAXSEG (2),...
tree_cell * forge_ip_packet(lex_ctxt *lexic)
Forge an IP datagram.
tree_cell * dump_icmp_packet(lex_ctxt *lexic)
Dump the ICMP part of a IP Datagram.
tree_cell * set_ip_elements(lex_ctxt *lexic)
Modify the fields of a datagram.
tree_cell * dump_ip_packet(lex_ctxt *lexic)
Dump IP datagrams.
static void get_tcp_options(char *options, struct tcp_options *tcp_all_options)
Extract all TCP option from an IP datagram.
tree_cell * insert_tcp_options(lex_ctxt *lexic)
Add options to a TCP segment header. Possible options are: TCPOPT_MAXSEG (2), values between 536 and ...
tree_cell * nasl_pcap_next(lex_ctxt *lexic)
Listen to one packet and return it.
tree_cell * set_tcp_elements(lex_ctxt *lexic)
Modify the TCP fields of a datagram.
tree_cell * dump_tcp_packet(lex_ctxt *lexic)
Dump the TCP part of a IP Datagram.
tree_cell * forge_tcp_packet(lex_ctxt *lexic)
Fills an IP datagram with TCP data. Note that the ip_p field is not updated. It returns the modified ...
tree_cell * dump_udp_packet(lex_ctxt *lexic)
Dump the UDP part of a IP Datagram.
tree_cell * get_icmp_element(lex_ctxt *lexic)
Get an ICMP element from a IP datagram.
tree_cell * nasl_send_packet(lex_ctxt *lexic)
Send a list of packets (passed as unnamed arguments) and listens to the answers. It returns a block m...
tree_cell * nasl_send_capture(lex_ctxt *lexic)
Send a capture.
tree_cell * forge_icmp_packet(lex_ctxt *lexic)
Fill an IP datagram with ICMP data.
tree_cell * get_udp_element(lex_ctxt *lexic)
Get an UDP element from a IP datagram.
tree_cell * forge_udp_packet(lex_ctxt *lexic)
Fills an IP datagram with UDP data. Note that the ip_p field is not updated. It returns the modified ...
tree_cell * get_ip_element(lex_ctxt *lexic)
Extracts a field from an IP datagram.
struct pseudo_udp_hdr __attribute__
tree_cell * forge_igmp_packet(lex_ctxt *lexic)
Fills an IP datagram with IGMP data.
tree_cell * nasl_tcp_v6_ping(lex_ctxt *lexic)
Performs TCP Connect to test if host is alive.
tree_cell * nasl_send(lex_ctxt *lexic)
tree_cell * alloc_typed_cell(int typ)
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 islocalhost(struct in_addr *addr)
Tests whether a packet sent to IP is LIKELY to route through the kernel localhost interface.
char * routethrough(struct in_addr *dest, struct in_addr *source)
An awesome function to determine what interface a packet to a given destination should be routed thro...
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...
int get_datalink_size(int datalink)
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