Created
July 6, 2016 03:38
-
-
Save mjmckinnon/8eb3587d2ede0f199159e3d410e0abf7 to your computer and use it in GitHub Desktop.
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/sh | |
# Written by: Michael McKinnon @bigmac | |
# Part one of a quick and dirty script | |
# to get a cowrie SSH honeypot up and running | |
# This one just changes the SSH port, the | |
# good stuff happens in the Part two :) | |
# Init the actual SSH port we will use to | |
# access the real honeypot server, not the | |
# cowrie SSH instance | |
SSHPORT = 1122 | |
# Yes, this needs to run as root. | |
# Freshen up for the onslaught! Standard Ubuntu update. | |
apt-get update | |
sudo apt-get -y upgrade | |
# Change the SSH daemon port from 22 to something obscure, like... 1122 | |
sed -i 's/Port 22/Port $SSHPORT/g' /etc/ssh/sshd_config | |
service ssh restart | |
# Tell the user to reconnect now!! | |
echo -e "\E[1;31m======= WARNING =======" | |
echo "The SSH port for this server has just been changed to Port $SSHPORT" | |
echo "Please STAY CONNECTED IN THIS SESSION while you open a NEW session" | |
echo "to confirm that you can access this server using the new port." | |
echo "\n\n" | |
echo "You'll want to logout here, and from the new SSH session run Part 2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment