mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-10-28 19:12:53 +00:00
Compare commits
3 commits
e14c224f8e
...
b5e8b2be17
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5e8b2be17 | ||
|
|
0be973b4eb | ||
|
|
443a9d19fc |
8 changed files with 16 additions and 79 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
ENV ES_VER=8.18.3
|
ENV ES_VER=8.18.4
|
||||||
#
|
#
|
||||||
# Include dist
|
# Include dist
|
||||||
COPY dist/ /root/dist/
|
COPY dist/ /root/dist/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
FROM node:20.19.2-alpine3.20
|
FROM node:20.19.2-alpine3.20
|
||||||
ENV KB_VER=8.18.3
|
ENV KB_VER=8.18.4
|
||||||
#
|
#
|
||||||
# Include dist
|
# Include dist
|
||||||
COPY dist/ /root/dist/
|
COPY dist/ /root/dist/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV LS_VER=8.18.3
|
ENV LS_VER=8.18.4
|
||||||
#
|
#
|
||||||
# Include dist
|
# Include dist
|
||||||
COPY dist/ /root/dist/
|
COPY dist/ /root/dist/
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ RUN apk --no-cache -U upgrade && \
|
||||||
cd /opt/ && \
|
cd /opt/ && \
|
||||||
git clone https://github.com/mushorg/glutton && \
|
git clone https://github.com/mushorg/glutton && \
|
||||||
cd /opt/glutton/ && \
|
cd /opt/glutton/ && \
|
||||||
git checkout b3b5944b79893ccb1da19e112571674841bbe124 && \
|
git checkout 1e534801825dfa517a97a4e1899bf85e9384e463 && \
|
||||||
cp /root/dist/system.go . && \
|
|
||||||
make build && \
|
make build && \
|
||||||
cp /root/dist/*.yaml /opt/glutton/config/
|
cp /root/dist/*.yaml /opt/glutton/config/
|
||||||
#
|
#
|
||||||
FROM alpine:3.20
|
FROM alpine:3.22
|
||||||
#
|
#
|
||||||
COPY --from=builder /opt/glutton/bin /opt/glutton/bin
|
COPY --from=builder /opt/glutton/bin /opt/glutton/bin
|
||||||
COPY --from=builder /opt/glutton/config /opt/glutton/config
|
COPY --from=builder /opt/glutton/config /opt/glutton/config
|
||||||
|
|
@ -33,7 +32,7 @@ RUN apk -U --no-cache upgrade && \
|
||||||
libcap \
|
libcap \
|
||||||
libpcap-dev && \
|
libpcap-dev && \
|
||||||
setcap cap_net_admin,cap_net_raw=+ep /opt/glutton/bin/server && \
|
setcap cap_net_admin,cap_net_raw=+ep /opt/glutton/bin/server && \
|
||||||
setcap cap_net_admin,cap_net_raw=+ep /sbin/xtables-nft-multi && \
|
setcap cap_net_admin,cap_net_raw=+ep /usr/sbin/xtables-nft-multi && \
|
||||||
mkdir -p /var/log/glutton \
|
mkdir -p /var/log/glutton \
|
||||||
/opt/glutton/payloads
|
/opt/glutton/payloads
|
||||||
#
|
#
|
||||||
|
|
|
||||||
2
docker/glutton/dist/config.yaml
vendored
2
docker/glutton/dist/config.yaml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
ports:
|
ports:
|
||||||
tcp: 5000
|
tcp: 5000
|
||||||
udp: 5001
|
udp: 5001
|
||||||
ssh: 2222
|
ssh: 64295
|
||||||
|
|
||||||
rules_path: config/rules.yaml
|
rules_path: config/rules.yaml
|
||||||
|
|
||||||
|
|
|
||||||
10
docker/glutton/dist/rules.yaml
vendored
10
docker/glutton/dist/rules.yaml
vendored
|
|
@ -1,4 +1,6 @@
|
||||||
rules:
|
rules:
|
||||||
|
- match: udp
|
||||||
|
type: drop
|
||||||
- match: tcp dst port 23 or port 2323 or port 23231
|
- match: tcp dst port 23 or port 2323 or port 23231
|
||||||
type: conn_handler
|
type: conn_handler
|
||||||
target: telnet
|
target: telnet
|
||||||
|
|
@ -29,8 +31,12 @@ rules:
|
||||||
- match: tcp dst port 11211
|
- match: tcp dst port 11211
|
||||||
type: conn_handler
|
type: conn_handler
|
||||||
target: memcache
|
target: memcache
|
||||||
|
- match: tcp dst port 3260
|
||||||
|
type: conn_handler
|
||||||
|
target: iscsi
|
||||||
|
- match: tcp dst port 27017
|
||||||
|
type: conn_handler
|
||||||
|
target: mongodb
|
||||||
- match: tcp
|
- match: tcp
|
||||||
type: conn_handler
|
type: conn_handler
|
||||||
target: tcp
|
target: tcp
|
||||||
- match: udp
|
|
||||||
type: drop
|
|
||||||
68
docker/glutton/dist/system.go
vendored
68
docker/glutton/dist/system.go
vendored
|
|
@ -1,68 +0,0 @@
|
||||||
package glutton
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
"net"
|
|
||||||
"os"
|
|
||||||
"runtime"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/glaslos/lsof"
|
|
||||||
"github.com/google/gopacket/pcap"
|
|
||||||
)
|
|
||||||
|
|
||||||
func countOpenFiles() (int, error) {
|
|
||||||
if runtime.GOOS == "linux" {
|
|
||||||
lines, err := lsof.ReadPID(os.Getpid())
|
|
||||||
return len(lines) - 1, err
|
|
||||||
}
|
|
||||||
return 0, errors.New("operating system type not supported for this command")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *Glutton) startMonitor(quit chan struct{}) {
|
|
||||||
ticker := time.NewTicker(10 * time.Second)
|
|
||||||
go func() {
|
|
||||||
for {
|
|
||||||
select {
|
|
||||||
// case <-ticker.C:
|
|
||||||
// openFiles, err := countOpenFiles()
|
|
||||||
// if err != nil {
|
|
||||||
// fmt.Printf("Failed :%s", err)
|
|
||||||
// }
|
|
||||||
// runningRoutines := runtime.NumGoroutine()
|
|
||||||
// g.Logger.Info(fmt.Sprintf("running Go routines: %d, open files: %d", openFiles, runningRoutines))
|
|
||||||
case <-quit:
|
|
||||||
g.Logger.Info("monitoring stopped...")
|
|
||||||
ticker.Stop()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
|
||||||
func getNonLoopbackIPs(ifaceName string) ([]net.IP, error) {
|
|
||||||
nonLoopback := []net.IP{}
|
|
||||||
|
|
||||||
ifs, err := pcap.FindAllDevs()
|
|
||||||
if err != nil {
|
|
||||||
return nonLoopback, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, iface := range ifs {
|
|
||||||
if strings.EqualFold(iface.Name, ifaceName) {
|
|
||||||
for _, addr := range iface.Addresses {
|
|
||||||
if !addr.IP.IsLoopback() && addr.IP.To4() != nil {
|
|
||||||
nonLoopback = append(nonLoopback, addr.IP)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(nonLoopback) == 0 {
|
|
||||||
return nonLoopback, fmt.Errorf("unable to find any non-loopback addresses for: %s", ifaceName)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nonLoopback, nil
|
|
||||||
}
|
|
||||||
|
|
@ -13,7 +13,7 @@ services:
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
image: "dtagdevsec/glutton:24.04"
|
image: "ghcr.io/telekom-security/glutton:24.04.1"
|
||||||
read_only: true
|
read_only: true
|
||||||
volumes:
|
volumes:
|
||||||
- $HOME/tpotce/data/glutton/log:/var/log/glutton
|
- $HOME/tpotce/data/glutton/log:/var/log/glutton
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue