diff --git a/bin/updateip.sh b/bin/updateip.sh index fb9ff9cd..b7d8080d 100755 --- a/bin/updateip.sh +++ b/bin/updateip.sh @@ -8,6 +8,7 @@ if [ "$myEXTIP" = "" ]; then myEXTIP=$myLOCALIP fi +mySSHUSER=$(cat /etc/passwd | grep 1000 | cut -d ':' -f1) sed -i "s#IP:.*#IP: $myLOCALIP ($myEXTIP)#" /etc/issue sed -i "s#SSH:.*#SSH: ssh -l tsec -p 64295 $myLOCALIP#" /etc/issue sed -i "s#WEB:.*#WEB: https://$myLOCALIP:64297#" /etc/issue @@ -20,5 +21,8 @@ MY_EXTIP=$myEXTIP MY_INTIP=$myLOCALIP MY_HOSTNAME=$HOSTNAME EOF +tee /opt/tpot/etc/compose/wetty_environment << EOF +MY_SSHUSER=$mySSHUSER +EOF chown tpot:tpot /data/ews/conf/ews.ip chmod 760 /data/ews/conf/ews.ip diff --git a/docker/nginx/dist/html/navbar.html b/docker/nginx/dist/html/navbar.html index d3b311a8..e3954f74 100644 --- a/docker/nginx/dist/html/navbar.html +++ b/docker/nginx/dist/html/navbar.html @@ -15,7 +15,7 @@ Netdata Spiderfoot Portainer - WebTTY + WebTTY diff --git a/docker/wetty/Dockerfile b/docker/wetty/Dockerfile new file mode 100644 index 00000000..326e16ec --- /dev/null +++ b/docker/wetty/Dockerfile @@ -0,0 +1,23 @@ +FROM alpine +MAINTAINER MO + +# Setup env and apt +RUN apk -U upgrade && \ + apk add bash build-base git nodejs nodejs-npm openssh-client python procps && \ + +# Setup user + addgroup -g 2000 wetty && \ + adduser -S -s /bin/bash -u 2000 -D -g 2000 wetty && \ + +# Get and install packages + mkdir -p /app/ && \ + cd /app/ && \ + npm install https://github.com/t3chn0m4g3/wetty && \ + +# Clean up + apk del build-base git nodejs-npm python + +# Start elasticsearch-head +WORKDIR /app +USER wetty +CMD /usr/bin/node /app/node_modules/wetty/app.js -p 64300 --host 127.0.0.1 --sshhost 127.0.0.1 --sshport 64295 --sshuser $MY_SSHUSER diff --git a/docker/wetty/docker-compose.yml b/docker/wetty/docker-compose.yml new file mode 100644 index 00000000..a9ad4e5b --- /dev/null +++ b/docker/wetty/docker-compose.yml @@ -0,0 +1,14 @@ +# T-Pot (Standard) +# For docker-compose ... +version: '2.2' + +services: + +# Wetty service + wetty: + container_name: wetty + restart: always + network_mode: "host" + env_file: + - /opt/tpot/etc/compose/wetty_environment + image: "dtagdevsec/wetty:1710" diff --git a/etc/compose/all.yml b/etc/compose/all.yml index 93bc8b16..33581fae 100644 --- a/etc/compose/all.yml +++ b/etc/compose/all.yml @@ -325,3 +325,12 @@ services: image: "dtagdevsec/vnclowpot:1710" volumes: - /data/vnclowpot/log:/var/log/vnclowpot + +# Wetty service + wetty: + container_name: wetty + restart: always + network_mode: "host" + env_file: + - /opt/tpot/etc/compose/wetty_environment + image: "dtagdevsec/wetty:1710" diff --git a/etc/compose/industrial.yml b/etc/compose/industrial.yml index 6ad66cb3..03d17ccf 100644 --- a/etc/compose/industrial.yml +++ b/etc/compose/industrial.yml @@ -189,3 +189,12 @@ services: image: "dtagdevsec/p0f:1710" volumes: - /data/p0f/log:/var/log/p0f + +# Wetty service + wetty: + container_name: wetty + restart: always + network_mode: "host" + env_file: + - /opt/tpot/etc/compose/wetty_environment + image: "dtagdevsec/wetty:1710" diff --git a/etc/compose/tpot.yml b/etc/compose/tpot.yml index cbf6a00f..8fa5021e 100644 --- a/etc/compose/tpot.yml +++ b/etc/compose/tpot.yml @@ -295,3 +295,12 @@ services: image: "dtagdevsec/vnclowpot:1710" volumes: - /data/vnclowpot/log:/var/log/vnclowpot + +# Wetty service + wetty: + container_name: wetty + restart: always + network_mode: "host" + env_file: + - /opt/tpot/etc/compose/wetty_environment + image: "dtagdevsec/wetty:1710" diff --git a/host/etc/systemd/wetty.service b/host/etc/systemd/wetty.service deleted file mode 100644 index 5f6b9717..00000000 --- a/host/etc/systemd/wetty.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=wetty -Requires=sshd.service -After=sshd.service - -[Service] -Restart=always -User=tsec -Group=tsec -ExecStart=/usr/bin/node /usr/local/lib/node_modules/wetty/app.js -p 64300 --host 127.0.0.1 --sshhost 127.0.0.1 --sshport 64295 - -[Install] -WantedBy=multi-user.target diff --git a/iso/installer/install.sh b/iso/installer/install.sh index ecfb6b72..4212da99 100755 --- a/iso/installer/install.sh +++ b/iso/installer/install.sh @@ -322,11 +322,9 @@ apt-get upgrade -y 2>&1 | dialog --title "[ Pulling updates ]" $myPROGRESSBOXCON apt-get autoclean -y 2>&1 | dialog --title "[ Pulling updates ]" $myPROGRESSBOXCONF apt-get autoremove -y 2>&1 | dialog --title "[ Pulling updates ]" $myPROGRESSBOXCONF -# Installing wetty, ctop, elasticdump, tpot +# Installing ctop, elasticdump, tpot pip install --upgrade pip 2>&1 | dialog --title "[ Installing pip ]" $myPROGRESSBOXCONF pip install elasticsearch-curator==5.4.1 2>&1 | dialog --title "[ Installing elasticsearch-curator ]" $myPROGRESSBOXCONF -ln -s /usr/bin/nodejs /usr/bin/node 2>&1 | dialog --title "[ Installing wetty ]" $myPROGRESSBOXCONF -npm install https://github.com/t3chn0m4g3/wetty -g 2>&1 | dialog --title "[ Installing wetty ]" $myPROGRESSBOXCONF npm install https://github.com/taskrabbit/elasticsearch-dump#ac9f62a -g 2>&1 | dialog --title "[ Installing elasticsearch-dump ]" $myPROGRESSBOXCONF wget https://github.com/bcicen/ctop/releases/download/v0.7/ctop-0.7-linux-amd64 -O ctop 2>&1 | dialog --title "[ Installing ctop ]" $myPROGRESSBOXCONF mv ctop /usr/bin/ 2>&1 | dialog --title "[ Installing ctop ]" $myPROGRESSBOXCONF @@ -458,7 +456,6 @@ cp /opt/tpot/host/etc/systemd/* /etc/systemd/system/ 2>&1 | dialog --title "[ cp /opt/tpot/host/etc/issue /etc/ 2>&1 | dialog --title "[ Copy configs ]" $myPROGRESSBOXCONF cp /root/installer/keys/authorized_keys /home/tsec/.ssh/authorized_keys 2>&1 | dialog --title "[ Copy configs ]" $myPROGRESSBOXCONF systemctl enable tpot 2>&1 | dialog --title "[ Enabling service for tpot ]" $myPROGRESSBOXCONF -systemctl enable wetty 2>&1 | dialog --title "[ Enabling service for wetty ]" $myPROGRESSBOXCONF # Let's take care of some files and permissions chmod 760 -R /data 2>&1 | dialog --title "[ Set permissions and ownerships ]" $myPROGRESSBOXCONF diff --git a/iso/preseed/tpot.seed b/iso/preseed/tpot.seed index 4b8f8a46..3f80f3b4 100755 --- a/iso/preseed/tpot.seed +++ b/iso/preseed/tpot.seed @@ -101,7 +101,7 @@ tasksel tasksel/first multiselect ubuntu-server ######################## ### Package Installation ######################## -d-i pkgsel/include string apache2-utils apparmor apt-transport-https aufs-tools bash-completion build-essential ca-certificates cgroupfs-mount curl dialog dnsutils docker.io docker-compose dstat ethtool genisoimage git glances html2text htop iptables iw jq libcrack2 libltdl7 lm-sensors man nodejs npm ntp openssh-server openssl prips syslinux psmisc pv python-pip unzip vim wireless-tools wpasupplicant +d-i pkgsel/include string apache2-utils apparmor apt-transport-https aufs-tools bash-completion build-essential ca-certificates cgroupfs-mount curl dialog dnsutils docker.io docker-compose dstat ethtool genisoimage git glances html2text htop iptables iw jq libcrack2 libltdl7 lm-sensors man ntp openssh-server openssl prips syslinux psmisc pv python-pip unzip vim wireless-tools wpasupplicant ################# ### Update Policy