Browse Source

Appending standard configuration file and rc file. Removing sudo usage.

Peter Smej 23 years ago
parent
commit
c4f5259766
4 changed files with 103 additions and 16 deletions
  1. 10 0
      honeyd/honeyd.conf
  2. 22 1
      honeyd/honeyd.patch
  3. 38 15
      honeyd/honeyd.spec
  4. 33 0
      honeyd/rc.honeyd

+ 10 - 0
honeyd/honeyd.conf

@@ -0,0 +1,10 @@
+# Example of a simple host template and its binding
+create testbox
+set testbox personality "FreeBSD 3.2-4.0"
+add testbox tcp port 80 "sh scripts/web.sh"
+add testbox tcp port 22 "sh scripts/test.sh $ipsrc $dport"
+add testbox tcp port 23 proxy $ipsrc:23
+set testbox default tcp action reset
+
+bind 10.21.19.102 testbox
+set 10.21.19.102 uptime 1327650

+ 22 - 1
honeyd/honeyd.patch

@@ -23,7 +23,7 @@
 +     if test -f $withval/lib/libdnet.a; then
  	DNETINC="-I$withval/include"
 -	DNETLIB="-L$withval/src -ldnet `$withval/dnet-config --libs`"
-+	DNETLIB="-L$withval/lib -ldnet `$withval/dnet-config --libs`"
++	DNETLIB="-L$withval/lib -ldnet `$withval/bin/dnet-config --libs`"
       elif test -x $withval/bin/dnet-config; then
  	DNETINC="`$withval/bin/dnet-config --cflags`"
  	DNETLIB="`$withval/bin/dnet-config --libs`"
