2017-09-26 15:15:17 +00:00
#!/bin/bash
2018-06-19 08:58:20 +00:00
# T-Pot Universal Installer
2019-02-18 16:45:31 +00:00
##################
# I. Global vars #
##################
2019-02-16 14:46:16 +00:00
2019-02-18 16:45:31 +00:00
myBACKTITLE = "T-Pot-Installer"
myCONF_FILE = "/root/installer/iso.conf"
myPROGRESSBOXCONF = " --backtitle " $myBACKTITLE " --progressbox 24 80"
mySITES = "https://hub.docker.com https://github.com https://pypi.python.org https://debian.org"
myTPOTCOMPOSE = "/opt/tpot/etc/tpot.yml"
2019-08-02 16:57:22 +00:00
myLSB_STABLE_SUPPORTED = "stretch buster"
2020-03-16 15:01:18 +00:00
myLSB_TESTING_SUPPORTED = "stable"
2019-02-18 16:45:31 +00:00
myREMOTESITES = "https://hub.docker.com https://github.com https://pypi.python.org https://debian.org"
2020-03-04 12:12:12 +00:00
myPREINSTALLPACKAGES = "aria2 apache2-utils cracklib-runtime curl dialog figlet fuse grc libcrack2 libpq-dev lsb-release netselect-apt net-tools software-properties-common toilet"
2020-03-15 20:11:26 +00:00
myINSTALLPACKAGES = "aria2 apache2-utils apparmor apt-transport-https aufs-tools bash-completion build-essential ca-certificates cgroupfs-mount cockpit console-setup console-setup-linux cracklib-runtime curl debconf-utils dialog dnsutils docker.io docker-compose elasticsearch-curator ethtool fail2ban figlet genisoimage git glances grc haveged html2text htop iptables iw jq kbd libcrack2 libltdl7 libpam-google-authenticator man mosh multitail netselect-apt net-tools npm ntp openssh-server openssl pass pigz prips software-properties-common syslinux psmisc pv python3-pip toilet unattended-upgrades unzip vim wget wireless-tools wpasupplicant"
2019-02-18 16:45:31 +00:00
myINFO = " \
2020-03-16 15:01:18 +00:00
###########################################
### T-Pot Installer for Debian (Stable) ###
###########################################
2019-02-18 16:45:31 +00:00
Disclaimer:
This script will install T-Pot on this system.
By running the script you know what you are doing:
1. SSH will be reconfigured to tcp/64295.
2020-03-16 15:01:18 +00:00
2. Please ensure other means of access to this system in case something goes wrong.
3. At best this script will be executed on the console instead through a SSH session.
2019-02-18 16:45:31 +00:00
########################################
Usage:
$0 --help - Help.
Example:
$0 --type= user - Best option for most users."
myNETWORK_INTERFACES = "
wpa-driver wired
wpa-conf /etc/wpa_supplicant/wired8021x.conf
### Example wireless config for 802.1x
### This configuration was tested with the IntelNUC series
### If problems occur you can try and change wpa-driver to \"iwlwifi\"
### Do not forget to enter a ssid in /etc/wpa_supplicant/wireless8021x.conf
### The Intel NUC uses wlpXsY notation instead of wlanX
#
#auto wlp2s0
#iface wlp2s0 inet dhcp
# wpa-driver wext
# wpa-conf /etc/wpa_supplicant/wireless8021x.conf
"
myNETWORK_WIRED8021x = " ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group = root
eapol_version = 1
ap_scan = 1
network = {
key_mgmt = IEEE8021X
eap = TLS
identity = \" host/$myCONF_PFX_HOST_ID \"
private_key = \" /etc/wpa_supplicant/8021x.pfx\"
private_key_passwd = \" $myCONF_PFX_PW \"
}
"
myNETWORK_WLAN8021x = " ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group = root
eapol_version = 1
ap_scan = 1
network = {
ssid = \" <your_ssid_here_without_brackets>\"
key_mgmt = WPA-EAP
pairwise = CCMP
group = CCMP
eap = TLS
identity = \" host/$myCONF_PFX_HOST_ID \"
private_key = \" /etc/wpa_supplicant/8021x.pfx\"
private_key_passwd = \" $myCONF_PFX_PW \"
}
"
myNETWORK_WLANEXAMPLE = "
### Example static ip config
### Replace <eth0> with the name of your physical interface name
#
#auto eth0
#iface eth0 inet static
# address 192.168.1.1
# netmask 255.255.255.0
# network 192.168.1.0
# broadcast 192.168.1.255
# gateway 192.168.1.1
# dns-nameservers 192.168.1.1
### Example wireless config without 802.1x
### This configuration was tested with the IntelNUC series
2019-02-19 08:14:13 +00:00
### If problems occur you can try and change wpa-driver to \"iwlwifi\"
2019-02-18 16:45:31 +00:00
#
#auto wlan0
#iface wlan0 inet dhcp
# wpa-driver wext
# wpa-ssid <your_ssid_here_without_brackets>
# wpa-ap-scan 1
# wpa-proto RSN
# wpa-pairwise CCMP
# wpa-group CCMP
# wpa-key-mgmt WPA-PSK
# wpa-psk \"<your_password_here_without_brackets>\"
"
myUPDATECHECK = " APT::Periodic::Update-Package-Lists \"1\";
APT::Periodic::Download-Upgradeable-Packages \" 0\" ;
APT::Periodic::AutocleanInterval \" 7\" ;
"
mySYSCTLCONF = "
# Reboot after kernel panic, check via /proc/sys/kernel/panic[_on_oops]
# Set required map count for ELK
kernel.panic = 1
kernel.panic_on_oops = 1
vm.max_map_count = 262144
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
"
myFAIL2BANCONF = " [DEFAULT]
ignore-ip = 127.0.0.1/8
bantime = 3600
findtime = 600
maxretry = 5
[ nginx-http-auth]
enabled = true
filter = nginx-http-auth
port = 64297
logpath = /data/nginx/log/error.log
[ pam-generic]
enabled = true
port = 64294
filter = pam-generic
logpath = /var/log/auth.log
[ sshd]
enabled = true
port = 64295
filter = sshd
logpath = /var/log/auth.log
"
mySYSTEMDFIX = " [Link]
NamePolicy = kernel database onboard slot path
MACAddressPolicy = none
"
2019-02-25 10:52:24 +00:00
myCOCKPIT_SOCKET = " [Socket]
ListenStream =
ListenStream = 64294
"
2019-04-06 09:31:23 +00:00
mySSHPORT = "
2019-04-06 09:51:18 +00:00
Port 64295
2019-04-06 09:31:23 +00:00
"
2019-02-18 16:45:31 +00:00
myCRONJOBS = "
# Check if updated images are available and download them
27 1 * * * root docker-compose -f /opt/tpot/etc/tpot.yml pull
# Delete elasticsearch logstash indices older than 90 days
27 4 * * * root curator --config /opt/tpot/etc/curator/curator.yml /opt/tpot/etc/curator/actions.yml
# Uploaded binaries are not supposed to be downloaded
*/1 * * * * root mv --backup= numbered /data/dionaea/roots/ftp/* /data/dionaea/binaries/
# Daily reboot
27 3 * * * root systemctl stop tpot && docker stop \$ ( docker ps -aq) || docker rm \$ ( docker ps -aq) || reboot
# Check for updated packages every sunday, upgrade and reboot
2019-04-04 06:55:59 +00:00
27 16 * * 0 root apt-fast autoclean -y && apt-fast autoremove -y && apt-fast update -y && apt-fast upgrade -y && sleep 10 && reboot
2019-02-18 16:45:31 +00:00
"
2019-09-19 19:32:15 +00:00
mySHELLCHECK = '[[ $- == *i* ]] || return'
2019-02-18 16:45:31 +00:00
myROOTPROMPT = 'PS1="\[\033[38;5;8m\][\[$(tput sgr0)\]\[\033[38;5;1m\]\u\[$(tput sgr0)\]\[\033[38;5;6m\]@\[$(tput sgr0)\]\[\033[38;5;4m\]\h\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;5m\]\w\[$(tput sgr0)\]\[\033[38;5;8m\]]\[$(tput sgr0)\]\[\033[38;5;1m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"'
myUSERPROMPT = 'PS1="\[\033[38;5;8m\][\[$(tput sgr0)\]\[\033[38;5;2m\]\u\[$(tput sgr0)\]\[\033[38;5;6m\]@\[$(tput sgr0)\]\[\033[38;5;4m\]\h\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;5m\]\w\[$(tput sgr0)\]\[\033[38;5;8m\]]\[$(tput sgr0)\]\[\033[38;5;2m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"'
myROOTCOLORS = " export LS_OPTIONS='--color=auto'
eval \" \` dircolors\` \"
alias ls = 'ls \$LS_OPTIONS'
alias ll = 'ls \$LS_OPTIONS -l'
alias l = 'ls \$LS_OPTIONS -lA' "
#################
# II. Functions #
#################
# Create banners
function fuBANNER {
toilet -f ivrit " $1 "
}
# Create funny words for hostnames
function fuRANDOMWORD {
local myWORDFILE = " $1 "
local myLINES = $( cat $myWORDFILE | wc -l)
local myRANDOM = $(( RANDOM % $myLINES ))
local myNUM = $(( myRANDOM * myRANDOM % $myLINES + 1 ))
echo -n $( sed -n " $myNUM p " $myWORDFILE | tr -d \' | tr A-Z a-z)
}
# Do we have root?
2019-02-16 14:46:16 +00:00
function fuGOT_ROOT {
echo
echo -n "### Checking for root: "
if [ " $( whoami) " != "root" ] ;
then
echo "[ NOT OK ]"
echo "### Please run as root."
echo " ### Example: sudo $0 "
exit
else
echo "[ OK ]"
fi
}
2019-02-18 16:45:31 +00:00
# Check for pre-installer package requirements.
# If not present install them
2019-02-16 14:46:16 +00:00
function fuCHECKPACKAGES {
2019-02-18 16:45:31 +00:00
export DEBIAN_FRONTEND = noninteractive
2019-04-06 09:31:23 +00:00
# Make sure dependencies for apt-fast are installed
myCURL = $( which curl)
myWGET = $( which wget)
2019-07-04 10:59:03 +00:00
mySUDO = $( which sudo)
if [ " $myCURL " = = "" ] || [ " $myWGET " = = "" ] || [ " $mySUDO " = = "" ]
2019-04-06 09:31:23 +00:00
then
echo "### Installing deps for apt-fast"
apt-get -y update
2019-07-04 10:50:12 +00:00
apt-get -y install curl wget sudo
2019-04-06 09:31:23 +00:00
fi
2019-04-03 13:39:40 +00:00
echo "### Installing apt-fast"
/bin/bash -c " $( curl -sL https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh) "
2019-02-16 14:46:16 +00:00
echo -n "### Checking for installer dependencies: "
local myPACKAGES = " $1 "
for myDEPS in $myPACKAGES ;
2019-02-19 08:14:13 +00:00
do
myOK = $( dpkg -s $myDEPS 2>& 1 | grep -w ok | awk '{ print $3 }' | head -n 1)
if [ " $myOK " != "ok" ] ;
then
echo "[ NOW INSTALLING ]"
2019-04-03 13:39:40 +00:00
apt-fast update -y
apt-fast install -y $myPACKAGES
2019-02-19 08:14:13 +00:00
break
fi
2019-02-16 14:46:16 +00:00
done
2019-02-19 08:14:13 +00:00
if [ " $myOK " = "ok" ] ;
2019-02-16 14:46:16 +00:00
then
echo "[ OK ]"
fi
}
2019-02-16 13:50:59 +00:00
2019-02-18 16:45:31 +00:00
# Check if remote sites are available
2019-02-16 13:50:59 +00:00
function fuCHECKNET {
2019-02-18 16:59:12 +00:00
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "iso" ] || [ " $myTPOT_DEPLOYMENT_TYPE " = = "user" ] ;
then
local mySITES = " $1 "
mySITESCOUNT = $( echo $mySITES | wc -w)
j = 0
for i in $mySITES ;
do
echo $( expr 100 \* $j / $mySITESCOUNT ) | dialog --title "[ Availability check ]" --backtitle " $myBACKTITLE " --gauge " \n Now checking: $i \n " 8 80
curl --connect-timeout 30 -IsS $i 2>& 1>/dev/null
if [ $? -ne 0 ] ;
2019-02-16 13:50:59 +00:00
then
2019-02-18 16:59:12 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Continue? ]" --yesno "\nAvailability check failed. You can continue, but the installation might fail." 10 50
if [ $? = 1 ] ;
then
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Abort ]" --msgbox "\nInstallation aborted. Exiting the installer." 7 50
exit
else
break;
fi ;
2019-02-16 13:50:59 +00:00
fi ;
2019-02-18 16:59:12 +00:00
let j += 1
echo $( expr 100 \* $j / $mySITESCOUNT ) | dialog --keep-window --title "[ Availability check ]" --backtitle " $myBACKTITLE " --gauge " \n Now checking: $i \n " 8 80
done ;
fi
2019-02-16 13:50:59 +00:00
}
2018-06-19 08:58:20 +00:00
2019-02-18 16:45:31 +00:00
# Install T-Pot dependencies
function fuGET_DEPS {
2019-02-18 17:06:14 +00:00
export DEBIAN_FRONTEND = noninteractive
2020-03-10 10:12:50 +00:00
# Determine fastest mirror
echo
echo "### Determine fastest mirror for your location."
echo
2020-03-16 15:01:18 +00:00
netselect-apt -n -a amd64 stable && cp sources.list /etc/apt/
mySOURCESCHECK = $( cat /etc/apt/sources.list | grep -c stable)
2020-03-10 10:12:50 +00:00
if [ " $mySOURCESCHECK " = = "0" ]
then
echo "### Automatic mirror selection failed, using main mirror."
2020-03-16 15:01:18 +00:00
# Point to Debian (stable)
2019-04-28 11:06:19 +00:00
tee /etc/apt/sources.list <<EOF
2020-03-16 15:01:18 +00:00
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
2019-04-03 13:39:40 +00:00
EOF
2020-03-10 10:12:50 +00:00
fi
2019-02-18 17:06:14 +00:00
echo
echo "### Getting update information."
echo
2019-04-03 13:39:40 +00:00
apt-fast -y update
2019-02-18 17:06:14 +00:00
echo
echo "### Upgrading packages."
echo
# Downlaod and upgrade packages, but silently keep existing configs
echo "docker.io docker.io/restart boolean true" | debconf-set-selections -v
echo "debconf debconf/frontend select noninteractive" | debconf-set-selections -v
2019-04-03 13:39:40 +00:00
apt-fast -y dist-upgrade -o Dpkg::Options::= "--force-confdef" -o Dpkg::Options::= "--force-confold" --force-yes
2019-02-18 17:06:14 +00:00
echo
echo "### Installing T-Pot dependencies."
echo
2019-04-03 13:39:40 +00:00
apt-fast -y install $myINSTALLPACKAGES
2019-02-18 17:06:14 +00:00
# Remove exim4
2019-10-26 10:40:09 +00:00
echo "### Removing and holding back problematic packages ..."
apt-fast -y purge exim4-base mailutils pcp cockpit-pcp
2019-04-04 06:55:59 +00:00
apt-fast -y autoremove
2019-10-26 10:40:09 +00:00
apt-mark hold exim4-base mailutils pcp cockpit-pcp
2019-02-18 16:45:31 +00:00
}
2018-06-19 08:58:20 +00:00
2019-02-18 16:45:31 +00:00
# Check for other services
function fuCHECK_PORTS {
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "user" ] ;
then
echo
echo "### Checking for active services."
echo
2019-02-18 17:20:23 +00:00
grc netstat -tulpen
2019-02-18 16:45:31 +00:00
echo
echo "### Please review your running services."
echo "### We will take care of SSH (22), but other services i.e. FTP (21), TELNET (23), SMTP (25), HTTP (80), HTTPS (443), etc."
echo "### might collide with T-Pot's honeypots and prevent T-Pot from starting successfully."
echo
while [ 1 != 2 ]
do
read -s -n 1 -p "Continue [y/n]? " mySELECT
echo
case " $mySELECT " in
[ y,Y] )
break
; ;
[ n,N] )
exit
; ;
esac
done
fi
}
2018-06-19 08:58:20 +00:00
2019-02-18 16:45:31 +00:00
############################
# III. Pre-Installer phase #
############################
fuGOT_ROOT
fuCHECKPACKAGES " $myPREINSTALLPACKAGES "
2018-06-19 08:58:20 +00:00
2019-02-18 16:45:31 +00:00
#####################################
# IV. Prepare installer environment #
#####################################
2018-06-23 23:55:41 +00:00
2019-02-18 16:45:31 +00:00
# Check for Debian release and extract command line arguments
myLSB = $( lsb_release -c | awk '{ print $2 }' )
2019-08-02 16:57:22 +00:00
myVERSIONS = " $myLSB_STABLE_SUPPORTED $myLSB_TESTING_SUPPORTED "
mySUPPORT = "FALSE"
for i in $myVERSIONS
do
if [ " $myLSB " = " $i " ] ;
then
mySUPPORT = "TRUE"
fi
done
if [ " $mySUPPORT " = "FALSE" ] ;
2018-06-19 08:58:20 +00:00
then
2019-01-28 20:52:55 +00:00
echo " Aborting. Debian $myLSB is not supported. "
2018-06-19 08:58:20 +00:00
exit
fi
if [ " $1 " = = "" ] ;
then
echo " $myINFO "
exit
fi
for i in " $@ "
do
case $i in
--conf= *)
myTPOT_CONF_FILE = " ${ i #*= } "
shift
; ;
--type= user)
myTPOT_DEPLOYMENT_TYPE = " ${ i #*= } "
shift
; ;
--type= auto)
myTPOT_DEPLOYMENT_TYPE = " ${ i #*= } "
shift
; ;
--type= iso)
myTPOT_DEPLOYMENT_TYPE = " ${ i #*= } "
shift
; ;
--help)
echo " Usage: $0 <options> "
echo
echo "--conf=<Path to \"tpot.conf\">"
2018-06-21 15:16:33 +00:00
echo " Use this if you want to automatically deploy a T-Pot instance (--type=auto implied)."
2018-06-19 08:58:20 +00:00
echo " A configuration example is available in \"tpotce/iso/installer/tpot.conf.dist\"."
echo
echo "--type=<[user, auto, iso]>"
2020-03-16 15:01:18 +00:00
echo " user, use this if you want to manually install a T-Pot on a Debian (Stable) machine."
2018-06-21 15:16:33 +00:00
echo " auto, implied if a configuration file is passed as an argument for automatic deployment."
2018-06-19 08:58:20 +00:00
echo " iso, use this if you are a T-Pot developer and want to install a T-Pot from a pre-compiled iso."
echo
exit
; ;
*)
echo " $myINFO "
exit
; ;
esac
done
2019-02-18 16:45:31 +00:00
# Validate command line arguments and load config
2018-06-19 08:58:20 +00:00
# If a valid config file exists, set deployment type to "auto" and load the configuration
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "auto" ] && [ " $myTPOT_CONF_FILE " = = "" ] ;
then
echo "Aborting. No configuration file given."
exit
fi
if [ -s " $myTPOT_CONF_FILE " ] && [ " $myTPOT_CONF_FILE " != "" ] ;
then
myTPOT_DEPLOYMENT_TYPE = "auto"
if [ " $( head -n 1 $myTPOT_CONF_FILE | grep -c "# tpot" ) " = = "1" ] ;
then
source " $myTPOT_CONF_FILE "
else
echo " Aborting. Config file \" $myTPOT_CONF_FILE \" not a T-Pot configuration file. "
exit
fi
elif ! [ -s " $myTPOT_CONF_FILE " ] && [ " $myTPOT_CONF_FILE " != "" ] ;
2018-06-23 23:55:41 +00:00
then
2018-06-19 08:58:20 +00:00
echo " Aborting. Config file \" $myTPOT_CONF_FILE \" not found. "
exit
2018-06-23 23:55:41 +00:00
fi
2018-06-19 08:58:20 +00:00
# Prepare running the installer
2018-06-22 14:57:38 +00:00
echo " $myINFO " | head -n 3
fuCHECK_PORTS
2018-06-19 08:58:20 +00:00
2018-06-23 22:05:46 +00:00
2019-02-18 16:45:31 +00:00
#######################################
# V. Installer user interaction phase #
#######################################
2018-06-17 20:30:50 +00:00
2019-02-12 15:56:43 +00:00
# Set TERM
2017-09-26 15:15:17 +00:00
export TERM = linux
2018-06-20 16:29:18 +00:00
# If this is a ISO installation we need to wait a few seconds to avoid interference with service messages
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "iso" ] ;
then
sleep 5
2019-02-12 15:56:43 +00:00
dialog --keep-window --no-ok --no-cancel --backtitle " $myBACKTITLE " --title "[ Wait to avoid interference with service messages ]" --pause "" 6 80 7
2018-06-20 16:29:18 +00:00
fi
2017-09-26 15:15:17 +00:00
2019-02-18 16:59:12 +00:00
# Check if remote sites are available
fuCHECKNET " $myREMOTESITES "
2019-02-12 15:56:43 +00:00
# Let' s load the iso config file if there is one
2018-06-15 16:24:20 +00:00
if [ -f $myCONF_FILE ] ;
then
2019-02-12 15:56:43 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Found personalized iso.config ]" --msgbox "\nYour personalized settings will be applied!" 7 47
2018-06-15 16:24:20 +00:00
source $myCONF_FILE
else
# dialog logic considers 1=false, 0=true
myCONF_PROXY_USE = "1"
myCONF_PFX_USE = "1"
myCONF_NTP_USE = "1"
fi
2018-06-20 16:29:18 +00:00
### <--- Begin proxy setup
# If a proxy is set in iso.conf it needs to be setup.
# However, none of the other installation types will automatically take care of a proxy.
# Please open a feature request if you think this is something worth considering.
2018-06-15 16:24:20 +00:00
myPROXY = " http:// $myCONF_PROXY_IP : $myCONF_PROXY_PORT "
2018-06-29 22:16:32 +00:00
myPROXY_ENV = " export http_proxy= $myPROXY
2017-09-26 15:15:17 +00:00
export https_proxy = $myPROXY
export HTTP_PROXY = $myPROXY
export HTTPS_PROXY = $myPROXY
export no_proxy = localhost,127.0.0.1,.sock
2018-06-29 22:16:32 +00:00
"
myPROXY_APT = " Acquire::http::Proxy \" $myPROXY \";
Acquire::https::Proxy \" $myPROXY \" ;
"
myPROXY_DOCKER = " http_proxy= $myPROXY
2017-09-26 15:15:17 +00:00
https_proxy = $myPROXY
HTTP_PROXY = $myPROXY
HTTPS_PROXY = $myPROXY
no_proxy = localhost,127.0.0.1,.sock
2018-06-29 22:16:32 +00:00
"
if [ " $myCONF_PROXY_USE " = = "0" ] ;
then
# Let's setup proxy for the environment
2019-02-12 15:56:43 +00:00
echo " $myPROXY_ENV " 2>& 1 | tee -a /etc/environment | dialog --keep-window --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF
2018-06-29 22:16:32 +00:00
source /etc/environment
# Let's setup the proxy for apt
2019-02-12 15:56:43 +00:00
echo " $myPROXY_APT " 2>& 1 | tee /etc/apt/apt.conf | dialog --keep-window --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF
2018-06-29 22:16:32 +00:00
# Let's add proxy settings to docker defaults
2019-02-12 15:56:43 +00:00
echo " $myPROXY_DOCKER " 2>& 1 | tee -a /etc/default/docker | dialog --keep-window --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF
2017-09-26 15:15:17 +00:00
2018-06-29 22:16:32 +00:00
# Let's restart docker for proxy changes to take effect
2019-02-12 15:56:43 +00:00
systemctl stop docker 2>& 1 | dialog --keep-window --title "[ Stop docker service ]" $myPROGRESSBOXCONF
systemctl start docker 2>& 1 | dialog --keep-window --title "[ Start docker service ]" $myPROGRESSBOXCONF
2017-09-26 15:15:17 +00:00
fi
2018-06-20 16:29:18 +00:00
### ---> End proxy setup
2017-09-26 15:15:17 +00:00
2018-06-20 16:29:18 +00:00
# Let's ask the user for install flavor
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "iso" ] || [ " $myTPOT_DEPLOYMENT_TYPE " = = "user" ] ;
then
2019-02-12 15:56:43 +00:00
myCONF_TPOT_FLAVOR = $( dialog --keep-window --no-cancel --backtitle " $myBACKTITLE " --title "[ Choose Your T-Pot NG Edition ]" --menu \
2019-03-20 15:33:13 +00:00
"\nRequired: 6GB RAM, 128GB SSD\nRecommended: 8GB RAM, 256GB SSD" 14 70 6 \
2018-06-20 16:29:18 +00:00
"STANDARD" "Honeypots, ELK, NSM & Tools" \
"SENSOR" "Just Honeypots, EWS Poster & NSM" \
"INDUSTRIAL" "Conpot, RDPY, Vnclowpot, ELK, NSM & Tools" \
"COLLECTOR" "Heralding, ELK, NSM & Tools" \
2019-03-20 10:09:07 +00:00
"NEXTGEN" "NextGen (Glutton, HoneyPy)" 3>& 1 1>& 2 2>& 3 3>& -)
2018-06-20 16:29:18 +00:00
fi
2018-06-21 15:16:33 +00:00
# Let's ask for a secure tsec password if installation type is iso
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "iso" ] ;
then
myCONF_TPOT_USER = "tsec"
myPASS1 = "pass1"
myPASS2 = "pass2"
mySECURE = "0"
while [ " $myPASS1 " != " $myPASS2 " ] && [ " $mySECURE " = = "0" ]
2017-09-26 15:15:17 +00:00
do
2018-06-21 15:16:33 +00:00
while [ " $myPASS1 " = = "pass1" ] || [ " $myPASS1 " = = "" ]
do
2019-02-12 15:56:43 +00:00
myPASS1 = $( dialog --keep-window --insecure --backtitle " $myBACKTITLE " \
2018-06-21 15:16:33 +00:00
--title "[ Enter password for console user (tsec) ]" \
--passwordbox "\nPassword" 9 60 3>& 1 1>& 2 2>& 3 3>& -)
done
2019-02-12 15:56:43 +00:00
myPASS2 = $( dialog --keep-window --insecure --backtitle " $myBACKTITLE " \
2018-06-21 15:16:33 +00:00
--title "[ Repeat password for console user (tsec) ]" \
--passwordbox "\nPassword" 9 60 3>& 1 1>& 2 2>& 3 3>& -)
if [ " $myPASS1 " != " $myPASS2 " ] ;
2017-09-26 15:15:17 +00:00
then
2019-02-12 15:56:43 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Passwords do not match. ]" \
2018-06-21 15:16:33 +00:00
--msgbox "\nPlease re-enter your password." 7 60
2017-09-26 15:15:17 +00:00
myPASS1 = "pass1"
myPASS2 = "pass2"
fi
2018-06-21 15:16:33 +00:00
mySECURE = $( printf "%s" " $myPASS1 " | cracklib-check | grep -c "OK" )
if [ " $mySECURE " = = "0" ] && [ " $myPASS1 " = = " $myPASS2 " ] ;
then
2019-02-12 15:56:43 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Password is not secure ]" --defaultno --yesno "\nKeep insecure password?" 7 50
2018-06-21 15:16:33 +00:00
myOK = $?
if [ " $myOK " = = "1" ] ;
then
myPASS1 = "pass1"
myPASS2 = "pass2"
fi
fi
done
printf "%s" " $myCONF_TPOT_USER : $myPASS1 " | chpasswd
fi
2019-01-28 20:52:55 +00:00
# Let's ask for web user credentials if deployment type is iso or user
2018-06-21 15:16:33 +00:00
# In case of auto, credentials are created from config values
# Skip this step entirely if SENSOR flavor
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "iso" ] || [ " $myTPOT_DEPLOYMENT_TYPE " = = "user" ] ;
then
myOK = "1"
myCONF_WEB_USER = "webuser"
myCONF_WEB_PW = "pass1"
myCONF_WEB_PW2 = "pass2"
mySECURE = "0"
while [ 1 != 2 ]
2017-09-26 15:15:17 +00:00
do
2019-02-12 15:56:43 +00:00
myCONF_WEB_USER = $( dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Enter your web user name ]" --inputbox "\nUsername (tsec not allowed)" 9 50 3>& 1 1>& 2 2>& 3 3>& -)
2018-06-21 15:16:33 +00:00
myCONF_WEB_USER = $( echo $myCONF_WEB_USER | tr -cd "[:alnum:]_.-" )
2019-02-12 15:56:43 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Your username is ]" --yesno " \n $myCONF_WEB_USER " 7 50
2018-06-21 15:16:33 +00:00
myOK = $?
if [ " $myOK " = "0" ] && [ " $myCONF_WEB_USER " != "tsec" ] && [ " $myCONF_WEB_USER " != "" ] ;
then
break
fi
2017-09-26 15:15:17 +00:00
done
2018-06-21 15:16:33 +00:00
while [ " $myCONF_WEB_PW " != " $myCONF_WEB_PW2 " ] && [ " $mySECURE " = = "0" ]
do
while [ " $myCONF_WEB_PW " = = "pass1" ] || [ " $myCONF_WEB_PW " = = "" ]
do
2019-02-12 15:56:43 +00:00
myCONF_WEB_PW = $( dialog --keep-window --insecure --backtitle " $myBACKTITLE " \
2018-06-21 15:16:33 +00:00
--title "[ Enter password for your web user ]" \
--passwordbox "\nPassword" 9 60 3>& 1 1>& 2 2>& 3 3>& -)
done
2019-02-12 15:56:43 +00:00
myCONF_WEB_PW2 = $( dialog --keep-window --insecure --backtitle " $myBACKTITLE " \
2017-09-26 15:15:17 +00:00
--title "[ Repeat password for your web user ]" \
--passwordbox "\nPassword" 9 60 3>& 1 1>& 2 2>& 3 3>& -)
2018-06-21 15:16:33 +00:00
if [ " $myCONF_WEB_PW " != " $myCONF_WEB_PW2 " ] ;
2017-09-26 15:15:17 +00:00
then
2019-02-12 15:56:43 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Passwords do not match. ]" \
2018-06-21 15:16:33 +00:00
--msgbox "\nPlease re-enter your password." 7 60
myCONF_WEB_PW = "pass1"
myCONF_WEB_PW2 = "pass2"
2017-09-26 15:15:17 +00:00
fi
2018-06-21 15:16:33 +00:00
mySECURE = $( printf "%s" " $myCONF_WEB_PW " | cracklib-check | grep -c "OK" )
if [ " $mySECURE " = = "0" ] && [ " $myCONF_WEB_PW " = = " $myCONF_WEB_PW2 " ] ;
then
2019-02-12 15:56:43 +00:00
dialog --keep-window --backtitle " $myBACKTITLE " --title "[ Password is not secure ]" --defaultno --yesno "\nKeep insecure password?" 7 50
2018-06-21 15:16:33 +00:00
myOK = $?
if [ " $myOK " = = "1" ] ;
then
myCONF_WEB_PW = "pass1"
myCONF_WEB_PW2 = "pass2"
fi
fi
done
fi
2017-09-26 15:15:17 +00:00
2019-02-13 12:33:53 +00:00
dialog --clear
2018-06-21 15:16:33 +00:00
2019-02-18 16:45:31 +00:00
##########################
# VI. Installation phase #
##########################
2018-06-22 14:57:38 +00:00
2019-02-15 09:27:42 +00:00
exec 2> >( tee "/install.err" )
exec > >( tee "/install.log" )
fuBANNER "Installing ..."
2019-02-13 12:33:53 +00:00
2019-02-19 08:14:13 +00:00
fuGET_DEPS
2019-02-18 16:45:31 +00:00
# If flavor is SENSOR do not write credentials
if ! [ " $myCONF_TPOT_FLAVOR " = = "SENSOR" ] ;
then
fuBANNER "Webuser creds"
mkdir -p /data/nginx/conf
htpasswd -b -c /data/nginx/conf/nginxpasswd " $myCONF_WEB_USER " " $myCONF_WEB_PW "
2019-02-19 10:22:09 +00:00
echo
2019-02-18 16:45:31 +00:00
fi
2018-06-21 15:16:33 +00:00
# Let's generate a SSL self-signed certificate without interaction (browsers will see it invalid anyway)
if ! [ " $myCONF_TPOT_FLAVOR " = = "SENSOR" ] ;
2018-06-24 00:59:28 +00:00
then
2019-02-13 12:33:53 +00:00
fuBANNER "NGINX Certificate"
2019-12-27 14:53:07 +00:00
myINTIP = $( hostname -I | awk '{ print $1 }' )
2019-02-13 12:33:53 +00:00
mkdir -p /data/nginx/cert
openssl req \
-nodes \
-x509 \
-sha512 \
-newkey rsa:8192 \
-keyout "/data/nginx/cert/nginx.key" \
-out "/data/nginx/cert/nginx.crt" \
-days 3650 \
2020-01-02 08:40:55 +00:00
-subj '/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd' \
2019-12-27 14:53:07 +00:00
-addext " subjectAltName = IP: $myINTIP "
2018-06-21 15:16:33 +00:00
fi
2017-09-26 15:15:17 +00:00
# Let's setup the ntp server
2018-06-15 16:24:20 +00:00
if [ " $myCONF_NTP_USE " = = "0" ] ;
2017-09-26 15:15:17 +00:00
then
2019-02-13 12:33:53 +00:00
fuBANNER "Setup NTP"
cp $myCONF_NTP_CONF_FILE /etc/ntp.conf
2017-09-26 15:15:17 +00:00
fi
# Let's setup 802.1x networking
2019-01-28 20:52:55 +00:00
if [ "myCONF_PFX_USE" = = "0" ] ;
then
2019-02-13 12:33:53 +00:00
fuBANNER "Setup 802.1x"
cp $myCONF_PFX_FILE /etc/wpa_supplicant/
2019-02-15 09:27:42 +00:00
echo " $myNETWORK_INTERFACES " | tee -a /etc/network/interfaces
echo " $myNETWORK_WIRED8021x " | tee /etc/wpa_supplicant/wired8021x.conf
echo " $myNETWORK_WLAN8021x " | tee /etc/wpa_supplicant/wireless8021x.conf
2019-01-28 20:52:55 +00:00
fi
2017-09-26 15:15:17 +00:00
# Let's provide a wireless example config ...
2019-02-13 12:33:53 +00:00
fuBANNER "Example config"
2019-02-15 09:27:42 +00:00
echo " $myNETWORK_WLANEXAMPLE " | tee -a /etc/network/interfaces
2017-09-26 15:15:17 +00:00
# Let's make sure SSH roaming is turned off (CVE-2016-0777, CVE-2016-0778)
2019-02-13 12:33:53 +00:00
fuBANNER "SSH roaming off"
2019-02-15 09:27:42 +00:00
echo "UseRoaming no" | tee -a /etc/ssh/ssh_config
2017-09-26 15:15:17 +00:00
2019-02-15 15:13:15 +00:00
# Installing elasticdump, yq
2019-02-13 16:09:23 +00:00
fuBANNER "Installing pkgs"
2020-03-15 21:24:01 +00:00
npm install elasticdump -g
2020-03-04 12:12:12 +00:00
pip3 install yq
2019-10-28 14:37:10 +00:00
hash -r
2019-02-13 12:33:53 +00:00
# Cloning T-Pot from GitHub
fuBANNER "Cloning T-Pot"
2020-03-16 15:01:18 +00:00
git clone https://github.com/dtag-dev-sec/tpotce /opt/tpot
2017-09-28 20:00:51 +00:00
2018-06-21 15:16:33 +00:00
# Let's create the T-Pot user
2019-02-13 12:33:53 +00:00
fuBANNER "Create user"
addgroup --gid 2000 tpot
adduser --system --no-create-home --uid 2000 --disabled-password --disabled-login --gid 2000 tpot
2017-09-26 15:15:17 +00:00
# Let's set the hostname
a = $( fuRANDOMWORD /opt/tpot/host/usr/share/dict/a.txt)
n = $( fuRANDOMWORD /opt/tpot/host/usr/share/dict/n.txt)
myHOST = $a $n
2019-02-13 12:33:53 +00:00
fuBANNER "Set hostname"
hostnamectl set-hostname $myHOST
sed -i 's#127.0.1.1.*#127.0.1.1\t' " $myHOST " '#g' /etc/hosts
2017-09-26 15:15:17 +00:00
2019-05-12 01:14:52 +00:00
# Prevent cloud-init from overwriting our new hostname
if [ -f '/etc/cloud/cloud.cfg' ] ; then
sed -i 's/preserve_hostname.*/preserve_hostname: true/g' /etc/cloud/cloud.cfg
fi
2018-06-23 21:23:33 +00:00
# Let's patch cockpit.socket, sshd_config
2019-02-13 16:09:23 +00:00
fuBANNER "Adjust ports"
2019-02-25 10:52:24 +00:00
mkdir -p /etc/systemd/system/cockpit.socket.d
echo " $myCOCKPIT_SOCKET " | tee /etc/systemd/system/cockpit.socket.d/listen.conf
2019-02-13 12:33:53 +00:00
sed -i '/^port/Id' /etc/ssh/sshd_config
2019-04-06 09:31:23 +00:00
echo " $mySSHPORT " | tee -a /etc/ssh/sshd_config
2017-09-26 15:15:17 +00:00
2019-02-19 09:01:38 +00:00
# Do not allow root login for cockpit
sed -i '2i\auth requisite pam_succeed_if.so uid >= 1000' /etc/pam.d/cockpit
2018-06-20 16:29:18 +00:00
# Let's make sure only myCONF_TPOT_FLAVOR images will be downloaded and started
case $myCONF_TPOT_FLAVOR in
2018-06-11 14:43:36 +00:00
STANDARD)
2019-02-15 13:11:45 +00:00
fuBANNER "STANDARD"
2019-02-15 09:27:42 +00:00
ln -s /opt/tpot/etc/compose/standard.yml $myTPOTCOMPOSE
2018-03-29 21:27:20 +00:00
; ;
2018-06-11 14:43:36 +00:00
SENSOR)
2019-02-15 13:11:45 +00:00
fuBANNER "SENSOR"
2019-02-15 09:27:42 +00:00
ln -s /opt/tpot/etc/compose/sensor.yml $myTPOTCOMPOSE
2017-09-26 15:15:17 +00:00
; ;
INDUSTRIAL)
2019-02-15 13:11:45 +00:00
fuBANNER "INDUSTRIAL"
2019-02-15 09:27:42 +00:00
ln -s /opt/tpot/etc/compose/industrial.yml $myTPOTCOMPOSE
2017-09-26 15:15:17 +00:00
; ;
2018-06-11 14:43:36 +00:00
COLLECTOR)
2019-02-15 13:11:45 +00:00
fuBANNER "COLLECTOR"
2019-02-15 09:27:42 +00:00
ln -s /opt/tpot/etc/compose/collector.yml $myTPOTCOMPOSE
2018-06-11 14:43:36 +00:00
; ;
2018-11-23 22:30:25 +00:00
NEXTGEN)
2019-02-15 13:11:45 +00:00
fuBANNER "NEXTGEN"
2019-02-15 09:27:42 +00:00
ln -s /opt/tpot/etc/compose/nextgen.yml $myTPOTCOMPOSE
2017-09-26 15:15:17 +00:00
; ;
esac
2019-08-02 21:33:25 +00:00
# Let's load docker images
2018-06-29 22:16:32 +00:00
function fuPULLIMAGES {
2018-06-24 00:38:41 +00:00
for name in $( cat $myTPOTCOMPOSE | grep -v '#' | grep image | cut -d'"' -f2 | uniq)
2017-09-26 15:15:17 +00:00
do
2019-08-02 21:33:25 +00:00
docker pull $name
2018-06-29 22:16:32 +00:00
done
}
2019-02-13 12:33:53 +00:00
fuBANNER "Pull images"
fuPULLIMAGES
2017-09-26 15:15:17 +00:00
# Let's add the daily update check with a weekly clean interval
2019-02-13 16:09:23 +00:00
fuBANNER "Modify checks"
2019-02-13 12:33:53 +00:00
echo " $myUPDATECHECK " | tee /etc/apt/apt.conf.d/10periodic
2017-09-26 15:15:17 +00:00
# Let's make sure to reboot the system after a kernel panic
2019-02-13 16:09:23 +00:00
fuBANNER "Tweak sysctl"
2019-02-13 12:33:53 +00:00
echo " $mySYSCTLCONF " | tee -a /etc/sysctl.conf
2017-09-26 15:15:17 +00:00
2018-06-22 16:14:39 +00:00
# Let's setup fail2ban config
2019-02-13 12:33:53 +00:00
fuBANNER "Setup fail2ban"
echo " $myFAIL2BANCONF " | tee /etc/fail2ban/jail.d/tpot.conf
2018-06-22 16:14:39 +00:00
2018-06-26 14:42:31 +00:00
# Fix systemd error https://github.com/systemd/systemd/issues/3374
2019-02-13 12:33:53 +00:00
fuBANNER "Systemd fix"
echo " $mySYSTEMDFIX " | tee /etc/systemd/network/99-default.link
2018-06-26 14:42:31 +00:00
2017-09-26 15:15:17 +00:00
# Let's add some cronjobs
2019-02-15 09:27:42 +00:00
fuBANNER "Add cronjobs"
2019-02-13 12:33:53 +00:00
echo " $myCRONJOBS " | tee -a /etc/crontab
2017-09-26 15:15:17 +00:00
# Let's create some files and folders
2019-02-13 16:09:23 +00:00
fuBANNER "Files & folders"
2018-12-05 16:59:08 +00:00
mkdir -p /data/adbhoney/downloads /data/adbhoney/log \
/data/ciscoasa/log \
2020-01-15 12:14:23 +00:00
/data/citrixhoneypot/logs \
2019-02-18 16:45:31 +00:00
/data/conpot/log \
2017-09-26 15:15:17 +00:00
/data/cowrie/log/tty/ /data/cowrie/downloads/ /data/cowrie/keys/ /data/cowrie/misc/ \
/data/dionaea/log /data/dionaea/bistreams /data/dionaea/binaries /data/dionaea/rtp /data/dionaea/roots/ftp /data/dionaea/roots/tftp /data/dionaea/roots/www /data/dionaea/roots/upnp \
/data/elasticpot/log \
/data/elk/data /data/elk/log \
2019-06-01 17:47:14 +00:00
/data/fatt/log \
2018-08-29 10:28:55 +00:00
/data/honeytrap/log/ /data/honeytrap/attacks/ /data/honeytrap/downloads/ \
2019-02-25 10:52:24 +00:00
/data/glutton/log \
/data/heralding/log \
2019-03-10 18:15:59 +00:00
/data/honeypy/log \
2017-09-26 15:15:17 +00:00
/data/mailoney/log \
2018-09-09 18:38:47 +00:00
/data/medpot/log \
2020-01-27 17:03:44 +00:00
/data/nginx/log /data/nginx/heimdall \
2017-09-26 15:15:17 +00:00
/data/emobility/log \
/data/ews/conf \
/data/rdpy/log \
/data/spiderfoot \
/data/suricata/log /home/tsec/.ssh/ \
2019-02-18 16:45:31 +00:00
/data/tanner/log /data/tanner/files \
2019-02-13 12:33:53 +00:00
/data/p0f/log
touch /data/spiderfoot/spiderfoot.db
touch /data/nginx/log/error.log
2017-09-26 15:15:17 +00:00
# Let's copy some files
2019-02-13 12:33:53 +00:00
fuBANNER "Copy configs"
tar xvfz /opt/tpot/etc/objects/elkbase.tgz -C /
cp /opt/tpot/host/etc/systemd/* /etc/systemd/system/
systemctl enable tpot
2017-09-26 15:15:17 +00:00
# Let's take care of some files and permissions
2019-02-13 16:09:23 +00:00
fuBANNER "Permissions"
2019-05-08 11:16:48 +00:00
chmod 770 -R /data
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "iso" ] ;
then
usermod -a -G tpot tsec
2019-12-27 19:45:38 +00:00
chown tsec:tsec -R /home/tsec/.ssh
2019-05-08 11:16:48 +00:00
else
usermod -a -G tpot $( who am i | awk '{ print $1 }' )
fi
2019-02-13 12:33:53 +00:00
chown tpot:tpot -R /data
chmod 644 -R /data/nginx/conf
chmod 644 -R /data/nginx/cert
2017-09-26 15:15:17 +00:00
# Let's replace "quiet splash" options, set a console font for more screen canvas and update grub
2019-02-13 16:09:23 +00:00
fuBANNER "Options"
2019-02-13 12:33:53 +00:00
sed -i 's#GRUB_CMDLINE_LINUX_DEFAULT="quiet"#GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=0"#' /etc/default/grub
sed -i 's#GRUB_CMDLINE_LINUX=""#GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"#' /etc/default/grub
2019-02-15 09:27:42 +00:00
update-grub
2019-02-13 12:33:53 +00:00
fuBANNER "Setup console"
2017-09-26 15:15:17 +00:00
cp /usr/share/consolefonts/Uni2-Terminus12x6.psf.gz /etc/console-setup/
gunzip /etc/console-setup/Uni2-Terminus12x6.psf.gz
sed -i 's#FONTFACE=".*#FONTFACE="Terminus"#' /etc/default/console-setup
sed -i 's#FONTSIZE=".*#FONTSIZE="12x6"#' /etc/default/console-setup
2019-02-13 12:33:53 +00:00
update-initramfs -u
sed -i 's#After=.*#After=systemd-tmpfiles-setup.service console-screen.service kbd.service local-fs.target#' /etc/systemd/system/multi-user.target.wants/console-setup.service
2017-09-26 15:15:17 +00:00
# Let's enable a color prompt and add /opt/tpot/bin to path
2019-02-13 16:09:23 +00:00
fuBANNER "Setup prompt"
2019-02-13 12:33:53 +00:00
tee -a /root/.bashrc <<EOF
2019-09-19 19:32:15 +00:00
$mySHELLCHECK
2017-09-26 15:15:17 +00:00
$myROOTPROMPT
2019-01-30 14:18:25 +00:00
$myROOTCOLORS
2017-09-26 15:15:17 +00:00
PATH = " $PATH :/opt/tpot/bin "
EOF
2018-11-01 14:42:16 +00:00
for i in $( ls -d /home/*/)
do
2019-02-13 12:33:53 +00:00
tee -a $i .bashrc <<EOF
2019-09-24 14:00:31 +00:00
$mySHELLCHECK
2017-09-26 15:15:17 +00:00
$myUSERPROMPT
PATH = " $PATH :/opt/tpot/bin "
EOF
2018-11-01 14:42:16 +00:00
done
2017-09-26 15:15:17 +00:00
# Let's create ews.ip before reboot and prevent race condition for first start
2019-02-13 12:33:53 +00:00
fuBANNER "Update IP"
/opt/tpot/bin/updateip.sh
2017-09-26 15:15:17 +00:00
2018-06-21 15:16:33 +00:00
# Let's clean up apt
2019-02-13 12:33:53 +00:00
fuBANNER "Clean up"
2019-04-04 06:55:59 +00:00
apt-fast autoclean -y
apt-fast autoremove -y
2018-06-21 15:16:33 +00:00
2017-09-26 15:15:17 +00:00
# Final steps
2019-02-15 09:27:42 +00:00
cp /opt/tpot/host/etc/rc.local /etc/rc.local && \
rm -rf /root/installer && \
rm -rf /etc/issue.d/cockpit.issue && \
rm -rf /etc/motd.d/cockpit && \
rm -rf /etc/issue.net && \
rm -rf /etc/motd && \
2019-02-15 13:57:41 +00:00
systemctl restart console-setup.service
2018-10-29 17:05:02 +00:00
if [ " $myTPOT_DEPLOYMENT_TYPE " = = "auto" ] ;
then
echo "Done. Please reboot."
else
2019-02-15 13:57:41 +00:00
fuBANNER "Rebooting ..."
2019-02-15 14:10:18 +00:00
sleep 2
2018-10-29 17:05:02 +00:00
reboot
fi