diff options
Diffstat (limited to 'testing/ssh-honeypot')
-rw-r--r-- | testing/ssh-honeypot/APKBUILD | 33 | ||||
-rw-r--r-- | testing/ssh-honeypot/ssh-honeypot.confd | 1 | ||||
-rw-r--r-- | testing/ssh-honeypot/ssh-honeypot.initd | 23 |
3 files changed, 57 insertions, 0 deletions
diff --git a/testing/ssh-honeypot/APKBUILD b/testing/ssh-honeypot/APKBUILD new file mode 100644 index 0000000000..934938b47a --- /dev/null +++ b/testing/ssh-honeypot/APKBUILD @@ -0,0 +1,33 @@ +# Contributor: Michael Pirogov <vbnet.ru@gmail.com> +# Maintainer: Michael Pirogov <vbnet.ru@gmail.com> +pkgname="ssh-honeypot" +pkgver="0_git20190717" +_commit=b7baa9a6963e723ee0779a6cef0447739870ace3 +pkgrel=0 +pkgdesc="Fake sshd that logs ip addresses, usernames, and passwords." +url="https://github.com/droberson/ssh-honeypot" +arch="all" +license="MIT" +depends="openssh-keygen" +makedepends="json-c0.12-dev libssh-dev" +options="!check" # no testsuite and daemon returns 1 even on help command +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.zip::https://github.com/droberson/ssh-honeypot/archive/$_commit.zip + $pkgname.initd + $pkgname.confd" +builddir="$srcdir/$pkgname-$_commit" + +build() { + make CC="gcc" CFLAGS="$CFLAGS -fPIC" +} + +package() { + mkdir -p "$pkgdir"/usr/bin/ "$pkgdir"/usr/share/ssh-honeypot + install -m 755 -D "$builddir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname + install -m 755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m 644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums="67edfac31421bb8ecbbff08b9dcc3169372da59f4dd83a21149af666b98c42c3a924f8dd6a5091d5928a258915c1f6a7611dbef872432e793fc42e786fd30201 ssh-honeypot-0_git20190717.zip +759a0756e082bc946deec156c164dd5b40876f2f3cd1f3f0c526f06b009f70110ddfbc7730e295765f6c9e088f123a45909c94fe048e7f864b4946ae5a98f157 ssh-honeypot.initd +e93b93117afa5f5ad93bce12e5846718bb25d24ace47bbcee1bbb72af51b0cc9fc7558a5650e4778330e5ad22d1807183ebc93101e7e16dfc6f7e391ba4aca6d ssh-honeypot.confd" diff --git a/testing/ssh-honeypot/ssh-honeypot.confd b/testing/ssh-honeypot/ssh-honeypot.confd new file mode 100644 index 0000000000..84f3c0ea5b --- /dev/null +++ b/testing/ssh-honeypot/ssh-honeypot.confd @@ -0,0 +1 @@ +SSHHONEYPOT_ARGS="-u nobody -r /usr/share/ssh-honeypot/honeypot.rsa -p 2233 -l /var/log/ssh-honeypot.log" diff --git a/testing/ssh-honeypot/ssh-honeypot.initd b/testing/ssh-honeypot/ssh-honeypot.initd new file mode 100644 index 0000000000..f3ca11fd2b --- /dev/null +++ b/testing/ssh-honeypot/ssh-honeypot.initd @@ -0,0 +1,23 @@ +#!/sbin/openrc-run + +name="ssh-honeypot daemon" +description="Fake sshd that logs ip addresses, usernames, and passwords." +command=/usr/bin/ssh-honeypot +command_args="${SSHHONEYPOT_ARGS}" +prog_name="ssh-honeypot" +key_path="/usr/share/${prog_name}/honeypot.rsa" +pid_file="/var/run/${prog_name}.pid" +start_stop_daemon_args="-b -m --pidfile ${pidfile} -- " + +depend() { + need net +} + +start_pre() { + if ! checkpath -f "${key_path}"; then + ebegin "Generating key" + /usr/bin/ssh-keygen -t rsa -f ${key_path} -q -N "" + eend $? + fi +} + |