diff --git a/installer/bin/check.sh b/installer/bin/check.sh index 850e0f84..7bffbde3 100755 --- a/installer/bin/check.sh +++ b/installer/bin/check.sh @@ -4,7 +4,7 @@ # T-Pot Community Edition # # Check container and services script # # # -# v0.13 by mo, DTAG, 2015-06-12 # +# v0.14 by mo, DTAG, 2015-08-07 # ######################################################## if [ -a /var/run/check.lock ]; then exit diff --git a/installer/bin/dcres.sh b/installer/bin/dcres.sh index 35c4fb0c..196aeaaf 100755 --- a/installer/bin/dcres.sh +++ b/installer/bin/dcres.sh @@ -4,7 +4,7 @@ # T-Pot Community Edition # # Container and services restart script # # # -# v0.13 by mo, DTAG, 2015-02-19 # +# v0.14 by mo, DTAG, 2015-08-07 # ######################################################## if [ -a /var/run/check.lock ]; diff --git a/installer/bin/status.sh b/installer/bin/status.sh index a12690f8..a3c8781f 100755 --- a/installer/bin/status.sh +++ b/installer/bin/status.sh @@ -9,7 +9,7 @@ myCOUNT=1 myIMAGES=$(cat /data/images.conf) while true -do +do if ! [ -a /var/run/check.lock ]; then break fi @@ -33,7 +33,7 @@ echo "****************** $(date) ******************" echo echo for i in $myIMAGES -do +do echo echo "======| Container:" $i "|======" docker exec $i supervisorctl status | GREP_COLORS='mt=01;32' egrep --color=always "(RUNNING)|$" | GREP_COLORS='mt=01;31' egrep --color=always "(STOPPED|FATAL)|$" diff --git a/installer/upstart/dionaea.conf b/installer/upstart/dionaea.conf index aaaa2fbb..76f47380 100644 --- a/installer/upstart/dionaea.conf +++ b/installer/upstart/dionaea.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # Dionaea upstart script # # # -# v0.50 by mo, DTAG, 2015-01-27 # +# v0.51 by mo, DTAG, 2015-08-07 # ######################################################## description "Dionaea" diff --git a/installer/upstart/elk.conf b/installer/upstart/elk.conf index 9d82aa9d..3d65f35e 100644 --- a/installer/upstart/elk.conf +++ b/installer/upstart/elk.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # ELK upstart script # # # -# v0.52 by mo, DTAG, 2015-02-20 # +# v0.53 by mo, DTAG, 2015-08-07 # ######################################################## description "ELK" diff --git a/installer/upstart/ews.conf b/installer/upstart/ews.conf index ac6c9ef1..5ecc4437 100644 --- a/installer/upstart/ews.conf +++ b/installer/upstart/ews.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # EWS upstart script # # # -# v0.51 by mo, DTAG, 2015-01-28 # +# v0.52 by mo, DTAG, 2015-08-07 # ######################################################## description "EWS" diff --git a/installer/upstart/glastopf.conf b/installer/upstart/glastopf.conf index f17e7dfa..bc851eb0 100644 --- a/installer/upstart/glastopf.conf +++ b/installer/upstart/glastopf.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # Glastopf upstart script # # # -# v0.50 by mo, DTAG, 2015-01-27 # +# v0.51 by mo, DTAG, 2015-08-07 # ######################################################## description "Glastopf" diff --git a/installer/upstart/honeytrap.conf b/installer/upstart/honeytrap.conf index 20955e0e..10bd7478 100644 --- a/installer/upstart/honeytrap.conf +++ b/installer/upstart/honeytrap.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # Honeytrap upstart script # # # -# v0.50 by mo, DTAG, 2015-01-27 # +# v0.51 by mo, DTAG, 2015-08-07 # ######################################################## description "Honeytrap" diff --git a/installer/upstart/kippo.conf b/installer/upstart/kippo.conf index c48aec0e..8ed912a4 100644 --- a/installer/upstart/kippo.conf +++ b/installer/upstart/kippo.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # Kippo upstart script # # # -# v0.50 by mo, DTAG, 2015-01-27 # +# v0.51 by mo, DTAG, 2015-08-07 # ######################################################## description "Kippo" diff --git a/installer/upstart/suricata.conf b/installer/upstart/suricata.conf index 3f5550ba..4d5012bf 100644 --- a/installer/upstart/suricata.conf +++ b/installer/upstart/suricata.conf @@ -2,7 +2,7 @@ # T-Pot Community Edition # # Suricata upstart script # # # -# v0.50 by mo, DTAG, 2015-01-27 # +# v0.51 by mo, DTAG, 2015-08-07 # ######################################################## description "Suricata" diff --git a/tpot-volume-bugfix.sh b/tpot-volume-bugfix.sh new file mode 100755 index 00000000..f41a4d7f --- /dev/null +++ b/tpot-volume-bugfix.sh @@ -0,0 +1,54 @@ +!/bin/bash +######################################################## +# T-Pot Community Edition # +# Volume bug fix script # +# # +# v0.01 by mo, DTAG, 2015-08-07 # +######################################################## +myFIXPATH="/tpot-volume-fix" +myLOCK="/var/run/check.lock" +myIMAGECONFPATH="/data/images.conf" + +# Let's set check.lock to prevent the check scripts from execution +touch $myLOCK + +# Since there are different versions out there let's update to the latest version first +apt-get update -y +apt-get upgrade -y +apt-get install lxc-docker -y + +# Let's stop all docker and t-pot related services +for i in $(cat $myIMAGECONFPATH); do service $i stop; done +service docker stop + +# Let's create a tmp and move some configs to prevent unwanted intervention +mkdir $myFIXPATH +for i in $(cat $myIMAGECONFPATH); do mv /etc/init/$i.conf $myFIXPATH; done +mv /etc/crontab $myFIXPATH + +# Let's remove docker and all associated files +apt-get purge lxc-docker -y +apt-get autoremove -y +rm -rf /var/lib/docker/ +rm -rf /var/run/docker/ + +# Let's reinstall docker again +apt-get install lxc-docker -y + +# Let's pull the images +for i in $(cat $myIMAGECONFPATH); do /usr/bin/docker pull dtagdevsec/$i:latest; done + +# Let's clone the tpotce repo and replace the buggy configs +git clone https://github.com/dtag-dev-sec/tpotce.git $myFIXPATH/tpotce/ +cp $myFIXPATH/tpotce/installer/bin/check.sh /usr/bin/ +cp $myFIXPATH/tpotce/installer/bin/dcres.sh /usr/bin/ +for i in $(cat $myIMAGECONFPATH); do cp $myFIXPATH/tpotce/installer/upstart/$i.conf /etc/init/; done +cp $myFIXPATH/crontab /etc/ + +# Let's remove the check.lock and allow scripts to execute again +rm $myLOCK + +# Let's start the services again +for i in $(cat $myIMAGECONFPATH); do service $i start && sleep 2; done +sleep 10 +status.sh