(self)
Receive ARP packets on a raw socket
Receive ARP packets on a raw socket
Receive ARP packets on a raw socket
def receive(self):
        """Receive ARP packets on a raw socket"""
        try:
            sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
                                    socket.ntohs(0x0806))
            while True:
                data = sock.recv(1024)
                if self.sender_ip(data) == self.remote_host and data[42] != '\x00':
                    if self.encrypt:
                        data = self.rc4.decrypt(data[42:].replace('\x00', ''))
                    else:
                        data = data[42:].replace('\x00', '')
                    print data
                    return
        except Exception, e:
            util.Error(e)
def receive ( self ) : try : sock = socket . socket ( socket . AF_PACKET , socket . SOCK_RAW , socket . ntohs ( 0x0806 ) ) while True : data = sock . recv ( 1024 ) if self . sender_ip ( data ) == self . remote_host and data [ 42 ] != '\x00' : if self . encrypt : data = self . rc4 . decrypt ( data [ 42 : ] . replace ( '\x00' , '' ) ) else : data = data [ 42 : ] . replace ( '\x00' , '' ) print data return except Exception , e : util . Error ( e )