prepare for wetty docker image

This commit is contained in:
Marco Ochse 2018-02-19 16:47:59 +01:00
parent 76dc360641
commit 50fab2207c
10 changed files with 71 additions and 19 deletions

View file

@ -8,6 +8,7 @@ if [ "$myEXTIP" = "" ];
then then
myEXTIP=$myLOCALIP myEXTIP=$myLOCALIP
fi fi
mySSHUSER=$(cat /etc/passwd | grep 1000 | cut -d ':' -f1)
sed -i "s#IP:.*#IP: $myLOCALIP ($myEXTIP)#" /etc/issue 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#SSH:.*#SSH: ssh -l tsec -p 64295 $myLOCALIP#" /etc/issue
sed -i "s#WEB:.*#WEB: https://$myLOCALIP:64297#" /etc/issue sed -i "s#WEB:.*#WEB: https://$myLOCALIP:64297#" /etc/issue
@ -20,5 +21,8 @@ MY_EXTIP=$myEXTIP
MY_INTIP=$myLOCALIP MY_INTIP=$myLOCALIP
MY_HOSTNAME=$HOSTNAME MY_HOSTNAME=$HOSTNAME
EOF EOF
tee /opt/tpot/etc/compose/wetty_environment << EOF
MY_SSHUSER=$mySSHUSER
EOF
chown tpot:tpot /data/ews/conf/ews.ip chown tpot:tpot /data/ews/conf/ews.ip
chmod 760 /data/ews/conf/ews.ip chmod 760 /data/ews/conf/ews.ip

View file

@ -15,7 +15,7 @@
<a href="/netdata/" target="_blank" class="btn">Netdata</a> <a href="/netdata/" target="_blank" class="btn">Netdata</a>
<a href="/spiderfoot/" target="main" class="btn">Spiderfoot</a> <a href="/spiderfoot/" target="main" class="btn">Spiderfoot</a>
<a href="/ui/" target="main" class="btn">Portainer</a> <a href="/ui/" target="main" class="btn">Portainer</a>
<a href="/wetty/ssh/tsec" target="main" class="btn">WebTTY</a> <a href="/wetty/" target="main" class="btn">WebTTY</a>
</center> </center>
</body> </body>
</html> </html>

23
docker/wetty/Dockerfile Normal file
View file

@ -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

View file

@ -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"

View file

@ -325,3 +325,12 @@ services:
image: "dtagdevsec/vnclowpot:1710" image: "dtagdevsec/vnclowpot:1710"
volumes: volumes:
- /data/vnclowpot/log:/var/log/vnclowpot - /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"

View file

@ -189,3 +189,12 @@ services:
image: "dtagdevsec/p0f:1710" image: "dtagdevsec/p0f:1710"
volumes: volumes:
- /data/p0f/log:/var/log/p0f - /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"

View file

@ -295,3 +295,12 @@ services:
image: "dtagdevsec/vnclowpot:1710" image: "dtagdevsec/vnclowpot:1710"
volumes: volumes:
- /data/vnclowpot/log:/var/log/vnclowpot - /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"

View file

@ -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

View file

@ -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 autoclean -y 2>&1 | dialog --title "[ Pulling updates ]" $myPROGRESSBOXCONF
apt-get autoremove -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 --upgrade pip 2>&1 | dialog --title "[ Installing pip ]" $myPROGRESSBOXCONF
pip install elasticsearch-curator==5.4.1 2>&1 | dialog --title "[ Installing elasticsearch-curator ]" $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 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 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 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 /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 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 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 # Let's take care of some files and permissions
chmod 760 -R /data 2>&1 | dialog --title "[ Set permissions and ownerships ]" $myPROGRESSBOXCONF chmod 760 -R /data 2>&1 | dialog --title "[ Set permissions and ownerships ]" $myPROGRESSBOXCONF

View file

@ -101,7 +101,7 @@ tasksel tasksel/first multiselect ubuntu-server
######################## ########################
### Package Installation ### 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 ### Update Policy