From f054737ae13a8a13f0e407531874818686146bba Mon Sep 17 00:00:00 2001 From: Marco Bonetti Date: Wed, 12 May 2010 23:32:14 +0200 Subject: network/hping3: Added to 12.2 repository --- network/hping3/README | 18 +++++++ network/hping3/hping3.SlackBuild | 101 +++++++++++++++++++++++++++++++++++++ network/hping3/hping3.info | 8 +++ network/hping3/slack-desc | 19 +++++++ network/hping3/tcl85.tcpdump.patch | 36 +++++++++++++ 5 files changed, 182 insertions(+) create mode 100644 network/hping3/README create mode 100644 network/hping3/hping3.SlackBuild create mode 100644 network/hping3/hping3.info create mode 100644 network/hping3/slack-desc create mode 100644 network/hping3/tcl85.tcpdump.patch (limited to 'network') diff --git a/network/hping3/README b/network/hping3/README new file mode 100644 index 0000000000000..acfffada38352 --- /dev/null +++ b/network/hping3/README @@ -0,0 +1,18 @@ +hping is a command-line oriented TCP/IP packet assembler/analyzer. The interface +is inspired to the ping(8) unix command, but hping isn't only able to send ICMP +echo requests. It supports TCP, UDP, ICMP and RAW-IP protocols, has a traceroute +mode, the ability to send files between a covered channel, and many other +features. + +While hping was mainly used as a security tool in the past, it can be used in +many ways by people that don't care about security to test networks and hosts. A +subset of the stuff you can do using hping: + * Firewall testing + * Advanced port scanning + * Network testing, using different protocols, TOS, fragmentation + * Manual path MTU discovery + * Advanced traceroute, under all the supported protocols + * Remote OS fingerprinting + * Remote uptime guessing + * TCP/IP stacks auditing + * hping can also be useful to students that are learning TCP/IP. diff --git a/network/hping3/hping3.SlackBuild b/network/hping3/hping3.SlackBuild new file mode 100644 index 0000000000000..7b04668ad0edb --- /dev/null +++ b/network/hping3/hping3.SlackBuild @@ -0,0 +1,101 @@ +#!/bin/sh + +# Slackware build script for hping3 TCP/IP packet assembler/analyzer +# +# Copyright 2009-2010 Marco Bonetti +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=hping3 +VERSION=${VERSION:-20051105} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} +DOCS="APD.txt API.txt AS-BACKDOOR HPING2-HOWTO.txt HPING2-IS-OPEN HPING3.txt \ +MORE-FUN-WITH-IPID SPOOFED_SCAN.txt hping2rc.example" + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +patch -p1 < $CWD/tcl85.tcpdump.patch + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --build=$ARCH-slackware-linux + +make + +# Install is done by hand, as the Makefile doesn't understand DESTDIR +# (and it's just one file) +install -d $PKG/usr/sbin/ +install -m 0755 hping3 $PKG/usr/sbin/ +( cd $PKG/usr/sbin + ln -sf hping3 hping + ln -sf hping3 hping2 +) +install -d $PKG/usr/man/man8/ +install -m 0644 docs/hping2.8 $PKG/usr/man/man8/ +install -m 0644 docs/hping3.8 $PKG/usr/man/man8/ + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +) + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +( cd docs ; cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION ) +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/hping3/hping3.info b/network/hping3/hping3.info new file mode 100644 index 0000000000000..4d7c48e0921f8 --- /dev/null +++ b/network/hping3/hping3.info @@ -0,0 +1,8 @@ +PRGNAM="hping3" +VERSION="20051105" +HOMEPAGE="http://www.hping.org/" +DOWNLOAD="http://www.hping.org/hping3-20051105.tar.gz" +MD5SUM="ca4ea4e34bcc2162aedf25df8b2d1747" +MAINTAINER="Marco Bonetti" +EMAIL="sid77@slackware.it" +APPROVED="rworkman" diff --git a/network/hping3/slack-desc b/network/hping3/slack-desc new file mode 100644 index 0000000000000..05f517a0250b8 --- /dev/null +++ b/network/hping3/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +hping3: hping (TCP/IP packet assembler/analyzer) +hping3: +hping3: hping interface is inspired to the ping(8) unix command, but it isn't +hping3: only able to send ICMP echo requests. It supports TCP, UDP, ICMP and +hping3: RAW-IP protocols, has a traceroute mode, the ability to send files +hping3: between a covered channel, and many other features. +hping3: +hping3: Homepage: http://www.hping.org/ +hping3: +hping3: +hping3: diff --git a/network/hping3/tcl85.tcpdump.patch b/network/hping3/tcl85.tcpdump.patch new file mode 100644 index 0000000000000..9c4e6bed50d2a --- /dev/null +++ b/network/hping3/tcl85.tcpdump.patch @@ -0,0 +1,36 @@ +diff -Naur hping3-20051105.orig/configure hping3-20051105/configure +--- hping3-20051105.orig/configure 2004-06-04 08:39:10.000000000 +0200 ++++ hping3-20051105/configure 2008-12-17 23:16:57.000000000 +0100 +@@ -63,7 +63,7 @@ + # + for TCLPATH_TRY in "/usr/bin/" "/usr/local/bin/" "/bin/" + do +- for TCLVER_TRY in "8.4" "8.3" "8.2" "8.1" "8.0" ++ for TCLVER_TRY in "8.5" "8.4" "8.3" "8.2" "8.1" "8.0" + do + if [ -z $TCLSH ] + then +diff -Naur hping3-20051105.orig/libpcap_stuff.c hping3-20051105/libpcap_stuff.c +--- hping3-20051105.orig/libpcap_stuff.c 2004-04-10 01:38:56.000000000 +0200 ++++ hping3-20051105/libpcap_stuff.c 2008-12-17 23:20:52.000000000 +0100 +@@ -17,7 +17,7 @@ + #include + #include + #include +-#include ++#include + + #include "globals.h" + +diff -Naur hping3-20051105.orig/script.c hping3-20051105/script.c +--- hping3-20051105.orig/script.c 2004-05-29 08:48:13.000000000 +0200 ++++ hping3-20051105/script.c 2008-12-17 23:21:15.000000000 +0100 +@@ -24,7 +24,7 @@ + + #include + #include +-#include ++#include + + #include "release.h" + #include "hping2.h" -- cgit v1.2.3