ã©ãã®äœæãNetfilterã¢ãŒããã¯ãã£ãcharããã€ã¹ãsysfs
1.1-ä»®æ³å®éšå®€ã®äœæïŒäœæ¥å Žæã確ä¿ãããããã³ã³ãã¥ãŒã¿ãŒã§ä»®æ³ãããã¯ãŒã¯ãäœæããæ¹æ³ã瀺ããŸãããããã¯ãŒã¯ã¯3å°ã®Linux ubuntuãã·ã³ã§æ§æãããŸãïŒã
1.2 -Linuxã§ã®ç°¡åãªã¢ãžã¥ãŒã«ã®äœæã Netfilterã®æŠèŠãšããã䜿çšãããã©ãã£ãã¯ã®ååã ãã¹ãŠããŸãšããŠãã¹ãããŸãã
1.3-åçŽãªcharããã€ã¹ã®äœæã ä»®æ³ãã¡ã€ã«ã·ã¹ãã ã®è¿œå -sysfsã ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãèšè¿°ããŸãã ãã¹ãŠããŸãšããŠãã¹ãããŸãã
1.2 -Linuxã§ã®ç°¡åãªã¢ãžã¥ãŒã«ã®äœæã Netfilterã®æŠèŠãšããã䜿çšãããã©ãã£ãã¯ã®ååã ãã¹ãŠããŸãšããŠãã¹ãããŸãã
1.3-åçŽãªcharããã€ã¹ã®äœæã ä»®æ³ãã¡ã€ã«ã·ã¹ãã ã®è¿œå -sysfsã ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãèšè¿°ããŸãã ãã¹ãŠããŸãšããŠãã¹ãããŸãã
2çªç®ã®éšåã®å 容ïŒ
2.1-2çªç®ã®ããŒãã®çŽ¹ä»ã ãããã¯ãŒã¯ãšãããã³ã«ã調ã¹ãŸãã Wireshark
2.2-ãã¡ã€ã¢ãŠã©ãŒã«ããŒãã«ã ãã©ã³ã¹ããŒãå±€ æ§é TCPãUDPã ãã¡ã€ã¢ãŠã©ãŒã«ãæ¡åŒµããŸãã
2.3-æ©èœãæ¡åŒµããŸãã ãŠãŒã¶ãŒç©ºéã§ããŒã¿ãåŠçããŸãã libnetfilter_queueã
2.4-ããŒãã¹ã å®éã®ãããã¡ãªãŒããŒãããŒæ»æã調æ»ãããã¡ã€ã¢ãŠã©ãŒã«ã§é²æ¢ããŸãã
ãã¡ã€ã¢ãŠã©ãŒã«ã«ãŒã«ã çè«
ãã®ããŒãã§ã¯ãåçŽãªãã¡ã€ã¢ãŠã©ãŒã«ãå®è£ ããã®ã«ååãªåºç€ã®ç 究ãã»ãŒçµäºããŸããããããè¡ãåã«ïŒèªè ããããã¯ãŒã¯ã®ç¥èãããããããŒã2.1ãèªãã§ãããšä»®å®ããŸãïŒããã¡ã€ã¢ãŠã©ãŒã«ãã©ã®ããã«æ±ºå®ãäžãããèæ ®ããå¿ èŠããããŸãã
ãã®ãããªã«ãŒã«ããŒãã«ã¯ããŠãŒã¶ãŒïŒç®¡çè ïŒã«ãã£ãŠãã¡ã€ã¢ãŠã©ãŒã«ã¡ã¢ãªã«èªã¿èŸŒãŸããŸãã ãã±ãããåä¿¡ãããšãããã±ãããã©ãåŠçãããã決å®ããã®ã¯ãåãå ¥ãè ãŸãã¯æåŠè ã§ãã
éèŠïŒ ãã¡ã€ã¢ãŠã©ãŒã«ã¯ãã±ãããåä¿¡ãããšãå¿ ããã®ãã£ãŒã«ãïŒã¬ãã¹ã³2.1ã§è¡ã£ãããšïŒãèŠãŠãããããé çªã«ããŒãã«ã®ã«ãŒã«ãšæ¯èŒããŸãïŒïŒïŒãããã®ã«ãŒã«ãæžã蟌ãŸããŠããããã«ïŒäžããäžã«ïŒïŒ èšãæãããšãäžã®è¡šã«ããã«ãŒã«ãšããããäœãã«ãŒã«ã®æ ¹æ¬çãªéãããããŸãã
éèŠïŒ å¥åŠãªããã±ãŒãžã¯ãç§ãã¡ã«ãã£ãŠä¿è·ãããŠãããããã¯ãŒã¯ãããã€ã¹ã«äŸµå ¥ããŠã¯ãããŸããã ããã«ãã¹ãããã§ãããã©ããããããªãå Žåãçãã¯NOã§ãã ãã¡ã€ã¢ãŠã©ãŒã«ã«ãŒã«ã§èš±å¯ãããŠãããã±ããã®ã¿ãèš±å¯ããŸãã
ãããã£ãŠããã¡ã€ã¢ãŠã©ãŒã«ã®æ§ç¯ãšéçšã®ååïŒèš±å¯ããããã±ããã®ã¿ãå éšãããã¯ãŒã¯ã«å°éã§ããŸãïŒãŸããããããå¿ èŠããããŸãïŒïŒhost1ããããŸãïŒã
ä»ãäŸãã°ã äžèšã®è¡šã¯ã5ã€ã®ã«ãŒã«ãå®çŸ©ããŠããŸãã åããã±ãŒãžãåãåã£ãããé©åãªã«ãŒã«ãèŠã€ããã Actionãèšè¿°ãããŠããå Žåã«ã®ã¿-acceptã確èªããŠãããã¹ãããããŸãã ããããããã§ãã¯ããåŸã«é©åãªã«ãŒã«ãèŠã€ãããªãã£ãå Žåããã®ã³ã³ãã³ãã«é¢ä¿ãªãããã±ãŒãžãç Žæ£ããŸãã ãããè¡ãã«ã¯ãå®çŸ©ããæåŸã®ããã©ã«ãã«ãŒã«ããããŸã-ã«ãŒã«ã®ãããã«ã該åœããªãããã±ãŒãžã¯ãã¹ãŠæšãŠãŸãã æåŸã«ãªããã°ãªããŸããïŒå®éãç»é²ãããŠããªããŠãããã¹ãŠã®ãã¡ã€ã¢ãŠã©ãŒã«ãèªåçã«è¿œå ããŸãïŒã
次ã«ã æ¹åãšackãã£ãŒã«ãã«ã€ããŠè©³ãã説æããŸãã
æ¹å -ãã±ããããããã¯ãŒã¯ã«å ¥ããåºããã決å®ããŸãã ããšãã°ãé»åã¡ãŒã«ã«ããæ å ±æŒãããé¿ããããã«ããã¹ãŠã®smtpïŒã¡ãŒã«ïŒãããã³ã«ãã±ããããããã¯ããããšãã§ããŸãã ãŸãã¯ãã®é-telnetãããã³ã«ã䜿çšããŠçä¿¡ãã±ãããçŠæ¢ãããããã¯ãŒã¯ãžã®æ¥ç¶ãçŠæ¢ããŸãã å®éã®éšåã§ã¯ããã®å Žåãã³ãŒãå ã®ãã±ããã®æ¹åã決å®ããæ¹æ³ãæ€èšããŸãã
æåã®2ã€ã®ã«ãŒã«ã¯spoofãšåŒã°ããããããªæ»æã®è©Šã¿ã«å¯ŸããŠããããªä¿è·ãæäŸããŸãã ãããã£ãŠã spoof1ã¯ãããŒãçªå·ããããã³ã«ãªã©ã®ãããã¯ãŒã¯ã®ã¢ãã¬ã¹ïŒ10.0.1.1 = host1ïŒãæã€ãã¹ãŠã®çä¿¡ãã±ããïŒ direction = in ïŒããæå³ããŸãã -æšãŠãŠãã ãããã ãã®ã«ãŒã«ã®ããžãã¯ã¯ããã±ããããã¡ã€ã¢ãŠã©ãŒã«äžã®ãããã¯ãŒã¯ã«å°éã§ããªãããšã§ããããããã¯ãŒã¯ããéä¿¡ãããããšã瀺ããŸãïŒ src ip = 10.0.1.1 ïŒã èšãæããã°ãããã¯èª°ãããããåœé ãããŠãŒã¶ãŒïŒãã®å Žåã¯host1ïŒã®1人ãšããŠèªåèªèº«ãåœè£ ããããšããŠããããšãæå³ããŸãããã®ãããªããã±ãŒãžãã¹ãããããããªãã®ã§ãã
察称ã«ãŒã«ãšspoof2-å ã å éšã¢ãã¬ã¹ãšã¯ç°ãªãIPïŒã€ãŸã10.0.1.1ã§ã¯ãªã ïŒã§ãããšèšãããŠããå Žåãå éšãããã¯ãŒã¯ãããã±ããããªãªãŒã¹ããããªãã ã»ãšãã©ã®å Žåããããäœããã®ãŠã€ã«ã¹ã§ãã
ACKã¯ãTCPãããã³ã«ã®äœ¿çšæã«æ¥ç¶ã確ç«ãããã®ãä¿¡é Œæ§ããããã«ç¶æããããã«äœ¿çšããããã©ã°ïŒ1ãããïŒã§ãã åTCPæ¥ç¶ã¯ããªãã«ãã³ãã·ã§ã€ã¯ã§å§ãŸããŸãïŒ3ãŠã§ã€ãã³ãã·ã§ã€ã¯ããã·ã¢èªã®èšäºã¯ãããŸããããè±èªã®ã¢ãã¡ãŒã·ã§ã³ã¯ããã«ãããŸãïŒ https : //en.wikipedia.org/wiki/Handshaking#TCP_three-way_handshake
TCPã»ãã·ã§ã³ãéããã³ã«ãæåã®ãã±ããACK = 0ã§ã®ã¿ãäœæãããã»ãã·ã§ã³ACK> 0ïŒ https://ru.wikipedia.org/wiki/TCP ïŒã®ä»ã®ãã¹ãŠã®ãã±ããã§ã®ã¿ç解ããããšãéèŠã§ãã
ãã®ãããæ¢åã®æ¥ç¶ãéãããšããè©Šã¿ãšåºå¥ã§ããŸãã ACK = 0ã®å Žåãããã¯TCPæ¥ç¶ïŒããªãã«ãã³ãã·ã§ã€ã¯ã®æåã®ãã±ããïŒãäœæããããšããè©Šã¿ã§ãããACK = 1ã®å Žåãæ¥ç¶ã¯ä»¥åã«äœæãããŠããå¿ èŠããããŸãïŒããã§ãªãå Žåããã®ãããªãã±ããããããã¯ãŒã¯ã«å°éããªãããã«ããã®ã¯è«ççã§ãïŒã
次ã«ã http_in ã http_outã«ãŒã«ãèŠãŠãã ããïŒ
http_inã¯æ¬¡ãæå³ããŸãïŒãã±ãããçä¿¡ããå ŽåïŒ æ¹å = in ïŒãä»»æã®IPããïŒ Src IP = any ããã®æ®µéã§ãäžèšã®ã¹ããŒãã£ã³ã°ã«ãŒã«ã¯ããããå éšãããã¯ãŒã¯ã®IPã§ã¯ãªãããšãä¿èšŒããããšã«æ³šæããŠãã ããïŒ Dest IP == host1 == 10.0.1.1 ïŒãTCPçµç±ã§ããŒã80ïŒã€ãŸãã誰ããç¥ã£ãŠããhttpãµãŒããŒïŒã«ä»»æã®ããŒãããéä¿¡ïŒ> 1023ã¯ãæ¥ç¶ã®äœææã«ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ããåä¿¡ããäºçŽãããŠããªãããŒãã瀺ããŸãïŒå°æ¥ãããŒã2.1ïŒã§èª¬æãããŠããããã«ããã®ç¹å®ã®ååç©ãèå¥ããããã«äœ¿çšãããŸããAck= Anyã å€éšããã³ã³ãã¥ãŒã¿ãŒã«æ¥ç¶ãéãããã«èŠæ±ããããšã«ããŸãïŒæåã®ãã±ããack = 0ã次ã®ack> 0ïŒã ãããŠããã®ãããªãã±ãããåãå ¥ããŠãããã«ãããã¯ãŒã¯ã«æž¡ããŸãïŒ action = accept ïŒã
http_outã¯å¯Ÿç§°çã§ãããã ããack = 0ãack> 0ã®ã¿ã®ãã±ãããèŠéãããšã¯ãããŸãããã€ãŸããã³ã³ãã¥ãŒã¿ãŒããã€ã³ã¿ãŒããããžã®httpæ¥ç¶ãäœæããããšã¯ã§ããŸããããæ¢ã«äœæãããhttpæ¥ç¶ã«ã¯å¿çã§ããŸãã
ã€ãŸããhttpã«ãŒã«ã¯ãå€éšããhttpãä»ãããããã¯ãŒã¯ãžã®ã¢ã¯ã»ã¹ãèš±å¯ããŸããããããã¯ãŒã¯ã®ãŠãŒã¶ãŒãhttpã䜿çšããããšïŒã€ãŸããã€ã³ã¿ãŒããããµã€ããžã®ã¢ã¯ã»ã¹ïŒãçŠæ¢ããŸãã
ãã¡ã€ã¢ãŠã©ãŒã«ã«ãŒã«ã ç·Žç¿ã
ã¢ãžã¥ãŒã«ã«æ»ããšãã€ã³ã¿ãŒã»ããé¢æ°ã¯æ¬¡ã®ããã«ãªããŸãã
unsigned int hook_func_forward(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *));
ãªãã·ã§ã³ãèŠãŠã¿ãŸãããïŒ
hooknum-ååã®æ°ããã§ã«æž¡ããŸãã
const struct net_device * inãout-ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹æ§é ãžã®ãã€ã³ã¿ãŒ
struct sk_buff * skb-ç§ãã¡ã«ãšã£ãŠæãèå³æ·±ãã®ã¯ãå¿ èŠãªããŒã¿ãå«ããã€ã³ã¿ãŒã§ã
SKB-ãœã±ãããããã¡ ãããã¯Linuxãããã¯ãŒã¯ã®åºæ¬æ§é ã§ãã ããã«ã¯å€ãã®ãã£ãŒã«ãããããèšäºãæžãããã®å¥ã®äž»é¡ã«ãªããŸãã ãã£ãšæ·±ãããã人ã®ããã«ããã€ãã®è¯ããªã³ã¯ãèŠã€ããŸããã
http://vger.kernel.org/~davem/skb.html
https://people.cs.clemson.edu/~westall/853/notes/skbuff.pdf
èå³ãããã®ã¯ïŒ
union { struct tcphdr *th; struct udphdr *uh; struct icmphdr *icmph; struct igmphdr *igmph; struct iphdr *ipiph; struct ipv6hdr *ipv6h; unsigned char *raw; } h; // Transport header union { struct iphdr *iph; struct ipv6hdr *ipv6h; struct arphdr *arph; unsigned char *raw; } nh; // Network header
次ã®ããã«
struct iphdr *ip_header = (struct iphdr *)skb_network_header(skb);
IPããããŒãžã®ãã€ã³ã¿ãŒãååŸããŸãïŒããŒã2.1ã§ã¯ããã®ã¬ãã«ã§ã®äž»ãªæ å ±ã¯IPãœãŒã¹ ã IPå®å ã§ãããšè¿°ã¹ãŸããïŒã
inclue / linux / skbuff.hããã®Skb_network_headerå®çŸ©
http://lxr.free-electrons.com/source/include/linux/skbuff.h?v=3.0#L1282
ã€ãŸããé¢æ°ãskbuffæ§é äœã® ãæ£ãããå Žæããç®çã®ãã€ã³ã¿ãŒãè¿ãããšãããããŸãã
IPããããŒã«ã¢ã¯ã»ã¹ã§ããããã«ãªã£ãã®ã§ãIPã¢ãã¬ã¹ãååŸã§ããŸãã
unsigned int src_ip = (unsigned int)ip_header->saddr; unsigned int dest_ip = (unsigned int)ip_header->daddr;
ãŸãããããã³ã«çªå·ïŒ
ip_header->ãããã³ã«
ãã©ã³ã¹ããŒãå±€ãžã®ã¢ã¯ã»ã¹ïŒTCP / UDP ..ïŒ
struct udphdr *udp_header = (struct udphdr *)(skb_transport_header(skb)+20); struct tcphdr *tcp_header = (struct tcphdr *)(skb_transport_header(skb)+20);
TCPïŒããã³åæ§ã«UDPïŒããŒãçªå·ã®å ŽåïŒ
unsigned int src_port = (unsigned int)ntohs(tcp_header->source); unsigned int dest_port = (unsigned int)ntohs(tcp_header->dest);
以äžã«ãå®å šãªæ©èœã³ãŒãã瀺ããŸãã èå³æ·±ãç¹ã¯ã ntohsé¢æ°ã䜿çšããããšã§ãã ntohsã¯ããããïŒæ°å€ãè¡šãïŒã®é åºãå€æŽããé¢æ°ã§ãã 䜿çšãããã¡ã¢ãªå ã®æ°å€ã®è¡šçŸã«ã¯ã ãªãã«ãšã³ãã£ã¢ã³ãšããã°ãšã³ãã£ã¢ã³ã® 2çš®é¡ããããŸãã ãããã¯ãŒã¯ã¯ããã°ãšã³ãã£ã¢ã³ã·ã¹ãã ã䜿çšããŠæ°å€ãè¡šããIntel ãªãã«ãšã³ãã£ã¢ã³ã¢ãŒããã¯ãã£ïŒãã€ãé ïŒ
ãããã£ãŠãæ£ããæ°å€ãååŸããã«ã¯ããããã®å€æé¢æ°ã䜿çšããå¿ èŠããããŸãã
以äžã¯æ©èœå šäœã®ããã¹ãã§ãããã±ãããåä¿¡ãããšããã¡ã€ã¢ãŠã©ãŒã«ã«ãŒã«ã«åŸã£ãŠæ±ºå®ãäžãããã«å¿ èŠãªãã¹ãŠã®ããŒã¿ãå°å·ããŸãã
unsigned int hook_func_forward(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { struct iphdr *ip_header = (struct iphdr *)skb_network_header(skb); struct udphdr *udp_header = NULL; struct tcphdr *tcp_header = NULL; unsigned int src_ip = (unsigned int)ip_header->saddr; unsigned int dest_ip = (unsigned int)ip_header->daddr; unsigned int src_port = 0; unsigned int dest_port = 0; char src_ip_str[16], dest_ip_str[16]; if(ip_header->protocol == PROT_UDP) { udp_header = (struct udphdr *)(skb_transport_header(skb)+20); src_port = (unsigned int)ntohs(udp_header->source); dest_port = (unsigned int)ntohs(udp_header->dest); } else if(ip_header->protocol == PROT_TCP) { tcp_header = (struct tcphdr *)(skb_transport_header(skb)+20); src_port = (unsigned int)ntohs(tcp_header->source); dest_port = (unsigned int)ntohs(tcp_header->dest); // XMAS packet // FIN, URG, PSH set // if(ip_header->protocol == PROT_TCP){ // printk("TCP ack = %s\n", tcp_header->ack == 1 ? "yes" : "no"); // if (tcp_header->fin > 0 && tcp_header->urg > 0 && tcp_header->psh > 0 ){ // info("XMAS packet detected, drop"); // } } ip_hl_to_str(ntohl(src_ip), src_ip_str); ip_hl_to_str(ntohl(dest_ip), dest_ip_str); printk("---------------------------\n"); printk("in device = [%s], out_device = [%s]\n", in->name, out->name); printk("ip_src = [%s], ip_dest = [%s]\n", src_ip_str, dest_ip_str); printk("src port: [%u], dest port: %u, \n", src_port, dest_port); printk("protocol = %d\n", ip_header->protocol); if(dest_port == HTTP_PORT || src_port == HTTP_PORT){ printk("HTTP packet\n"); } return NF_ACCEPT; }
ã³ã³ãã€ã«äž
ã¢ãžã¥ãŒã«ã®äœæãŸãã¯netfilterã®äœ¿çšã®ã»ãšãã©ïŒãã¹ãŠã§ã¯ãªãã«ããŠãïŒã®äŸã¯ã1ã€ã®ãœãŒã¹ãã¡ã€ã«ãšæ°åè¡ã®ã³ãŒãã«å¶éãããŠããŸãã ãã ãã倧èŠæš¡ãªãããžã§ã¯ãã¯ãåäžã®ãœãŒã¹ãã¡ã€ã«ã«åããããšãã§ããŸããïŒãŸãã誀ã£ãŠïŒã 説æããŠããäŸã¯1ã€ã®ãã¡ã€ã«ã«è©°ã蟌ãããšãã§ããŸããããããmodule_fw.c-charããã€ã¹ãsysfsãã«ãŒãã«ã¢ãžã¥ãŒã«ãããã³hook_functions.cã«é¢ãããã¹ãŠ-ã€ã³ã¿ãŒã»ããæ©èœã«åå²ããããšã«ããŸããã è€æ°ã®ãã¡ã€ã«ã§æ§æãããã«ãŒãã«ã¢ãžã¥ãŒã«ãã³ã³ãã€ã«ããå Žåãç¥ã£ãŠããå¿ èŠãããå°ããªããªãã¯ããããŸãã以äžã«äŸã瀺ããŸãã
ããã§ã¯ãè¡ã«æ³šæãæã䟡å€ããããŸãã
obj-mïŒ= fw.o
ãã®ãããªfw.cãã¡ã€ã«ã¯ãªããããããã¯äœæãããã¢ãžã¥ãŒã«ã®ååã§ãã ãŸããããã¯ãã¢ãžã¥ãŒã«ã«é¢é£ãããã¹ãŠã®ãã¡ã€ã«ã説æãã次ã®è¡ã®ãã¬ãã£ãã¯ã¹ã§ã
fw-objs + =
ãã¡ãããã¢ãžã¥ãŒã«ã®ååãšãœãŒã¹ã³ãŒããäžèŽããŠã¯ãªããªãããšãç¥ã£ãŠããå¿ èŠããããŸãã ãã以å€ã®å Žåããã¹ãŠãåããŸãŸã§ãã
確èªãã
æ€èšŒã®ããã«ã dhcpã€ã³ã¿ãŒãã§ã€ã¹ããã°ããæ§æãïŒããŒã1ãåç §ïŒãhost1ã«apache2ãã€ã³ã¹ããŒã«ããhost2ã®text2ã«lynxãã€ã³ã¹ããŒã«ããŸããïŒãã ããtelnetã¯äžèŠã§ãïŒã æã¡äžã
ãªã³ã¯ã¹10.0.1.1
ãã¡ã€ã¢ãŠã©ãŒã«ãçæãããã®ã確èªããŸãã
ãŸããããã ãã§ãã
ãããã«
ãã®ããŒãã§ã¯ããããã¯ãŒã¯äžã®ãã©ãã£ãã¯ãä¿è·ããã³æž¡ãããã®ããªã·ãŒã決å®ããããã¡ã€ã¢ãŠã©ãŒã«ã®ã«ãŒã«ããŒãã«ãã©ã®ããã«æ©èœãããã調ã¹ãŸããã ãã®åŸãLinuxã§skbufã®åºæ¬çãªãããã¯ãŒã¯æ§é ã®1ã€ãå解ãããã®ãããã§ãããã°ã©ã ãè£å®ããŠãã¢ãžã¥ãŒã«ã®ããŒãã«ãµããŒããè£å®ããããšãã§ããŸããã ããšã¯ãããŒã1ã§è¡ã£ãããã«ãsysfsãä»ããŠãã®ããŒãã«ã®ããŠã³ããŒããèšè¿°ãã if {} else if {} else {} ... hook_func_forwardé¢æ°ã«è¿œå ããŸãã ããã«ã¯æ ¹æ¬çã«æ°ãããã®ã¯ãªãã®ã§ãçããã«ãä»»ãããŸã... klistã§ã®ã¿äœæ¥ãããããããŸããããããã¯å®å šã«ç°ãªããããã¯ã§ãããã€ã³ã¿ãŒãããã§ãååã«åãäžããããŠããŸãã
é¢æ°èªäœã§ãXMASãã±ãããšããŠæå®ãããããŒãã¹ãèŠã€ãããããäœã§ããããªãã€ã³ã¿ãŒãããäžã§èªãããã次ã®ããŒãã§ã¯2ã€ãéå§ããŸãïŒããããã§ããïŒïŒ-
if(dest_port == HTTP_PORT || src_port == HTTP_PORT){ printk("HTTP packet\n"); }
åç §ïŒ
wikipedia.org/wiki/Handshaking#TCP_three-way_handshake
en.wikipedia.org/wiki/TCP
vger.kernel.org/~davem/skb.html
people.cs.clemson.edu/~westall/853/notes/skbuff.pdf
lxr.free-electrons.com/source/include/linux/skbuff.h?v=3.0#L1282
ãã€ããªãŒããŒ