summaryrefslogtreecommitdiff
path: root/package/scanlogd
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/scanlogd
Initial import
Diffstat (limited to 'package/scanlogd')
-rw-r--r--package/scanlogd/Config.in14
-rw-r--r--package/scanlogd/Makefile39
-rw-r--r--package/scanlogd/files/scanlogd.init26
-rw-r--r--package/scanlogd/ipkg/scanlogd.control5
-rw-r--r--package/scanlogd/ipkg/scanlogd.postinst36
5 files changed, 120 insertions, 0 deletions
diff --git a/package/scanlogd/Config.in b/package/scanlogd/Config.in
new file mode 100644
index 000000000..f951672c7
--- /dev/null
+++ b/package/scanlogd/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_SCANLOGD
+ prompt "scanlogd.......................... a port scan detection tool"
+ tristate
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBNET
+ select ADK_PACKAGE_LIBNIDS
+ default n
+ help
+ Scanlogd is a TCP port scan detection tool, originally designed
+ to illustrate various attacks an IDS developer has to deal with.
+ Thus, unlike some of the other port scan detection tools out there,
+ scanlogd is designed to be totally safe to use.
+
+ http://www.openwall.com/scanlogd
diff --git a/package/scanlogd/Makefile b/package/scanlogd/Makefile
new file mode 100644
index 000000000..6747a82f9
--- /dev/null
+++ b/package/scanlogd/Makefile
@@ -0,0 +1,39 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= scanlogd
+PKG_VERSION:= 2.2.6
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 7b8187ea718ebe47f22805b921b909ab
+MASTER_SITES:= http://www.openwall.com/scanlogd/ \
+ ftp://ftp.wiretapped.net/pub/openwall/ \
+ http://distro.ibiblio.org/pub/linux/distributions/openwall/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SCANLOGD,scanlogd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" LD="${TARGET_CC}" CFLAGS="-c ${TARGET_CFLAGS}" \
+ LDFLAGS= \
+ PCAP_H="-I${STAGING_DIR}/usr/include" \
+ NIDS_H="-I${STAGING_DIR}/usr/include" \
+ NIDS_L="-L${STAGING_DIR}/usr/lib -lnids -lnet -lpcap"
+ALL_TARGET:= libnids
+
+do-configure:
+ ${SED} "s,/var/empty,/tmp/.scanlogd," ${WRKBUILD}/params.h
+ ${SED} "s,#undef SCANLOGD_DEVICE,#define SCANLOGD_DEVICE \"all\"," ${WRKBUILD}/params.h
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SCANLOGD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SCANLOGD}/usr/sbin
+ ${INSTALL_BIN} ./files/scanlogd.init \
+ ${IDIR_SCANLOGD}/etc/init.d/${PKG_NAME}
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_SCANLOGD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/scanlogd/files/scanlogd.init b/package/scanlogd/files/scanlogd.init
new file mode 100644
index 000000000..37285b348
--- /dev/null
+++ b/package/scanlogd/files/scanlogd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${scanlogd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p `grep "^scanlogd:" /etc/passwd | cut -d: -f6`
+ scanlogd $scanlogd_flags
+ ;;
+stop)
+ killall scanlogd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/scanlogd/ipkg/scanlogd.control b/package/scanlogd/ipkg/scanlogd.control
new file mode 100644
index 000000000..4156ff55c
--- /dev/null
+++ b/package/scanlogd/ipkg/scanlogd.control
@@ -0,0 +1,5 @@
+Package: scanlogd
+Priority: optional
+Section: net
+Description: Port scan logger.
+Depends: libpcap, libnet, libnids
diff --git a/package/scanlogd/ipkg/scanlogd.postinst b/package/scanlogd/ipkg/scanlogd.postinst
new file mode 100644
index 000000000..60b036da4
--- /dev/null
+++ b/package/scanlogd/ipkg/scanlogd.postinst
@@ -0,0 +1,36 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf scanlogd scanlogd NO
+
+
+name=scanlogd
+id=53
+
+# do not change below
+# check if we are on real system
+if [ -z "${IPKG_INSTROOT}" ]; then
+ # create copies of passwd and group, if we use squashfs
+ rootfs=`mount |awk '/root/ { print $5 }'`
+ if [ "$rootfs" = "squashfs" ]; then
+ if [ -h /etc/group ]; then
+ rm /etc/group
+ cp /rom/etc/group /etc/group
+ fi
+ if [ -h /etc/passwd ]; then
+ rm /etc/passwd
+ cp /rom/etc/passwd /etc/passwd
+ fi
+ fi
+fi
+
+echo ""
+if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/group)" ]; then
+ echo "adding group $name to /etc/group"
+ echo "${name}:x:${id}:" >> ${IPKG_INSTROOT}/etc/group
+fi
+
+if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then
+ echo "adding user $name to /etc/passwd"
+ echo "${name}:x:${id}:${id}:${name}:/tmp/.${name}:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd
+fi
+