(self, data)
Send [data] back to the remote host
Send [data] back to the remote host
Send [ data ] back to the remote host
def respond(self, data):
        """Send [data] back to the remote host"""
        try:
            if len(data) > 900:
                data = "Response too long; fragmentation not yet supported."
            if self.encrypt:
                data = self.crypto.rc4.encrypt(data)
            arpf = [self.mac_bytes(self.remote_mac), self.mac_bytes(self.host_mac),
                        pack('!H',0x0806),
                     pack('!HHBB',0x0001,0x0800,0x0006,0x0004),
                     pack('!H',0x0002), self.mac_bytes(self.host_mac),
                     pack('!4B',*[int(x) for x in self.host.split('.')]),
                     self.mac_bytes(self.remote_mac),
                     pack('!4B',*[int(x) for x in self.remote.split('.')]),
                     data
                ]
            sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.SOCK_RAW)
            sock.bind((self.adapter, socket.SOCK_RAW))
            sock.send(''.join(arpf))
            sock.close()
        except Exception, e:
            print e
def respond ( self , data ) : try : if len ( data ) > 900 : data = "Response too long; fragmentation not yet supported." if self . encrypt : data = self . crypto . rc4 . encrypt ( data ) arpf = [ self . mac_bytes ( self . remote_mac ) , self . mac_bytes ( self . host_mac ) , pack ( '!H' , 0x0806 ) , pack ( '!HHBB' , 0x0001 , 0x0800 , 0x0006 , 0x0004 ) , pack ( '!H' , 0x0002 ) , self . mac_bytes ( self . host_mac ) , pack ( '!4B' , * [ int ( x ) for x in self . host . split ( '.' ) ] ) , self . mac_bytes ( self . remote_mac ) , pack ( '!4B' , * [ int ( x ) for x in self . remote . split ( '.' ) ] ) , data ] sock = socket . socket ( socket . AF_PACKET , socket . SOCK_RAW , socket . SOCK_RAW ) sock . bind ( ( self . adapter , socket . SOCK_RAW ) ) sock . send ( '' . join ( arpf ) ) sock . close ( ) except Exception , e : print e