@@ -42,3 +42,24 @@
       else
          { { echo "$as_me:3534: error: event.h or libevent.a not found in $withval" >&5
  echo "$as_me: error: event.h or libevent.a not found in $withval" >&2;}
+--- nmap.prints.org	Thu Feb 20 15:39:35 2003
++++ nmap.prints	Thu Feb 20 15:40:04 2003
+@@ -6715,18 +6715,6 @@
+ T7(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
+ PU(Resp=N|Y)
+ 
+-# Contributed by Nick Hone nhone@telus.net
+-Fingerprint Windows NT 4 SP3
+-TSeq(Class=TD|RI%gcd=<18%SI=<2A00DA&>6B73)
+-T1(DF=Y%W=7FFF|2017%ACK=S++%Flags=AS%Ops=M|MNWNNT)
+-T2(Resp=Y%DF=N%W=0%ACK=S%Flags=AR%Ops=)
+-T3(Resp=Y%DF=Y%W=7FFF|2017%ACK=S++|O%Flags=AS|A%Ops=M|NNT)
+-T4(DF=N%W=0%ACK=O|S%Flags=R%Ops=)
+-T5(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
+-T6(DF=N%W=0%ACK=O|S++%Flags=R%Ops=)
+-T7(DF=N%W=0%ACK=S++%Flags=AR%Ops=)
+-PU(TOS=0%IPLEN=38%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E)
+-
+ # Contributed by grunby grunby@hades.ss.purchase.edu
+ Fingerprint Microsoft NT 4.0 SP5-SP6
+ TSeq(Class=RI%gcd=<6%SI=<DA16&>21A)

+ 38 - 15
honeyd/honeyd.spec

@@ -23,8 +23,7 @@
 ##  SUCH DAMAGE.
 ##
 
-#   FIXME: replace sudo stuff
-#   FIXME: provide default config
+# FIXME: Test routing
 
 #   package information
 Name:         honeyd
@@ -36,17 +35,19 @@ Distribution: OpenPKG [JUNK]
 Group:        Language
 License:      BSD License
 Version:      0.5
-Release:      20030218
+Release:      20030220
 
 #   list of sources
 Source0:      http://www.citi.umich.edu/u/provos/honeyd/honeyd-%{version}.tar.gz
+Source1:      rc.honeyd
+Source2:      honeyd.conf
 Patch0:       honeyd.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20030211, libdnet, libpcap, libevent
-PreReq:       OpenPKG, openpkg >= 20030211, sudo
+PreReq:       OpenPKG, openpkg >= 20030211
 AutoReq:      no
 AutoReqProv:  no
 
@@ -69,7 +70,7 @@ AutoReqProv:  no
     CC="%{l_cc}" \
     CFLAGS="%{l_cflags -O}" \
     ./configure \
-        --prefix=$RPM_BUILD_ROOT%{l_prefix} \
+        --prefix=%{l_prefix} \
         --with-libdnet=%{l_prefix} \
         --with-libpcap=%{l_prefix} \
         --with-libevent=%{l_prefix} \
@@ -78,25 +79,47 @@ AutoReqProv:  no
 
 %install
     rm -rf $RPM_BUILD_ROOT
-    %{l_make} %{l_mflags} install
 
     #   create filesystem hierachy
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/etc/honeyd \
-        $RPM_BUILD_ROOT%{l_prefix}/libexec/honeyd
-
-    #   install wrapper
-    ( echo "#!/bin/sh"
-      echo "exec %{l_prefix}/bin/sudo %{l_prefix}/libexec/honeyd/honeyd \${1+\"\$@\"} &"
-    ) >$RPM_BUILD_ROOT%{l_prefix}/bin/honeyd
-    chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/honeyd
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+        $RPM_BUILD_ROOT%{l_prefix}/sbin \
+        $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
+        $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/scripts
 
     #   install files
-    %{l_shtool} install -c -m 755 \
-        honeyd $RPM_BUILD_ROOT%{l_prefix}/libexec/honeyd
+    %{l_shtool} install -c -s -m 755 \
+        honeyd $RPM_BUILD_ROOT%{l_prefix}/sbin
     %{l_shtool} install -c -m 644 \
         honeyd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
 
+    %{l_shtool} install -c -m 644 \
+        nmap.assoc $RPM_BUILD_ROOT%{l_prefix}/share/honeyd
+
+    %{l_shtool} install -c -m 644 \
+        nmap.prints $RPM_BUILD_ROOT%{l_prefix}/share/honeyd
+
+    %{l_shtool} install -c -m 644 \
+       xprobe2.conf $RPM_BUILD_ROOT%{l_prefix}/share/honeyd
+
+    %{l_shtool} install -c -m 644 \
+        scripts/router-telnet.pl $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/scripts
+
+    %{l_shtool} install -c -m 644 \
+        scripts/test.sh $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/scripts
+
+    %{l_shtool} install -c -m 644 \
+        scripts/web.sh $RPM_BUILD_ROOT%{l_prefix}/share/honeyd/scripts
+
+    %{l_shtool} install -c -m 755 \
+       %{SOURCE honeyd.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/honeyd/
+
+    %{l_shtool} install -c -m 755 \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        -e 's;@l_susr@;%{l_susr};g' \
+       %{SOURCE rc.honeyd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
 
 %files -f files

+ 33 - 0
honeyd/rc.honeyd

@@ -0,0 +1,33 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.honeyd -- Run-Commands for honeyd
+##
+
+%config
+    honeyd_enable="yes"
+
+%start -p 200 -u @l_susr@
+    opServiceEnabled honeyd || exit 0
+    @l_prefix@/sbin/honeyd -f @l_prefix@/etc/honeyd/honeyd.conf -p @l_prefix@/share/honeyd/nmap.prints -x  @l_prefix@/share/honeyd/xprobe2.conf -a
+@l_prefix@/share/honeyd/nmap.assoc >/dev/null 2>&1
+
+%stop -p 200 -u @l_susr@
+    opServiceEnabled honey || exit 0
+    if [ -f @l_prefix@/var/honeyd/honeyd.pid ]; then
+        kill -TERM `cat @l_prefix@/var/honeyd/honeyd.pid`
+    fi
+
+%restart -u @l_susr@
+    opServiceEnabled honeyd || exit 0
+    if [ -f @l_prefix@/var/honeyd/honeyd.pid ]; then
+        kill -TERM `cat @l_prefix@/var/honeyd/honeyd.pid`
+        sleep 2
+    fi
+    @l_prefix@/sbin/honeyd -F @l_prefix@/etc/honeyd/honeyd.conf >/dev/null 2>&1
+
+%reload -u @l_susr@
+    opServiceEnabled amd || exit 0
+    if [ -f @l_prefix@/var/honeyd/honeyd.pid ]; then
+        kill -HUP `cat @l_prefix@/var/honeyd/honeyd.pid`
+    fi
+