(self, pkt)
Detect land attack by observing source,
        destination IP & ports.

        Args:
            pkt (scapy_object): Packet to dissect and observe

        Raises:
            None

        Returns:
            None
Detect land attack by observing source,
        destination IP & ports.
Detect land attack by observing source destination IP & ports .
def detect_land_attack(self, pkt):
        """
        Detect land attack by observing source,
        destination IP & ports.

        Args:
            pkt (scapy_object): Packet to dissect and observe

        Raises:
            None

        Returns:
            None
        """
        if (pkt.haslayer(scapy.IP) and
            pkt.haslayer(scapy.TCP)):

            source_ip = pkt[scapy.IP].src
            dest_ip = pkt[scapy.IP].dst

            source_port = pkt[scapy.TCP].sport
            dest_port = pkt[scapy.TCP].dport

            if ((source_ip == dest_ip) and
                (source_port == dest_port)):
                self.logger.log(
                    "Possible land attack detected.",
                    logtype="warning"
                )
def detect_land_attack ( self , pkt ) : if ( pkt . haslayer ( scapy . IP ) and pkt . haslayer ( scapy . TCP ) ) : source_ip = pkt [ scapy . IP ] . src dest_ip = pkt [ scapy . IP ] . dst source_port = pkt [ scapy . TCP ] . sport dest_port = pkt [ scapy . TCP ] . dport if ( ( source_ip == dest_ip ) and ( source_port == dest_port ) ) : self . logger . log ( "Possible land attack detected." , logtype = "warning" )