update cowrie

This commit is contained in:
kev 2020-11-05 19:22:21 +08:00
parent 410c297862
commit d90dda2844
8 changed files with 1120 additions and 76 deletions

View File

@ -1,38 +0,0 @@
#
# Dockerfile for cowrie
#
FROM alpine
MAINTAINER kev <noreply@easypi.pro>
RUN apk add -U bash \
build-base \
ca-certificates \
libffi \
libffi-dev \
openssl \
openssl-dev \
python \
python-dev \
tar \
&& wget -qO- https://bootstrap.pypa.io/get-pip.py | python \
&& adduser -D cowrie \
&& cd /home/cowrie \
&& wget -qO- https://github.com/micheloosterhof/cowrie/archive/master.tar.gz | tar xz --strip 1 \
&& pip install -r requirements.txt \
&& sed '/Enable Telnet/{n;s/\(enabled\).*/\1 = true/}' cowrie.cfg.dist > cowrie.cfg \
&& sed -i 's/^\(VIRTUALENV_ENABLED\).*/\1=no/' bin/cowrie \
&& chown -R cowrie:cowrie . \
&& apk del build-base \
libffi-dev \
openssl-dev \
python-dev \
tar \
&& rm -rf /var/cache/apk/*
EXPOSE 2222 2223
USER cowrie
WORKDIR /home/cowrie
CMD ["bin/cowrie", "start", "-n"]

View File

@ -11,31 +11,35 @@ Cowrie is directly based on [Kippo][2] by Upi Tamminen (desaster).
## docker-compose.yml
```yaml
cowrie:
image: vimagick/cowrie
ports:
- "2222:2222"
- "2223:2223"
volumes:
- ./data/dl:/home/cowrie/dl
- ./data/log:/home/cowrie/log
restart: always
version: "3.8"
services:
cowrie:
image: cowrie/cowrie
ports:
- "2222:2222"
- "2223:2223"
volumes:
- cowrie-etc:/cowrie/cowrie-git/etc
- cowrie-var:/cowrie/cowrie-git/var
restart: unless-stopped
volumes:
cowrie-etc:
cowrie-var:
```
## server
```bash
$ cd ~/fig/cowrie
$ mkdir -p data/dl data/log/tty
$ chmod -R 777 data
$ tree -F
.
├── docker-compose.yml
├── dl/
└── log/
└── tty/
$ docker-compose up -d
$ tail -f log/cowrie.log
$ docker volume ls
$ docker volume inspect cowrie_cowrie-var
$ cd /var/lib/docker/volumes/cowrie_cowrie-etc/_data
$ cp cowrie.cfg.dist cowrie.cfg
$ cp userdb.example userdb.txt
$ cd /var/lib/docker/volumes/cowrie_cowrie-var/_data
$ tail -f log/cowrie/cowrie.json
```
## client

View File

@ -2,7 +2,7 @@
# Dockerfile for cowrie-arm
#
FROM easypi/alpine-arm
FROM arm32v7/alpine:3
MAINTAINER EasyPi Software Foundation
RUN apk add -U bash \

View File

@ -1,9 +1,11 @@
cowrie:
image: easypi/cowrie-arm
ports:
- "2222:2222"
- "2223:2223"
volumes:
- ./data/dl:/home/cowrie/dl
- ./data/log:/home/cowrie/log
restart: always
version: "3.8"
services:
cowrie:
image: easypi/cowrie-arm
ports:
- "2222:2222"
- "2223:2223"
volumes:
- ./data/dl:/home/cowrie/dl
- ./data/log:/home/cowrie/log
restart: unless-stopped

1033
cowrie/data/etc/cowrie.cfg Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
# Example userdb.txt
# This file may be copied to etc/userdb.txt.
# If etc/userdb.txt is not present, built-in defaults will be used.
#
# ':' separated fields, file is processed line for line
# processing will stop on first match
#
# Field #1 contains the username
# Field #2 is currently unused
# Field #3 contains the password
# '*' for password allows any password
# '!' at the start of a password will not grant this password access
# '/' can be used to write a regular expression
#
root:x:!root
root:x:!123456
root:x:!/honeypot/i
root:x:*
tomcat:x:*
oracle:x:*

View File

@ -1,9 +1,16 @@
cowrie:
image: vimagick/cowrie
ports:
- "2222:2222"
- "2223:2223"
volumes:
- ./data/dl:/home/cowrie/dl
- ./data/log:/home/cowrie/log
restart: always
version: "3.8"
services:
cowrie:
image: cowrie/cowrie
ports:
- "2222:2222"
- "2223:2223"
volumes:
- cowrie-etc:/cowrie/cowrie-git/etc
- cowrie-var:/cowrie/cowrie-git/var
restart: unless-stopped
volumes:
cowrie-etc:
cowrie-var:

View File

@ -0,0 +1,16 @@
[Unit]
Description=Presto Standalone Server
After=network.target
[Service]
Type=forking
User=presto
Group=presto
ExecStart=/opt/presto-server/bin/launcher start
PIDFile=/opt/presto-server/data/var/run/launcher.pid
LimitNOFILE=65536
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target