SSD Trim 분석보고서

❑ 개요

<aside> 💡 TRIM기능도 운영체제에서 처리해야할 작업의 일부이므로, 랜섬웨어의 경우 대량의 파일을 읽고, 수정(쓰기)해야하므로, 해당 작업도중 TRIM 작업이 추가될 경우, 작업이 지연처리되므로 해당 시간차동안 원본 데이터가 남아 있을 수 있다는 가설에 대한 실험 내용임.

</aside>

❑ 실험 사양

❑ 실험 내용

<aside> 👉 그러므로, 랜섬웨어의 경우에는 다량의 파일이 수정, 생성, 삭제되는 경우가 많으므로, 실제로 해당 시간동안 GC가 작동하지 못할 상황이 크다고 판단되며, 삭제가 진행되더라도 실제 컨트롤러에서는 파일을 삭제하지못해 원본파일이 존재할 수 있다고 판단함

</aside>

import os
import random
import time
def gen_rnd_file(filename, linecount):
    nouns = ("puppy", "car", "rabbit", "girl", "monkey")
    verbs = ("runs", "hits", "jumps", "drives", "barfs")
    adv = ("crazily.", "dutifully.", "foolishly.", "merrily.", "occasionally.")
    adj = ("adorable", "clueless", "dirty", "odd", "stupid")
    all = [nouns, verbs, adj, adv]
    with open(filename,'w') as f:
        for i in range(linecount):
            f.writelines([' '.join([random.choice(i) for i in all]),'\\n'])
    pass
if __name__ == '__main__':
    cnt = 0
    while(True):
        gen_rnd_file("test_" + str(cnt) + ".txt",random.randrange(3000, 10000))
        time.sleep(0.3)
        cnt += 1