summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--INSTALL4
-rw-r--r--PKGBUILD41
-rw-r--r--cowrie.install17
-rw-r--r--cowrie.service14
5 files changed, 34 insertions, 65 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e37f940b75ec..b1703e8a1548 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,22 +1,25 @@
pkgbase = cowrie
- pkgdesc = A medium interaction SSH honeypot designed to log brute force attacks and, most importantly, the entire shell interaction performed by the attacker
- pkgver = 1.0.0_alpha
+ pkgdesc = Medium interaction SSH honeypot designed to log brute force attacks and entire shell interaction
+ pkgver = 1.1.0
pkgrel = 1
- url = https://github.com/micheloosterhof/cowrie.git
+ url = https://github.com/micheloosterhof/cowrie
install = cowrie.install
arch = any
license = BSD
depends = twisted
- depends = pycrypto
depends = zope-interface
+ depends = zope-interface
+ depends = python2-crypto
depends = python2-pyasn1
+ depends = python2-cryptography
+ depends = python2-gmpy2
+ depends = python2-pyopenssl
+ depends = mysql-python
+ depends = python2-dateutil
+ depends = python2-tftpy
backup = etc/cowrie.cfg
- source = cowrie-1.0.0_alpha.tar.gz::https://github.com/micheloosterhof/cowrie/archive/v1.0.0-alpha.tar.gz
- source = cowrie.service
- source = INSTALL
- sha512sums = 0ffcb55906d30869f551676fbdded32d5de50519107f9e1e2be27c8a8914b887af4070c470abee5018b1edb815c604b1961a5598ab1d9b61764034bcf191995b
- sha512sums = 106618a2c73d5f1f2ad75997e693f6ff4e903644a6be0dc59e85f72ae81f583927b2f079823c3379a8796e03fd542f497d2cc9405dc5d0d20d6caeb9dc88abed
- sha512sums = a80dc0e9ec922c795af13ec85fc4e3414481a0d7ae14d9f17e29ade2a118010c1d69d474fe38c7e648d69b07ff09144efe97183e8a64ccf8165ec3a767a18ce2
+ source = cowrie-1.1.0.tar.gz::https://github.com/micheloosterhof/cowrie/archive/v1.1.0.tar.gz
+ sha512sums = da6cb2e25f57dd5a1e9b7ff02a39ae4d6955ee2be03b0054f92f07b429a1a12b938c571862b05d5ccbe9949d132185079bd93644bd38469e841cb9a8cc95dfbd
pkgname = cowrie
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 5ef9856ca847..000000000000
--- a/INSTALL
+++ /dev/null
@@ -1,4 +0,0 @@
-By default, cowrie runs on port 2222. Do not try to run it on port 22.
-Instead, use something like
- iptables -t nat -A PREROUTING -i enp0s1 -p tcp --dport 22 -j REDIRECT --to-port 2222
-to make it reachable on port 22.
diff --git a/PKGBUILD b/PKGBUILD
index 09798ad201a9..0365d7154be1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,48 +1,45 @@
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
pkgname=cowrie
-pkgver=1.0.0_alpha
-_pkgver=${pkgver/_/-}
+pkgver=1.1.0
pkgrel=1
-pkgdesc="A medium interaction SSH honeypot designed to log brute force attacks and, most importantly, the entire shell interaction performed by the attacker"
-url="https://github.com/micheloosterhof/cowrie.git"
+pkgdesc='Medium interaction SSH honeypot designed to log brute force attacks and entire shell interaction'
+url='https://github.com/micheloosterhof/cowrie'
arch=('any')
license=('BSD')
-depends=('twisted' 'pycrypto' 'zope-interface' 'python2-pyasn1')
+depends=('twisted' 'zope-interface' 'zope-interface' 'python2-crypto' 'python2-pyasn1' 'python2-cryptography'
+ 'python2-gmpy2' 'python2-pyopenssl' 'mysql-python' 'python2-dateutil' 'python2-tftpy')
backup=('etc/cowrie.cfg')
install=cowrie.install
-source=(${pkgname}-${pkgver}.tar.gz::https://github.com/micheloosterhof/${pkgname}/archive/v${_pkgver}.tar.gz
- cowrie.service
- INSTALL)
-sha512sums=('0ffcb55906d30869f551676fbdded32d5de50519107f9e1e2be27c8a8914b887af4070c470abee5018b1edb815c604b1961a5598ab1d9b61764034bcf191995b'
- '106618a2c73d5f1f2ad75997e693f6ff4e903644a6be0dc59e85f72ae81f583927b2f079823c3379a8796e03fd542f497d2cc9405dc5d0d20d6caeb9dc88abed'
- 'a80dc0e9ec922c795af13ec85fc4e3414481a0d7ae14d9f17e29ade2a118010c1d69d474fe38c7e648d69b07ff09144efe97183e8a64ccf8165ec3a767a18ce2')
+source=(${pkgname}-${pkgver}.tar.gz::https://github.com/micheloosterhof/${pkgname}/archive/v${pkgver}.tar.gz)
+sha512sums=('da6cb2e25f57dd5a1e9b7ff02a39ae4d6955ee2be03b0054f92f07b429a1a12b938c571862b05d5ccbe9949d132185079bd93644bd38469e841cb9a8cc95dfbd')
prepare() {
- cd ${pkgname}-${_pkgver}
- sed -e 's|env python$|env python2|g' -i utils/*.py
- sed -e 's|/usr/bin/python$|/usr/bin/python2|g' -i utils/fsctl.py
+ cd ${pkgname}-${pkgver}
+ sed -e 's|env python$|env python2|g' -i bin/* cowrie/commands/tftp.py
+ sed -e 's|/home/cowrie|/opt|g' -i doc/systemd/cowrie.service
+ sed -e '/PIDFile/d' -i doc/systemd/cowrie.service
+ sed -r 's|(cowrie)$|\1 -c /etc/cowrie.cfg|g' -i start.sh
}
build() {
- cd ${pkgname}-${_pkgver}
+ cd ${pkgname}-${pkgver}
python2 -m compileall .
python2 -O -m compileall .
}
package() {
- cd ${pkgname}-${_pkgver}
+ cd ${pkgname}-${pkgver}
install -Dm 644 cowrie.cfg.dist "${pkgdir}/etc/cowrie.cfg"
- install -Dm 644 "${srcdir}/cowrie.service" "${pkgdir}/usr/lib/systemd/system/cowrie.service"
+ install -Dm 644 doc/systemd/cowrie.service -t "${pkgdir}/usr/lib/systemd/system"
- find . -type f -not \( -name cowrie.cfg.dist -o -name start.sh -o -name stop.sh \
- -o -name '.git*' -o -path './.git/*' \) \
- -exec install -Dm 644 {} "${pkgdir}/opt/cowrie/{}" \;
+ install -d "${pkgdir}/opt/cowrie"
+ cp -a . "${pkgdir}/opt/cowrie"
+ rm -r "${pkgdir}/opt/cowrie/cowrie.cfg.dist"
install -Dm 644 doc/COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README"
- install -Dm 644 "${srcdir}/INSTALL" "${pkgdir}/usr/share/doc/${pkgname}/INSTALL"
+ install -Dm 644 README.md INSTALL.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
# vim: ts=2 sw=2 et:
diff --git a/cowrie.install b/cowrie.install
index 590632a835bc..d8bcbc04196d 100644
--- a/cowrie.install
+++ b/cowrie.install
@@ -1,26 +1,13 @@
post_install() {
- getent group cowrie > /dev/null || groupadd cowrie
- getent passwd cowrie > /dev/null || \
+ getent group cowrie &> /dev/null || groupadd cowrie
+ getent passwd cowrie &> /dev/null || \
useradd -d /opt/cowrie -g cowrie -s /bin/nologin cowrie
- mkdir -p /opt/cowrie/log/tty /opt/cowrie/dl
chown -R cowrie:cowrie /opt/cowrie
-
- cat /usr/share/doc/cowrie/INSTALL
}
post_upgrade() {
post_install
}
-pre_remove() {
- if [[ -f /opt/cowrie/cowrie.pid ]]; then
- systemctl stop cowrie
- fi
-}
-
-post_remove() {
- userdel cowrie
-}
-
# vim: ts=2 sw=2 et:
diff --git a/cowrie.service b/cowrie.service
deleted file mode 100644
index 0c5fc91ad447..000000000000
--- a/cowrie.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Cowrie Honey Pot
-After=network.target
-
-[Service]
-Type=forking
-User=cowrie
-Group=cowrie
-WorkingDirectory=/opt/cowrie
-PIDFile=/opt/cowrie/cowrie.pid
-ExecStart=/usr/bin/twistd -l log/cowrie.log --pidfile cowrie.pid cowrie
-
-[Install]
-WantedBy=multi-user.target