From 50304222342085e69bed3d995c14a4d7be715353 Mon Sep 17 00:00:00 2001 From: MCApollo <34170230+MCApollo@users.noreply.github.com> Date: Mon, 13 May 2019 20:08:31 +0000 Subject: Added hping --- data/hping/.beer | 62 ++++++++++++++++++++++++++++++++++ data/hping/_metadata/description | 1 + data/hping/_metadata/homepage | 1 + data/hping/_metadata/in.1443.00 | 0 data/hping/_metadata/libpcap1.dep | 1 + data/hping/_metadata/maintainer | 1 + data/hping/_metadata/name | 1 + data/hping/_metadata/priority | 1 + data/hping/_metadata/role | 1 + data/hping/_metadata/section | 1 + data/hping/_metadata/tags | 1 + data/hping/_metadata/version | 1 + data/hping/brew-patch.diff | 13 +++++++ data/hping/byteorder.h | 8 +++++ data/hping/configure.diff | 43 +++++++++++++++++++++++ data/hping/download.sh | 1 + data/hping/hping3-20051105.tar.gz | Bin 0 -> 584001 bytes data/hping/make.sh | 5 +++ data/hping/patch-Makefile.in.diff | 45 ++++++++++++++++++++++++ data/hping/patch-ars.c.diff | 11 ++++++ data/hping/patch-bytesex.h.diff | 10 ++++++ data/hping/patch-libpcap_stuff.c.diff | 13 +++++++ data/hping/patch-sendip.c.diff | 20 +++++++++++ data/hping/patches.sh | 21 ++++++++++++ 24 files changed, 262 insertions(+) create mode 100644 data/hping/.beer create mode 100644 data/hping/_metadata/description create mode 100644 data/hping/_metadata/homepage create mode 100644 data/hping/_metadata/in.1443.00 create mode 120000 data/hping/_metadata/libpcap1.dep create mode 120000 data/hping/_metadata/maintainer create mode 100644 data/hping/_metadata/name create mode 100644 data/hping/_metadata/priority create mode 100644 data/hping/_metadata/role create mode 100644 data/hping/_metadata/section create mode 100644 data/hping/_metadata/tags create mode 100644 data/hping/_metadata/version create mode 100644 data/hping/brew-patch.diff create mode 100644 data/hping/byteorder.h create mode 100644 data/hping/configure.diff create mode 100755 data/hping/download.sh create mode 100644 data/hping/hping3-20051105.tar.gz create mode 100644 data/hping/make.sh create mode 100644 data/hping/patch-Makefile.in.diff create mode 100644 data/hping/patch-ars.c.diff create mode 100644 data/hping/patch-bytesex.h.diff create mode 100644 data/hping/patch-libpcap_stuff.c.diff create mode 100644 data/hping/patch-sendip.c.diff create mode 100755 data/hping/patches.sh diff --git a/data/hping/.beer b/data/hping/.beer new file mode 100644 index 000000000..9125168ee --- /dev/null +++ b/data/hping/.beer @@ -0,0 +1,62 @@ +{ + "name": "Hping", + "description": "Command-line oriented TCP/IP packet assembler/analyzer", + "url": "http://www.hping.org/hping3-20051105.tar.gz", + "mirror": "https://dl.bintray.com/homebrew/mirror/hping-3.20051105.tar.gz", + "homepage": "http://www.hping.org/", + "depends": [], + "resource": [], + "conflicts": [], + "patches": [ + { + "url": "https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-libpcap_stuff.c.diff", + "strip": "0" + }, + { + "url": "https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-ars.c.diff", + "strip": "0" + }, + { + "url": "https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-sendip.c.diff", + "strip": "0" + }, + { + "url": "https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-Makefile.in.diff", + "strip": "0" + }, + { + "url": "https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-bytesex.h.diff", + "strip": "0" + }, + { + "url": null, + "data": [ + "diff --git a/gethostname.c b/gethostname.c\n", + "index 3d0ea58..a8a9699 100644\n", + "--- a/gethostname.c\n", + "+++ b/gethostname.c\n", + "@@ -18,8 +18,6 @@\n", + " #include \n", + " #include \n", + " \n", + "-size_t strlcpy(char *dst, const char *src, size_t siz);\n", + "-\n", + " char *get_hostname(char* addr)\n", + " {\n", + " \tstatic char answer[1024];\n" + ] + } + ], + "install": [ + "system \"./configure\", \"--no-tcl\"", + "sbin.mkpath", + "man8.mkpath", + "system \"make\", \"CC=#{ENV.cc}\",", + "\"COMPILE_TIME=#{ENV.cflags}\",", + "\"INSTALL_PATH=#{prefix}\",", + "\"INSTALL_MANPATH=#{man}\",", + "\"install\"" + ], + "version": "20051105", + "file": "hping.rb" +} \ No newline at end of file diff --git a/data/hping/_metadata/description b/data/hping/_metadata/description new file mode 100644 index 000000000..7e48567b3 --- /dev/null +++ b/data/hping/_metadata/description @@ -0,0 +1 @@ +Command-line oriented TCP/IP packet assembler/analyzer diff --git a/data/hping/_metadata/homepage b/data/hping/_metadata/homepage new file mode 100644 index 000000000..348790c1f --- /dev/null +++ b/data/hping/_metadata/homepage @@ -0,0 +1 @@ +http://www.hping.org/ diff --git a/data/hping/_metadata/in.1443.00 b/data/hping/_metadata/in.1443.00 new file mode 100644 index 000000000..e69de29bb diff --git a/data/hping/_metadata/libpcap1.dep b/data/hping/_metadata/libpcap1.dep new file mode 120000 index 000000000..5ea06b02d --- /dev/null +++ b/data/hping/_metadata/libpcap1.dep @@ -0,0 +1 @@ +../../libpcap1 \ No newline at end of file diff --git a/data/hping/_metadata/maintainer b/data/hping/_metadata/maintainer new file mode 120000 index 000000000..0c538aadb --- /dev/null +++ b/data/hping/_metadata/maintainer @@ -0,0 +1 @@ +../../../people/mac \ No newline at end of file diff --git a/data/hping/_metadata/name b/data/hping/_metadata/name new file mode 100644 index 000000000..552e4ec74 --- /dev/null +++ b/data/hping/_metadata/name @@ -0,0 +1 @@ +Hping diff --git a/data/hping/_metadata/priority b/data/hping/_metadata/priority new file mode 100644 index 000000000..134d9bc32 --- /dev/null +++ b/data/hping/_metadata/priority @@ -0,0 +1 @@ +optional diff --git a/data/hping/_metadata/role b/data/hping/_metadata/role new file mode 100644 index 000000000..52b4d7301 --- /dev/null +++ b/data/hping/_metadata/role @@ -0,0 +1 @@ +hacker diff --git a/data/hping/_metadata/section b/data/hping/_metadata/section new file mode 100644 index 000000000..8708e4b54 --- /dev/null +++ b/data/hping/_metadata/section @@ -0,0 +1 @@ +Networking diff --git a/data/hping/_metadata/tags b/data/hping/_metadata/tags new file mode 100644 index 000000000..ad5d50831 --- /dev/null +++ b/data/hping/_metadata/tags @@ -0,0 +1 @@ +purpose::console diff --git a/data/hping/_metadata/version b/data/hping/_metadata/version new file mode 100644 index 000000000..b3f35f91a --- /dev/null +++ b/data/hping/_metadata/version @@ -0,0 +1 @@ +20051105 diff --git a/data/hping/brew-patch.diff b/data/hping/brew-patch.diff new file mode 100644 index 000000000..c8a54dec2 --- /dev/null +++ b/data/hping/brew-patch.diff @@ -0,0 +1,13 @@ +diff --git a/gethostname.c b/gethostname.c +index 3d0ea58..a8a9699 100644 +--- a/gethostname.c ++++ b/gethostname.c +@@ -18,8 +18,6 @@ + #include + #include + +-size_t strlcpy(char *dst, const char *src, size_t siz); +- + char *get_hostname(char* addr) + { + static char answer[1024]; diff --git a/data/hping/byteorder.h b/data/hping/byteorder.h new file mode 100644 index 000000000..a79fdacca --- /dev/null +++ b/data/hping/byteorder.h @@ -0,0 +1,8 @@ +#ifndef __BYTEORDER_H +#define __BYTEORDER_H + +#ifndef __LITTLE_ENDIAN_BITFIELD +#define __LITTLE_ENDIAN_BITFIELD +#endif /* __LITTLE_ENDIAN_BITFIELD */ + +#endif /* __BYTEORDER_H */ diff --git a/data/hping/configure.diff b/data/hping/configure.diff new file mode 100644 index 000000000..9396fb9fc --- /dev/null +++ b/data/hping/configure.diff @@ -0,0 +1,43 @@ +diff -ur hping3-20051105/configure hping3-20051105+iPhone/configure +--- hping3-20051105/configure 2004-06-04 06:39:10.000000000 +0000 ++++ hping3-20051105+iPhone/configure 2019-05-13 19:59:05.550325991 +0000 +@@ -22,7 +22,7 @@ + if [ "$INSTALL_MANPATH" = "" ]; then + INSTALL_MANPATH="/usr/local/man" + fi +-BYTEORDER=`./byteorder -m` ++BYTEORDER=__LITTLE_ENDIAN_BITFIELD + + echo create byteorder.h... + cat > byteorder.h < Found Tclsh in: $TCLSH" +- fi +- fi +- done +-done + if [ -f $TCLSH ] + then + TCL_VER=`echo puts \\$tcl_version | $TCLSH -` diff --git a/data/hping/download.sh b/data/hping/download.sh new file mode 100755 index 000000000..933771b20 --- /dev/null +++ b/data/hping/download.sh @@ -0,0 +1 @@ +wget http://www.hping.org/hping3-20051105.tar.gz || wget https://dl.bintray.com/homebrew/mirror/hping-3.20051105.tar.gz \ No newline at end of file diff --git a/data/hping/hping3-20051105.tar.gz b/data/hping/hping3-20051105.tar.gz new file mode 100644 index 000000000..7799c2106 Binary files /dev/null and b/data/hping/hping3-20051105.tar.gz differ diff --git a/data/hping/make.sh b/data/hping/make.sh new file mode 100644 index 000000000..90e8fc50b --- /dev/null +++ b/data/hping/make.sh @@ -0,0 +1,5 @@ +pkg:setup +make distclean +CONFIGOSTYPE="Darwin" CC="${PKG_TARG}-gcc" ./configure --no-tcl +pkg: mkdir -p "${PKG_TAPF}"/sbin +pkg:install INSTALL_PATH="${PKG_DEST}/${PKG_TAPF}" INSTALL_MANPATH="${PKG_DEST}/${PKG_TAPF}"/share/man diff --git a/data/hping/patch-Makefile.in.diff b/data/hping/patch-Makefile.in.diff new file mode 100644 index 000000000..776cd8b3d --- /dev/null +++ b/data/hping/patch-Makefile.in.diff @@ -0,0 +1,45 @@ +diff -ur hping3-20051105/Makefile.in hping3-20051105+iPhone/Makefile.in +--- hping3-20051105/Makefile.in 2004-04-09 23:38:56.000000000 +0000 ++++ hping3-20051105+iPhone/Makefile.in 2019-05-13 20:02:36.242406634 +0000 +@@ -14,7 +14,8 @@ + #uncomment the following if you need libpcap based build under linux + #(not raccomanded) + COMPILE_TIME= +-INSTALL_MANPATH=@MANPATH@ ++INSTALL_PATH= ++INSTALL_MANPATH= + @PCAP@ + + ARSOBJ = ars.o apd.o split.o rapd.o +@@ -52,7 +53,6 @@ + hping3: byteorder.h $(OBJ) + $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ + @echo +- ./hping3 -v + @echo "use \`make strip' to strip hping3 binary" + @echo "use \`make install' to install hping3" + +@@ -60,7 +60,7 @@ + $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl + + byteorder.h: +- ./configure ++ true + + .c.o: + $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $< +@@ -72,10 +72,10 @@ + rm -rf hping3 *.o byteorder byteorder.h systype.h Makefile libars.a .depend + + install: hping3 +- cp -f hping3 /usr/sbin/ +- chmod 755 /usr/sbin/hping3 +- ln -s /usr/sbin/hping3 /usr/sbin/hping +- ln -s /usr/sbin/hping3 /usr/sbin/hping2 ++ cp -f hping3 ${INSTALL_PATH}/sbin/ ++ chmod 755 ${INSTALL_PATH}/sbin/hping3 ++ ln -s ${INSTALL_PATH}/sbin/hping3 ${INSTALL_PATH}/sbin/hping ++ ln -s ${INSTALL_PATH}/sbin/hping3 ${INSTALL_PATH}/sbin/hping2 + @if [ -d ${INSTALL_MANPATH}/man8 ]; then \ + cp ./docs/hping3.8 ${INSTALL_MANPATH}/man8; \ + chmod 644 ${INSTALL_MANPATH}/man8/hping3.8; \ diff --git a/data/hping/patch-ars.c.diff b/data/hping/patch-ars.c.diff new file mode 100644 index 000000000..74d0e4fe4 --- /dev/null +++ b/data/hping/patch-ars.c.diff @@ -0,0 +1,11 @@ +--- a/ars.c.orig 2004-04-14 14:30:18.000000000 +0200 ++++ b/ars.c 2007-04-05 21:05:19.000000000 +0200 +@@ -914,7 +914,7 @@ + return -ARS_INVALID; + } + ip = (struct ars_iphdr*) packet; +-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI ++#if defined OSTYPE_DARWIN || OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI + ip->tot_len = ntohs(ip->tot_len); + ip->frag_off = ntohs(ip->frag_off); + #endif diff --git a/data/hping/patch-bytesex.h.diff b/data/hping/patch-bytesex.h.diff new file mode 100644 index 000000000..8e55a832b --- /dev/null +++ b/data/hping/patch-bytesex.h.diff @@ -0,0 +1,10 @@ +--- a/bytesex.h.orig 2009-09-08 11:44:23.000000000 -0700 ++++ b/bytesex.h 2009-09-08 11:45:16.000000000 -0700 +@@ -8,6 +8,7 @@ + #define ARS_BYTESEX_H + + #if defined(__i386__) \ ++ || defined(__LITTLE_ENDIAN__) \ + || defined(__alpha__) \ + || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) + #define BYTE_ORDER_LITTLE_ENDIAN diff --git a/data/hping/patch-libpcap_stuff.c.diff b/data/hping/patch-libpcap_stuff.c.diff new file mode 100644 index 000000000..6914899ab --- /dev/null +++ b/data/hping/patch-libpcap_stuff.c.diff @@ -0,0 +1,13 @@ +--- a/libpcap_stuff.c.orig Sat Apr 10 06:38:56 2004 ++++ b/libpcap_stuff.c Tue Apr 12 20:21:56 2005 +@@ -16,8 +16,8 @@ + #include + #include + #include +-#include + #include ++#include + + #include "globals.h" + + diff --git a/data/hping/patch-sendip.c.diff b/data/hping/patch-sendip.c.diff new file mode 100644 index 000000000..e52bf73bd --- /dev/null +++ b/data/hping/patch-sendip.c.diff @@ -0,0 +1,20 @@ +--- a/sendip.c.orig 2004-04-10 01:38:56.000000000 +0200 ++++ b/sendip.c 2007-04-05 21:05:10.000000000 +0200 +@@ -48,7 +48,7 @@ + ip->ihl = (IPHDR_SIZE + optlen + 3) >> 2; + ip->tos = ip_tos; + +-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI ++#if defined OSTYPE_DARWIN || OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI + /* FreeBSD */ + /* NetBSD */ + ip->tot_len = packetsize; +@@ -73,7 +73,7 @@ + htons((unsigned short) src_id); + } + +-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD | defined OSTYPE_BSDI ++#if defined OSTYPE_DARWIN || OSTYPE_FREEBSD || defined OSTYPE_NETBSD | defined OSTYPE_BSDI + /* FreeBSD */ + /* NetBSD */ + ip->frag_off |= more_fragments; diff --git a/data/hping/patches.sh b/data/hping/patches.sh new file mode 100755 index 000000000..0909f0efa --- /dev/null +++ b/data/hping/patches.sh @@ -0,0 +1,21 @@ +wget https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-libpcap_stuff.c.diff +wget https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-ars.c.diff +wget https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-sendip.c.diff +wget https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-Makefile.in.diff +wget https://raw.githubusercontent.com/Homebrew/formula-patches/fc1d446f/hping/patch-bytesex.h.diff +echo 'Creating brew-patch.diff' +cat << EOF >> brew-patch.diff +diff --git a/gethostname.c b/gethostname.c +index 3d0ea58..a8a9699 100644 +--- a/gethostname.c ++++ b/gethostname.c +@@ -18,8 +18,6 @@ + #include + #include + +-size_t strlcpy(char *dst, const char *src, size_t siz); +- + char *get_hostname(char* addr) + { + static char answer[1024]; +EOF -- cgit v1.2.3