diff options
author | Jesse Hertz <jesse_hertz@apple.com> | 2021-07-22 23:40:31 -0400 |
---|---|---|
committer | Jesse Hertz <jesse_hertz@apple.com> | 2021-07-22 23:40:31 -0400 |
commit | c9460c4788bb6e2e14d8feab01c737e18871d193 (patch) | |
tree | f82a583633140b478100fbccb9bdb1396282ae62 | |
parent | 44ffcf7ede7f25aec354709fef0ce2a7e3212a37 (diff) | |
download | afl++-c9460c4788bb6e2e14d8feab01c737e18871d193.tar.gz |
persistent SHM config install for Mac
-rwxr-xr-x | afl-persistent-config | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/afl-persistent-config b/afl-persistent-config new file mode 100755 index 00000000..3c280e55 --- /dev/null +++ b/afl-persistent-config @@ -0,0 +1,59 @@ +#!/bin/bash +# written by jhertz +# + +PLATFORM=`uname -s` + + +# check that we're on Mac +if [[ ! "$PLATFORM" = "Darwin" ]] ; then + echo "This script is for Mac OS" + exit 1 +fi + +# check if UID == 0 +if [[ $EUID -ne 0 ]]; then + echo "You really should be root to do this" + exit 1 +fi + +# check if SIP is disabled +if [[ ! $(csrutil status | grep "disabled") ]]; then + echo "SIP needs to be disabled" + exit 1 +fi + +echo "Okay cool, checks passed" + +echo "Installing plist" + +cat << EOF > /Library/LaunchDaemons/shm_setup.plist +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>shmemsetup</string> + <key>UserName</key> + <string>root</string> + <key>GroupName</key> + <string>wheel</string> + <key>ProgramArguments</key> + <array> + <string>/usr/sbin/sysctl</string> + <string>-w</string> + <string>kern.sysv.shmmax=268435456</string> + <string>kern.sysv.shmmni=128</string> + <string>kern.sysv.shmseg=32</string> + <string>kern.sysv.shmall=65536</string> + </array> + <key>KeepAlive</key> + <false/> + <key>RunAtLoad</key> + <true/> +</dict> +</plist> +EOF + +echo "Reboot and enjoy your fuzzing" + |