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 | |
# Written by Brian Tissue May 2021 | |
> nmapresults.txt | |
for HOST in `cat hosts_scan|grep -v ^#`; do echo ${HOST}; nmap -v ${HOST} | grep -i ${HOST} | grep -i open ; done >> /home/scanner/nmapresults.txt | |
/usr/sbin/sendmail [email protected] < /home/scanner/nmapresults.txt | |
/usr/sbin/sendmail [email protected] < /home/scanner/nmapresults.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 | |
[email protected] | |
[email protected] | |
SERVER=fqdnoripaddress | |
PAUSE=300 | |
FAILED=0 | |
DEBUG=0 | |
while true | |
do |
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 | |
[email protected] | |
[email protected] | |
SERVER=https://servertomonitor.domain.com | |
PAUSE=300 # Checks this server every 5 minutes | |
FAILED=0 | |
DEBUG=0 | |
while true | |
do |
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 | |
# Program name: monitor-website.sh | |
# Written by Brian Tissue August 30th 2018 | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. Exiting..." | |
echo "Please use sudo -s then run this script again as root." | |
exit 0 | |
else | |
echo "Running as root. Good" |
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
PS1="\n\[\e[1;30m\][$$:$PPID - \j:\!\[\e[1;30m\]]\[\e[0;36m\] \T \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]:\[\e[0;37m\]${SSH_TTY:-o} \[\e[0;32m\]+${SHLVL}\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n\$ " |
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 | |
# Used for Airgapped Ubuntu Servers; downloads package and required dependencies | |
# Just SCP them over to the server that needs them. Ensure OS/Kernel is the same on both. | |
# Feel free to comment if you have a suggestion to improve the script | |
read -p "Please enter the package name you would like to look for: " packagesearch | |
apt-cache search "$packagesearch" | |
read -p "Please enter the verified package name you would like to download: " package |
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 | |
# Script by Brian Tissue | |
# Used to assign static IP addresses to LXC containers | |
LXCPATH='/var/lib/lxc' | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. I told you that you needed to be root, come on man..." | |
echo "Please use su -s then run this script again as root." | |
exit 0 |
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 | |
# Check if root | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. Exiting..." | |
exit 0 | |
else | |
echo "Editing and Reviewing UFW Firewall Entries" | |
fi | |
sudo ufw status numbered |
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 | |
read -p "Enter UserID: " userid | |
touch find-$userid.txt | |
for HOST in `cat ../server_list|grep -v ^#`; do echo ${HOST}; ssh ${HOST} "hostname;cat /etc/passwd | grep -i $userid"; echo ""; done >> find-$ | |
for HOST in `cat ../server_list2|grep -v ^#`; do echo ${HOST}; ssh ${HOST} "hostname;cat /etc/passwd |grep -i $userid"; echo ""; done >$ | |
read -p "Press [Enter] key to view the number of servers $userid resides..." | |
cat find-$userid.txt | grep -i $userid | wc -l | |
read -p "End of script..." |
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 | |
# Daily report of IP addresses that have hit the server | |
# This script will filter out the private IP addresses | |
# You could use this script to generate a report for white-lists; or auditing purposes | |
# Check if root | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. Exiting..." | |
exit 0 | |
else |
NewerOlder