示例#1
0
    def read(self, nb_of_recv=1):
        """
        Read from the server
        :param nb_of_recv: Number of message to try to receive
        :returns:    The received data
        """

        data = "\n"
        for x in range(0, nb_of_recv):
            data += bytes_to_str(self.socket.recv(4096))
        return data
示例#2
0
    def read(self, nb_of_recv=1):
        """
        Read from the server
        :param nb_of_recv: Number of message to try to receive
        :returns:    The received data
        """

        data = "\n"
        for x in range(0, nb_of_recv):
            data += bytes_to_str(self.tn.read_some())
        return data
示例#3
0
    def read(self, nb_of_recv=1):
        '''
        Read from the server
        :param nb_of_recv: Number of message to try to receive
        :returns:    The received data
        '''

        data = "\n"
        for x in range(0, nb_of_recv):
            data += bytes_to_str(self.socket.recv(4096))
        return data
示例#4
0
    def read_until(self, substring):
        """
        Read until 'substring' is found

        :param substring: The string to look for
        :returns:         The received data
        """

        data = "\n"
        while substring not in data:
            data += bytes_to_str(self.socket.recv(4096))
        return data
示例#5
0
    def read_until(self, substring):
        '''
        Read until 'substring' is found

        :param substring: The string to look for
        :returns:         The received data
        '''

        data = "\n"
        while substring not in data:
            data += bytes_to_str(self.socket.recv(4096))
        return data
示例#6
0
    def restore_file(self, file_name, source=None):
        if source:
            f = open(source, "r")
            to_restore = f.read()
            f.close()

        else:
            to_restore = self.bytes_dump

        try:
            f = open(file_name, "w")
            f.write(bytes_to_str(hexdump.restore(to_restore)))
            f.close()
        except FileNotFoundError as e:
            debug(e)
示例#7
0
文件: hexeditor.py 项目: Aookii/v0lt
    def restore_file(self, file_name, source=None):
        if source:
            f = open(source, "r")
            to_restore = f.read()
            f.close()

        else:
            to_restore = self.bytes_dump

        try:
            f = open(file_name, "w")
            f.write(bytes_to_str(hexdump.restore(to_restore)))
            f.close()
        except FileNotFoundError as e:
            debug(e)
示例#8
0
文件: telnet.py 项目: wilbeibi/v0lt
 def read(self, nb_of_recv=1):
     data = "\n"
     for x in range(0, nb_of_recv):
         data += bytes_to_str(self.tn.read_some())
     return data
示例#9
0
文件: netcat.py 项目: Aookii/v0lt
 def read_until(self, substring):
     data = "\n"
     while substring not in data:
         data += bytes_to_str(self.socket.recv(4096))
     return data
示例#10
0
文件: netcat.py 项目: Aookii/v0lt
 def read(self, nb_of_recv=1):
     data = "\n"
     for x in range(0, nb_of_recv):
         data += bytes_to_str(self.socket.recv(4096))
     return data
示例#11
0
 def read_until(self, substring):
     data = "\n"
     while substring not in data:
         data += bytes_to_str(self.socket.recv(4096))
     return data
示例#12
0
 def read(self, nb_of_recv=1):
     data = "\n"
     for x in range(0, nb_of_recv):
         data += bytes_to_str(self.socket.recv(4096))
     return data