mirror of
https://github.com/telekom-security/tpotce.git
synced 2026-03-11 02:43:19 +00:00
Compare commits
16 commits
895762540b
...
9857363c90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9857363c90 | ||
|
|
7a4c4bc997 | ||
|
|
cbcf7871ec | ||
|
|
c38fab7670 | ||
|
|
444b181075 | ||
|
|
59c6672df7 | ||
|
|
87733c6b65 | ||
|
|
f609e20567 | ||
|
|
78acb5f5c0 | ||
|
|
99abefe98e | ||
|
|
82147ba4bd | ||
|
|
a7af16f69a | ||
|
|
5e333eba59 | ||
|
|
c2748f9904 | ||
|
|
d94207e56e | ||
|
|
cb8933cddb |
3 changed files with 54 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
FROM alpine:3.20
|
FROM alpine:3.23
|
||||||
#
|
#
|
||||||
# Install packages
|
# Install packages
|
||||||
RUN apk --no-cache -U upgrade && \
|
RUN apk --no-cache -U upgrade && \
|
||||||
|
|
@ -14,8 +14,9 @@ RUN apk --no-cache -U upgrade && \
|
||||||
# Install from GitHub and setup
|
# Install from GitHub and setup
|
||||||
mkdir -p /opt && \
|
mkdir -p /opt && \
|
||||||
cd /opt/ && \
|
cd /opt/ && \
|
||||||
git clone https://github.com/t3chn0m4g3/t-pot-attack-map -b 2.2.7 && \
|
git clone https://github.com/t3chn0m4g3/t-pot-attack-map -b 3.0.0 && \
|
||||||
cd t-pot-attack-map && \
|
cd t-pot-attack-map && \
|
||||||
|
mv DataServer.py DataServer_v2.py && \
|
||||||
pip3 install --break-system-packages --upgrade pip && \
|
pip3 install --break-system-packages --upgrade pip && \
|
||||||
pip3 install --break-system-packages -r requirements.txt && \
|
pip3 install --break-system-packages -r requirements.txt && \
|
||||||
setcap cap_net_bind_service=+ep $(readlink -f $(type -P python3)) && \
|
setcap cap_net_bind_service=+ep $(readlink -f $(type -P python3)) && \
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/redis:24.04"
|
image: "ghcr.io/telekom-security/redis:24.04.1"
|
||||||
read_only: true
|
read_only: true
|
||||||
|
|
||||||
# Map Web Service
|
# Map Web Service
|
||||||
|
|
@ -23,7 +23,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map:24.04"
|
image: "ghcr.io/telekom-security/map:24.04.1"
|
||||||
depends_on:
|
depends_on:
|
||||||
- map_redis
|
- map_redis
|
||||||
|
|
||||||
|
|
@ -37,6 +37,6 @@ services:
|
||||||
# - TZ=${TPOT_ATTACKMAP_TEXT_TIMEZONE}
|
# - TZ=${TPOT_ATTACKMAP_TEXT_TIMEZONE}
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map:24.04"
|
image: "ghcr.io/telekom-security/map:24.04.1"
|
||||||
depends_on:
|
depends_on:
|
||||||
- map_redis
|
- map_redis
|
||||||
|
|
|
||||||
50
update.sh
50
update.sh
|
|
@ -53,6 +53,7 @@ function fuCHECKINET () {
|
||||||
function fuSELFUPDATE () {
|
function fuSELFUPDATE () {
|
||||||
echo
|
echo
|
||||||
echo "### Now checking for newer files in repository ..."
|
echo "### Now checking for newer files in repository ..."
|
||||||
|
echo "### T-Pot... TPOT_TYPE is set to: $myTPOT_TYPE"
|
||||||
git fetch --all
|
git fetch --all
|
||||||
myREMOTESTAT=$(git status | grep -c "up-to-date")
|
myREMOTESTAT=$(git status | grep -c "up-to-date")
|
||||||
if [ "$myREMOTESTAT" != "0" ];
|
if [ "$myREMOTESTAT" != "0" ];
|
||||||
|
|
@ -67,13 +68,31 @@ function fuSELFUPDATE () {
|
||||||
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git pull --force
|
git pull --force
|
||||||
exec ./update.sh -y
|
# check if myTPOT_TYPE is set
|
||||||
exit 1
|
if [ -z "$myTPOT_TYPE" ]; then
|
||||||
|
exec ./update.sh
|
||||||
|
else
|
||||||
|
exec ./update.sh -y $myTPOT_TYPE
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git pull --force
|
git pull --force
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$myTPOT_TYPE" ]; then
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
grep -q "^TPOT_TYPE=" .env && sed -i "s/^TPOT_TYPE=.*/TPOT_TYPE=${myTPOT_TYPE}/" .env
|
||||||
|
echo "### T-Pot type set to: $myTPOT_TYPE in .env"
|
||||||
|
if [ "$myTPOT_TYPE" == "SENSOR" ]; then
|
||||||
|
echo "### Copying compose/sensor.yml to docker-compose.yml"
|
||||||
|
cp compose/sensor.yml docker-compose.yml
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,6 +213,19 @@ function fuRESTORE () {
|
||||||
sed -i "s/^TPOT_VERSION=.*/TPOT_VERSION=${newVERSION}/" $HOME/tpotce/.env
|
sed -i "s/^TPOT_VERSION=.*/TPOT_VERSION=${newVERSION}/" $HOME/tpotce/.env
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fuREADTPOT_TYPE () {
|
||||||
|
if [ -f .env ]; then
|
||||||
|
# reads the TPOT_TYPE from the .env file
|
||||||
|
myTPOT_TYPE=$(grep -E '^TPOT_TYPE=' .env | cut -d '=' -f2)
|
||||||
|
# Verify if TPOT_TYPE is set
|
||||||
|
if [ -z "$myTPOT_TYPE" ]; then
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
################
|
################
|
||||||
# Main section #
|
# Main section #
|
||||||
################
|
################
|
||||||
|
|
@ -211,11 +243,23 @@ if [ "$1" != "-y" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if exists second argument, use it as T-Pot type, only if SENSOR or HIVE
|
||||||
|
if [ -n "$2" ]; then
|
||||||
|
if [[ "$2" == "SENSOR" || "$2" == "HIVE" ]]; then
|
||||||
|
myTPOT_TYPE="$2"
|
||||||
|
else
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
myTPOT_TYPE="HIVE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fuREADTPOT_TYPE
|
||||||
fuCHECK_VERSION
|
fuCHECK_VERSION
|
||||||
fuCHECKINET "https://index.docker.io https://github.com"
|
fuCHECKINET "https://index.docker.io https://github.com"
|
||||||
fuSTOP_TPOT
|
fuSTOP_TPOT
|
||||||
fuBACKUP
|
fuBACKUP
|
||||||
fuSELFUPDATE "$0" "$@"
|
fuSELFUPDATE "$0" "$@" "$myTPOT_TYPE"
|
||||||
fuUPDATER
|
fuUPDATER
|
||||||
fuRESTORE
|
fuRESTORE
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue