Last active
August 29, 2015 14:15
-
-
Save awoodworth/cd53a0a49d9fbdd1a2c7 to your computer and use it in GitHub Desktop.
Hackery
This file contains 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 | |
# searching for callbacks | |
cd /etc | |
grep -ErHn "10.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" * >> ~/callbacks.txt |
This file contains 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 | |
# makes a checksum file and checks direcotries for changes, | |
# copies known backup folders back over changed directories | |
httpd="/var/www/" | |
tomcat="/etc/tomcat5/" | |
backup="/home/administrator/backup2" | |
mkdir /home/administrator/fucked | |
find $httpd -type f -exec md5sum {} \; | md5sum > ~/httpdck1.txt | |
find $tomcat -type f -exec md5sum {} \; | md5sum > ~/tomcatck1.txt | |
while(true); do | |
find $httpd -type f -exec md5sum {} \; | md5sum > ~/httpdck2.txt | |
cmp -s ~/httpdck1.txt ~/httpdck2.txt > /dev/null | |
if [ $? -eq 1 ]; then | |
# rewrite automatically | |
mkdir /home/administrator/fucked/`date +"%H%M%S"` | |
dir=`date +"%H%M%S"` | |
cp -Rp $httpd /home/administrator/fucked/$dir | |
rm -rf $httpd | |
cp -Rp $backup/www/ /var/ | |
printf "httpd changed - ";date | |
fi | |
find $tomcat -type f -exec md5sum {} \; | md5sum > ~/tomcatck2.txt | |
cmp -s ~/tomcatck1.txt ~/tomcatck2.txt > /dev/null | |
if [ $? -eq 1 ]; then | |
# rewrite automatically | |
mkdir /home/administrator/fucked/`date +"%H%M%S"` | |
dir=`date +"%H%M%S"` | |
cp -Rp $tomcat /home/administrator/fucked/$dir | |
rm -rf $tomcat | |
cp -Rp $backup/tomcat5/ /etc/ | |
printf "tomcat changed - ";date | |
fi | |
sleep 5 | |
done |
This file contains 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
# dd over ssh | |
sudo dd if=/dev/sda# | gzip -1 - | ssh user@remoteip dd of=image.gz |
This file contains 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
awk -F : '{printf $1"\n"}' /etc/shadow |
This file contains 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 | |
# logs out any remote sessions | |
while(true); do | |
who -u | grep -E "10.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" > loggedin.txt | |
awk '{printf $2"\n"}' loggedin.txt > shell.txt | |
awk '{printf $1"\n"}' loggedin.txt > who.txt | |
while read shell; do | |
fuser -k /dev/$shell | |
date | |
while read who; do | |
echo $who | |
echo "" > eval echo ~$who/.ssh/authorized_keys | |
done <who.txt | |
printf "CHANGE PASSWORD\n==================================" | |
done <shell.txt | |
sleep 5 | |
done |
This file contains 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 | |
OPSYS=$(uname -o) | |
HNAME=$(uname -n) | |
HARDWARE=$(uname -i) | |
MSG=$(dmesg) | |
STG= | |
echo 'Operating system: ' $OPSYS >> results | |
echo '\nHostname: ' $HNAME >> results | |
echo '\nHardware platform: ' $HARDWARE >> results | |
echo '\nDmesg: ' >> results | |
for i in "${MSG[@]}" | |
do | |
echo $i >> results | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment