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
# Scan network range (replace with yours) for MAC addresses, compare with previous scan, and report differences with PushBullet. | |
# Requires pushbullet bash script from https://github.com/Red5d/pushbullet-bash | |
touch prev-macs.txt | |
sudo nmap -sP -n 192.168.1.1/24 | grep "MAC Address" | sort > macs.txt | |
if [ $(diff macs.txt prev-macs.txt) ];then | |
pushbullet push all note "New network devices: $(diff macs.txt prev-macs.txt)" | |
fi | |
mv macs.txt prev-macs.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 | |
echo "Installing basic security..." | |
apt-get -y install ufw rkhunter fail2ban | |
ufw allow 22 | |
ufw allow 80 | |
ufw allow 443 | |
ufw enable | |
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 | |
# This script helps set up GeoIP-based access restriction. | |
# Commands adapted from http://blog.grimneko.de/?p=228 | |
echo "Installing libgeoip-dev, libpam0g-dev, and make (just in case it's not there)..." | |
sudo apt-get install libgeoip-dev libpam0g-dev make | |
echo |
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 | |
info=$(curl -s http://www.infosniper.net/?ip_address=$1 | grep content-td2 | cut -d'>' -f2 | cut -d'<' -f1 | sed 's/ //g') | |
echo -n "Country: " | |
echo "$info" | sed -n '10p' | |
echo -n "State: " | |
echo "$info" | sed -n '6p' |
NewerOlder