--- hping3-3.a2.ds2.orig/debian/README.source +++ hping3-3.a2.ds2/debian/README.source @@ -0,0 +1,47 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- hping3-3.a2.ds2.orig/debian/changelog +++ hping3-3.a2.ds2/debian/changelog @@ -0,0 +1,157 @@ +hping3 (3.a2.ds2-6.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/control: Replace the obsolete tcl8.4-dev package by tcl-dev in + build dependencies (Closes: #725324). + + -- Sergei Golovan Thu, 31 Oct 2013 12:42:30 +0400 + +hping3 (3.a2.ds2-6) unstable; urgency=low + + * debian/patches/140_data_size_udp.diff: Fix incorrect data size + check for UDP (Closes: #546590), thanks to Luca Bigliardi. + * debian/patches/150_gnu_kfreebsd.diff: Fix FTBFS for kfreebsd-{i386,amd64}. + * debian/patches/160_tcp_mss.diff: Add support to TCP MSS from NetBSD: + patch-aa, patch-ai, patch-aj, patch-ak, patch-al, patch-am, patch-an + (Closes: #409391). + + -- Guillaume Delacour Sat, 19 Sep 2009 12:35:34 +0000 + +hping3 (3.a2.ds2-5) unstable; urgency=low + + * debian/patches/080_ip_id_field.diff: Add description to header. + * debian/patches/090_fr_manpage.diff: + + use hping2 fr manpage for hping3 (already included in source). + * debian/patches/100_hyphen_used_as_minus_sign.diff + + Add "\" to "-" in english and fr manpage (as suggested by lintian). + * debian/patches/110_dontfrag_offbyone.diff: + Don't clear packet size if final size equivalent to MTU + (Closes: #537704), thanks to Christian Mock. + * debian/patches/120_rtt_icmp_unreachable.diff: + Add RTT handling for ICMP destination unreachable packets + (Closes: #248273), thanks to Baruch Even. + * debian/patches + * debian/watch: + + Add empty but documented file (to explain why). + * Bump to debhelper compatibility 7. + * Bump Standards-Version to 3.8.3, no changes needed. + * debian/control: change the git repo location. + * debian/compat: Bump to 7 (replace dh_clean -k by dh_prep in install rule) + * debian/copyright: Adjust licences on BSD style sources. + + -- Guillaume Delacour Fri, 04 Sep 2009 23:48:19 +0000 + +hping3 (3.a2.ds2-4) unstable; urgency=low + + * New maintainer (Closes: #522830) + * debian/control: + + Bump Standards-Version to 3.8.1, no changes needed. + * debian/copyright: + + /usr/share/common-licenses -> /usr/share/common-licenses/GPL-2 + + Change download url (previous http://wiki.hping.org/101 returns 404) + * debian/patches/80_ip_id_field.diff: + + Include patch to fix "-N" command line argument (Closes: #482844). + + -- Guillaume Delacour Wed, 13 May 2009 16:39:41 +0000 + +hping3 (3.a2.ds2-3) unstable; urgency=low + + * debian/control: Set maintainer to Debian QA group. + + -- Romain Francoise Mon, 06 Apr 2009 21:53:32 +0200 + +hping3 (3.a2.ds2-2) unstable; urgency=low + + * debian/control: + + Use "Tcl", not "TCL" in long description. + + Bump Standards-Version to 3.7.3, no changes needed. + * debian/patches/70_tcl.diff: New patch, change libtcl detection logic + to use the same version as the default tclsh instead of looking for + the newest installed library. + * debian/patches/series: Update. + + -- Romain Francoise Sat, 08 Mar 2008 19:44:14 +0100 + +hping3 (3.a2.ds2-1) unstable; urgency=low + + * debian/control: Add Vcs-Git and Vcs-Browser fields. + + -- Romain Francoise Mon, 08 Oct 2007 22:38:26 +0200 + +hping3 (3.a2.ds1-5) unstable; urgency=low + + * debian/control: Move upstream URL to the Homepage field. + + -- Romain Francoise Fri, 28 Sep 2007 21:25:40 +0200 + +hping3 (3.a2.ds1-4) unstable; urgency=low + + * Convert to quilt for patch management: + + debian/control: Build-Depend on quilt (>= 0.40) instead of dpatch. + + debian/rules: Include /usr/share/quilt/quilt.make. + + Convert all dpatch patches to regular patches. + + * debian/control: Bump Standards-Version to 3.7.2, no changes needed. + * debian/rules: Don't ignore errors from make distclean. + + -- Romain Francoise Thu, 30 Aug 2007 22:12:04 +0200 + +hping3 (3.a2.ds1-3) unstable; urgency=low + + * debian/control: + + Add extra space before the Homepage pseudo-header (closes: #365483). + + Bump Standards-Version to 3.7.0, no changes needed. + + -- Romain Francoise Mon, 1 May 2006 19:52:39 +0200 + +hping3 (3.a2.ds1-2) unstable; urgency=low + + * debian/copyright: Update FSF's address. + * debian/compat: Switch to compatibility level 5. + * debian/control: + + Bump Standards-Version to 3.6.2.1, no changes needed. + + Build-Depend on debhelper (>= 5.0.0). + + -- Romain Francoise Sun, 18 Dec 2005 15:14:11 +0100 + +hping3 (3.a2.ds1-1) unstable; urgency=low + + * New maintainer. + * Repackaged as 3.a2.ds1 to remove non-free RFC texts. + * debian/control: + + Build-Depend on libpcap0.8-dev, dpatch (>= 2.0.9). + + Change priority to extra. + + Slightly reword long description. + + Update maintainer contact info. + * debian/copyright: Update maintainer contact info. + * debian/rules: + + Fix dpatch integration. + + Ship hping3 TCL scripts as examples (and forcibly leave them + uncompressed). + + Various cleanups. + * debian/patches/10_install.dpatch: New patch based on previous + "Makefilein.dpatch". + * debian/patches/20_libpcap0.8.dpatch: New patch for libpcap0.8 + compilation. + * debian/patches/30_bytesex.dpatch: New patch stolen from my hping2 + package to make bytesex.h use endian.h instead of hardcoding byte + orders; many thanks to Peter De Schrijver who provided a similar patch + (closes: #283038). + * debian/patches/40_spelling.dpatch: New patch stolen from my hping2 + package to fix various spelling errors in hping. + * debian/patches/50_personality.dpatch: New patch, change all + occurrences of "hping2" to "hping3" in help messages and in the man + page. Also say "hping3" instead of "hping" since the latter is really + hping2 in Debian. + * debian/patches/60_version.dpatch: New patch, this is really version + alpha-2 so fix release.h accordingly. + * debian/patches/00list: New file. + + -- Romain Francoise Sat, 12 Mar 2005 14:15:32 +0100 + +hping3 (3.a2-1) unstable; urgency=low + + * Initial Release. (Closes: #267153) + + -- Vincent Tantardini Sun, 10 Oct 2004 20:24:03 +0200 + --- hping3-3.a2.ds2.orig/debian/compat +++ hping3-3.a2.ds2/debian/compat @@ -0,0 +1 @@ +7 --- hping3-3.a2.ds2.orig/debian/control +++ hping3-3.a2.ds2/debian/control @@ -0,0 +1,23 @@ +Source: hping3 +Section: net +Priority: extra +Maintainer: Guillaume Delacour +Build-Depends: debhelper (>= 7), libpcap0.8-dev, tcl-dev, quilt (>= 0.40) +Standards-Version: 3.8.3 +Homepage: http://www.hping.org/ +Vcs-Browser: http://git.debian.org/?p=collab-maint/hping3.git +Vcs-Git: git://git.debian.org/collab-maint/hping3.git + +Package: hping3 +Architecture: any +Depends: ${shlibs:Depends} +Description: Active Network Smashing Tool + hping3 is a network tool able to send custom ICMP/UDP/TCP packets and + to display target replies like ping does with ICMP replies. It handles + fragmentation and arbitrary packet body and size, and can be used to + transfer files under supported protocols. Using hping3, you can test + firewall rules, perform (spoofed) port scanning, test network + performance using different protocols, do path MTU discovery, perform + traceroute-like actions under different protocols, fingerprint remote + operating systems, audit TCP/IP stacks, etc. hping3 is scriptable + using the Tcl language. --- hping3-3.a2.ds2.orig/debian/copyright +++ hping3-3.a2.ds2/debian/copyright @@ -0,0 +1,42 @@ +This package was debianized by Vincent Tantardini on +Sun, 10 Oct 2004 20:24:03 +0200. +Previously maintained by Romain Francoise (until 2009) +and now by Guillaume Delacour + +It was downloaded from http://www.hping.org/download.php + +Copyright: + + hping3 is Copyright (C) 1998, 2004 by Salvatore Sanfilippo. + +Upstream Author: + + Salvatore Sanfilippo + +License: + + GPL-2 + + However, some files are licenced under other licences: + + display_ipopt.c : from ping, BSD style license (4-clause BSD) + libpcap library : BSD style license (3-clause BSD) + + On Debian systems, the complete text of the Modified BSD Licence + can be found in `/usr/share/common-licenses/BSD'. + +This package is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 dated June, 1991. + +This package is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. --- hping3-3.a2.ds2.orig/debian/dirs +++ hping3-3.a2.ds2/debian/dirs @@ -0,0 +1 @@ +usr/sbin --- hping3-3.a2.ds2.orig/debian/hping3.docs +++ hping3-3.a2.ds2/debian/hping3.docs @@ -0,0 +1,10 @@ +BUGS +NEWS +README +TODO +docs/APD.txt +docs/API.txt +docs/AS-BACKDOOR +docs/HPING3.txt +docs/MORE-FUN-WITH-IPID +docs/SPOOFED_SCAN.txt --- hping3-3.a2.ds2.orig/debian/hping3.examples +++ hping3-3.a2.ds2/debian/hping3.examples @@ -0,0 +1,13 @@ +lib/apd.htcl +lib/apd2.htcl +lib/ciscoios.htcl +lib/ciscoios0.htcl +lib/cloner.htcl +lib/hpingstdlib.htcl +lib/igrp.htcl +lib/nat-noise.htcl +lib/passivets.htcl +lib/ping.htcl +lib/raw.htcl +lib/show-tcpseq.htcl +lib/showled.htcl --- hping3-3.a2.ds2.orig/debian/hping3.manpages +++ hping3-3.a2.ds2/debian/hping3.manpages @@ -0,0 +1 @@ +docs/hping3.8 --- hping3-3.a2.ds2.orig/debian/patches/010_install.diff +++ hping3-3.a2.ds2/debian/patches/010_install.diff @@ -0,0 +1,40 @@ +Adjust upstream Makefile.in for Debian compilation. + +--- hping3-3.a2.ds1.orig/Makefile.in ++++ hping3-3.a2.ds1/Makefile.in +@@ -50,14 +50,14 @@ + $(RANLIB) $@ + + hping3: byteorder.h $(OBJ) +- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ ++ $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L$(prefix)/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ + @echo + ./hping3 -v + @echo "use \`make strip' to strip hping3 binary" + @echo "use \`make install' to install hping3" + + hping3-static: byteorder.h $(OBJ) +- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl ++ $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L$(prefix)/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl + + byteorder.h: + ./configure +@@ -72,17 +72,7 @@ + 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 +- @if [ -d ${INSTALL_MANPATH}/man8 ]; then \ +- cp ./docs/hping3.8 ${INSTALL_MANPATH}/man8; \ +- chmod 644 ${INSTALL_MANPATH}/man8/hping3.8; \ +- else \ +- echo "@@@@@@ WARNING @@@@@@"; \ +- echo "Can't install the man page: ${INSTALL_MANPATH}/man8 does not exist"; \ +- fi ++ install -m 0755 hping3 $(DESTDIR)/usr/sbin/ + + strip: hping3 + @ls -l ./hping3 --- hping3-3.a2.ds2.orig/debian/patches/020_libpcap0.8.diff +++ hping3-3.a2.ds2/debian/patches/020_libpcap0.8.diff @@ -0,0 +1,22 @@ +Various fixes for libpcap0.8 compilation. + +--- hping3-3.a2.ds1.orig/libpcap_stuff.c ++++ hping3-3.a2.ds1/libpcap_stuff.c +@@ -17,7 +17,6 @@ + #include + #include + #include +-#include + + #include "globals.h" + +--- hping3-3.a2.ds1.orig/script.c ++++ hping3-3.a2.ds1/script.c +@@ -24,7 +24,6 @@ + + #include + #include +-#include + + #include "release.h" + #include "hping2.h" --- hping3-3.a2.ds2.orig/debian/patches/030_bytesex.diff +++ hping3-3.a2.ds2/debian/patches/030_bytesex.diff @@ -0,0 +1,25 @@ +Endianness fixes. + +--- hping3-3.a2.ds1.orig/bytesex.h ++++ hping3-3.a2.ds1/bytesex.h +@@ -7,16 +7,11 @@ + #ifndef ARS_BYTESEX_H + #define ARS_BYTESEX_H + +-#if defined(__i386__) \ +- || defined(__alpha__) \ +- || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) ++#include ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN + #define BYTE_ORDER_LITTLE_ENDIAN +-#elif defined(__mc68000__) \ +- || defined (__sparc__) \ +- || defined (__sparc) \ +- || defined (__PPC__) \ +- || defined (__BIG_ENDIAN__) \ +- || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__))) ++#elif __BYTE_ORDER == __BIG_ENDIAN + #define BYTE_ORDER_BIG_ENDIAN + #else + # error can not find the byte order for this architecture, fix bytesex.h --- hping3-3.a2.ds2.orig/debian/patches/040_spelling.diff +++ hping3-3.a2.ds2/debian/patches/040_spelling.diff @@ -0,0 +1,24 @@ +Various spelling fixes. + +--- hping3-3.a2.ds1.orig/antigetopt.c ++++ hping3-3.a2.ds1/antigetopt.c +@@ -142,7 +142,7 @@ + #define UNK_LONG_ERRSTRING "unrecognized option `--%s'\n" + #define ARG_SHORT_ERRSTRING "option requires an argument -- %c\n" + #define ARG_LONG_ERRSTRING "option `--%s' requires an argument\n" +-#define AMB_ERRSTRING "option `--%s' is ambiguos\n" ++#define AMB_ERRSTRING "option `--%s' is ambiguous\n" + #define IERR_ERRSTRING "internal error. ago_gnu_error() called with " \ + "a bad error code (%d)\n" + void ago_gnu_error(char *pname, int error) +--- hping3-3.a2.ds1.orig/statistics.c ++++ hping3-3.a2.ds1/statistics.c +@@ -30,7 +30,7 @@ + lossrate = 100; + + fprintf(stderr, "\n--- %s hping statistic ---\n", targetname); +- fprintf(stderr, "%d packets tramitted, %d packets received, " ++ fprintf(stderr, "%d packets transmitted, %d packets received, " + "%d%% packet loss\n", sent_pkt, recv_pkt, lossrate); + if (out_of_sequence_pkt) + fprintf(stderr, "%d out of sequence packets received\n", --- hping3-3.a2.ds2.orig/debian/patches/050_personality.diff +++ hping3-3.a2.ds2/debian/patches/050_personality.diff @@ -0,0 +1,301 @@ +Say hping3, not hping2. + +--- hping3-3.a2.ds1.orig/docs/hping3.8 ++++ hping3-3.a2.ds1/docs/hping3.8 +@@ -1,8 +1,8 @@ +-.TH HPING2 8 "2001 Aug 14" ++.TH HPING3 8 "2001 Aug 14" + .SH NAME +-hping2 \- send (almost) arbitrary TCP/IP packets to network hosts ++hping3 \- send (almost) arbitrary TCP/IP packets to network hosts + .SH SYNOPSIS +-.B hping2 ++.B hping3 + [ + .B \-hvnqVDzZ012WrfxykQbFSRPAUXYjJBuTG + ] [ +@@ -116,11 +116,11 @@ + .br + .ad + .SH DESCRIPTION +-hping2 is a network tool able to send custom TCP/IP packets and to +-display target replies like ping program does with ICMP replies. hping2 ++hping3 is a network tool able to send custom TCP/IP packets and to ++display target replies like ping program does with ICMP replies. hping3 + handle fragmentation, arbitrary packets body and size and can be used in + order to transfer files encapsulated under supported protocols. Using +-hping2 you are able to perform at least the following stuff: ++hping3 you are able to perform at least the following stuff: + + - Test firewall rules + - Advanced port scanning +@@ -136,7 +136,7 @@ + - A lot of others. + + .IR "It's also a good didactic tool to learn TCP/IP" . +-hping2 is developed and maintained by antirez@invece.org and is ++hping3 is developed and maintained by antirez@invece.org and is + licensed under GPL version 2. Development is open so you can send + me patches, suggestion and affronts without inhibitions. + .SH HPING SITE +@@ -158,7 +158,7 @@ + .I -c --count count + Stop after sending (and receiving) + .I count +-response packets. After last packet was send hping2 wait COUNTREACHED_TIMEOUT ++response packets. After last packet was send hping3 wait COUNTREACHED_TIMEOUT + seconds target host replies. You are able to tune COUNTREACHED_TIMEOUT editing + hping2.h + .TP +@@ -171,10 +171,10 @@ + .I wait + to X micro seconds. + The default is to wait +-one second between each packet. Using hping2 to transfer files tune this ++one second between each packet. Using hping3 to transfer files tune this + option is really important in order to increase transfer rate. Even using +-hping2 to perform idle/spoofing scanning you should tune this option, see +-.B HPING2-HOWTO ++hping3 to perform idle/spoofing scanning you should tune this option, see ++.B HPING3-HOWTO + for more information. + .TP + .I --fast +@@ -195,13 +195,13 @@ + startup time and when finished. + .TP + .I -I --interface interface name +-By default on linux and BSD systems hping2 uses default routing interface. ++By default on linux and BSD systems hping3 uses default routing interface. + In other systems or when there is no default route +-hping2 uses the first non-loopback interface. +-However you are able to force hping2 to use the interface you need using ++hping3 uses the first non-loopback interface. ++However you are able to force hping3 to use the interface you need using + this option. Note: you don't need to specify the whole name, for + example -I et will match eth0 ethernet0 myet1 et cetera. If no interfaces +-match hping2 will try to use lo. ++match hping3 will try to use lo. + .TP + .I -V --verbose + Enable verbose output. TCP replies will be shown as follows: +@@ -211,7 +211,7 @@ + .TP + .I -D --debug + Enable debug mode, it's useful when you experience some problem with +-hping2. When debug mode is enabled you will get more information about ++hping3. When debug mode is enabled you will get more information about + .B interface detection, data link layer access, interface settings, options + .B parsing, fragmentation, HCMP protocol + and other stuff. +@@ -223,30 +223,30 @@ + CTRL+Z once or twice. + .TP + .I -Z --unbind +-Unbind CTRL+Z so you will able to stop hping2. ++Unbind CTRL+Z so you will able to stop hping3. + .TP + .I --beep + Beep for every matching received packet (but not for ICMP errors). + .SH PROTOCOL SELECTION +-Default protocol is TCP, by default hping2 will send tcp headers to target ++Default protocol is TCP, by default hping3 will send tcp headers to target + host's port 0 with a winsize of 64 without any tcp flag on. Often this + is the best way to do an 'hide ping', useful when target is behind + a firewall that drop ICMP. Moreover a tcp null-flag to port 0 has a good + probability of not being logged. + .TP + .I -0 --rawip +-RAW IP mode, in this mode hping2 will send IP header with data ++RAW IP mode, in this mode hping3 will send IP header with data + appended with --signature and/or --file, see also --ipproto that + allows you to set the ip protocol field. + .TP + .I -1 --icmp +-ICMP mode, by default hping2 will send ICMP echo-request, you can set ++ICMP mode, by default hping3 will send ICMP echo-request, you can set + other ICMP type/code using + .B --icmptype --icmpcode + options. + .TP + .I -2 --udp +-UDP mode, by default hping2 will send udp to target host's port 0. ++UDP mode, by default hping3 will send udp to target host's port 0. + UDP header tunable options are the following: + .B --baseport, --destport, --keep. + .TP +@@ -288,11 +288,11 @@ + shows interesting details. + .TP + .I -9 --listen signature +-HPING2 listen mode, using this option hping2 waits for packet that contain ++HPING3 listen mode, using this option hping3 waits for packet that contain + .I signature + and dump from + .I signature +-end to packet's end. For example if hping2 --listen TEST reads a packet ++end to packet's end. For example if hping3 --listen TEST reads a packet + that contain + .B 234-09sdflkjs45-TESThello_world + it will display +@@ -304,7 +304,7 @@ + ensures that target will not gain your real address. However replies + will be sent to spoofed address, so you will can't see them. In order + to see how it's possible to perform spoofed/idle scanning see the +-.BR HPING2-HOWTO . ++.BR HPING3-HOWTO . + .TP + .I --rand-source + This option enables the +@@ -347,7 +347,7 @@ + or + .B --bind + options. If in doubt try +-.BR "" "`" "hping2 some.host.com -t 1 --traceroute" "'." ++.BR "" "`" "hping3 some.host.com -t 1 --traceroute" "'." + .TP + .I -N --id + Set ip->id field. Default id is random but if fragmentation is turned on +@@ -361,11 +361,11 @@ + .I -W --winid + id from Windows* systems before Win2k has different byte ordering, if this + option is enable +-hping2 will properly display id replies from those Windows. ++hping3 will properly display id replies from those Windows. + .TP + .I -r --rel + Display id increments instead of id. See the +-.B HPING2-HOWTO ++.B HPING3-HOWTO + for more information. Increments aren't computed as id[N]-id[N-1] but + using packet loss compensation. See relid.c for more information. + .TP +@@ -445,7 +445,7 @@ + .SH TCP/UDP RELATED OPTIONS + .TP + .I -s --baseport source port +-hping2 uses source port in order to guess replies sequence number. It ++hping3 uses source port in order to guess replies sequence number. It + starts with a base source port number, and increase this number for each + packet sent. When packet is received sequence number can be computed as + .IR "replies.dest.port - base.source.port" . +@@ -485,7 +485,7 @@ + by target host. This can be useful when you need to analyze whether + TCP sequence number is predictable. Output example: + +-.B #hping2 win98 --seqnum -p 139 -S -i u1 -I eth0 ++.B #hping3 win98 --seqnum -p 139 -S -i u1 -I eth0 + .nf + HPING uaz (eth0 192.168.4.41): S set, 40 headers + 0 data bytes + 2361294848 +2361294848 +@@ -540,8 +540,8 @@ + .SH COMMON OPTIONS + .TP + .I -d --data data size +-Set packet body size. Warning, using --data 40 hping2 will not generate +-0 byte packets but protocol_header+40 bytes. hping2 will display ++Set packet body size. Warning, using --data 40 hping3 will not generate ++0 byte packets but protocol_header+40 bytes. hping3 will display + packet size information as first line output, like this: + .B HPING www.yahoo.com (ppp0 204.71.200.67): NO FLAGS are set, 40 headers + 40 data bytes + .TP +@@ -577,9 +577,9 @@ + A to host B you may use the following: + .nf + .I [host_a] +-.B # hping2 host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd ++.B # hping3 host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd + .I [host_b] +-.B # hping2 host_a --listen signature --safe --icmp ++.B # hping3 host_a --listen signature --safe --icmp + .fi + .TP + .I -u --end +@@ -587,13 +587,13 @@ + .I --file filename + option, tell you when EOF has been reached. Moreover prevent that other end + accept more packets. Please, for more information see the +-.BR HPING2-HOWTO . ++.BR HPING3-HOWTO . + .TP + .I -T --traceroute +-Traceroute mode. Using this option hping2 will increase ttl for each ++Traceroute mode. Using this option hping3 will increase ttl for each + .B ICMP time to live 0 during transit + received. Try +-.BR "hping2 host --traceroute" . ++.BR "hping3 host --traceroute" . + This option implies --bind and --ttl 1. You can override the ttl of 1 + using the --ttl option. Since 2.0.0 stable it prints RTT information. + .TP +@@ -601,7 +601,7 @@ + Keep the TTL fixed in traceroute mode, so you can monitor just one hop + in the route. For example, to monitor how the 5th hop changes or + how its RTT changes you can try +-.BR "hping2 host --traceroute --ttl 5 --tr-keep-ttl" . ++.BR "hping3 host --traceroute --ttl 5 --tr-keep-ttl" . + .TP + .I --tr-stop + If this option is specified hping will exit once the first packet +--- hping3-3.a2.ds1.orig/main.c ++++ hping3-3.a2.ds1/main.c +@@ -193,8 +193,8 @@ + } + + if (parse_options(argc, argv) == -1) { +- printf("hping2: missing host argument\n" +- "Try `hping2 --help' for more information.\n"); ++ printf("hping3: missing host argument\n" ++ "Try `hping3 --help' for more information.\n"); + exit(1); + } + +@@ -298,7 +298,7 @@ + /* if we are in listemode enter in listenmain() else */ + /* print HPING... bla bla bla and enter in wait_packet() */ + if (opt_listenmode) { +- fprintf(stderr, "hping2 listen mode\n"); ++ fprintf(stderr, "hping3 listen mode\n"); + + /* memory protection */ + if (memlockall() == -1) { +--- hping3-3.a2.ds1.orig/parseoptions.c ++++ hping3-3.a2.ds1/parseoptions.c +@@ -215,12 +215,12 @@ + case AGO_UNKNOWN: + case AGO_REQARG: + case AGO_AMBIG: +- ago_gnu_error("hping", o); +- fprintf(stderr, "Try hping --help\n"); ++ ago_gnu_error("hping3", o); ++ fprintf(stderr, "Try hping3 --help\n"); + exit(1); + case AGO_ALONE: + if (targethost_set == 1) { +- fprintf(stderr, "hping: you must specify only " ++ fprintf(stderr, "hping3: you must specify only " + "one target host at a time\n"); + exit(1); + } else { +--- hping3-3.a2.ds1.orig/usage.c ++++ hping3-3.a2.ds1/usage.c +@@ -16,7 +16,7 @@ + void show_usage(void) + { + printf( +-"usage: hping host [options]\n" ++"usage: hping3 host [options]\n" + " -h --help show this help\n" + " -v --version show version\n" + " -c --count packet count\n" +--- hping3-3.a2.ds1.orig/version.c ++++ hping3-3.a2.ds1/version.c +@@ -18,7 +18,7 @@ + + void show_version(void) + { +- printf("hping version %s (%s)\n", RELEASE_VERSION, RELEASE_DATE); ++ printf("hping3 version %s (%s)\n", RELEASE_VERSION, RELEASE_DATE); + #ifdef USE_TCL + printf("This binary is TCL scripting capable\n"); + #else --- hping3-3.a2.ds2.orig/debian/patches/060_version.diff +++ hping3-3.a2.ds2/debian/patches/060_version.diff @@ -0,0 +1,13 @@ +Fix hping version. + +--- hping3-3.a2.ds1.orig/release.h ++++ hping3-3.a2.ds1/release.h +@@ -11,7 +11,7 @@ + #ifndef _RELEASE_H + #define _RELEASE_H + +-#define RELEASE_VERSION "3.0.0-alpha-1" ++#define RELEASE_VERSION "3.0.0-alpha-2" + #define RELEASE_DATE "$Id: release.h,v 1.4 2004/04/09 23:38:56 antirez Exp $" + #define CONTACTS "" + --- hping3-3.a2.ds2.orig/debian/patches/070_tcl.diff +++ hping3-3.a2.ds2/debian/patches/070_tcl.diff @@ -0,0 +1,13 @@ +Harcode libtcl version to be that of the default tclsh. + +--- a/configure ++++ b/configure +@@ -98,7 +98,7 @@ + fi + if [ -n $USE_TCL ] + then +- LIBPOSTFIX=`ls -1 /usr/local/lib/ /usr/lib | grep 'libtcl[0-9]' | grep so | sed -e 's/\.so.*//g' -e 's/libtcl//g' | sort -r | head -1` ++ LIBPOSTFIX=`echo puts \\$tcl_version | $TCLSH -` + TCL_LIB="-ltcl${LIBPOSTFIX} -lm -lpthread" + fi + --- hping3-3.a2.ds2.orig/debian/patches/080_ip_id_field.diff +++ hping3-3.a2.ds2/debian/patches/080_ip_id_field.diff @@ -0,0 +1,66 @@ +Fix "-N" command line argument + +--- a/docs/hping2.8 ++++ b/docs/hping2.8 +@@ -343,7 +343,7 @@ + .I -N --id + Set ip->id field. Default id is random but if fragmentation is turned on + and id isn't specified it will be +-.BR "getpid() & 0xFF" , ++.BR "getpid() & 0xFFFF" , + to implement a better solution is in TODO list. + .TP + .I -H --ipproto +@@ -714,4 +714,4 @@ + a solaris problem, as stated in the tcpdump-workers mailing list, + so the libpcap can't do nothing to handle it properly. + .SH SEE ALSO +-ping(8), traceroute(8), ifconfig(8), nmap(1) +\ No newline at end of file ++ping(8), traceroute(8), ifconfig(8), nmap(1) +--- a/docs/hping3.8 ++++ b/docs/hping3.8 +@@ -352,7 +352,7 @@ + .I -N --id + Set ip->id field. Default id is random but if fragmentation is turned on + and id isn't specified it will be +-.BR "getpid() & 0xFF" , ++.BR "getpid() & 0xFFFF" , + to implement a better solution is in TODO list. + .TP + .I -H --ipproto +--- a/hping2.h ++++ b/hping2.h +@@ -121,7 +121,7 @@ + #define DEFAULT_ICMP_IP_IHL (IPHDR_SIZE >> 2) + #define DEFAULT_ICMP_IP_TOS 0 + #define DEFAULT_ICMP_IP_TOT_LEN 0 /* computed by send_icmp_*() */ +-#define DEFAULT_ICMP_IP_ID 0 /* rand */ ++#define DEFAULT_ICMP_IP_ID -1 /* rand */ + #define DEFAULT_ICMP_CKSUM -1 /* -1 means compute the cksum */ + #define DEFAULT_ICMP_IP_PROTOCOL 6 /* TCP */ + #define DEFAULT_RAW_IP_PROTOCOL 6 /* TCP */ +--- a/parseoptions.c ++++ b/parseoptions.c +@@ -463,6 +463,10 @@ + break; + case OPT_ICMP_IPID: + icmp_ip_id = strtol(ago_optarg, NULL, 0); ++ if (icmp_ip_id < 0 || icmp_ip_id > 0xffff) { ++ fprintf(stderr, "Bad ICMP IP ID, resetting to random.\n"); ++ icmp_ip_id = DEFAULT_ICMP_IP_ID; ++ } + break; + case OPT_ICMP_IPPROTO: + icmp_ip_protocol = strtol(ago_optarg, NULL, 0); +--- a/sendicmp.c ++++ b/sendicmp.c +@@ -83,7 +83,7 @@ + icmp->type = opt_icmptype; /* echo replay or echo request */ + icmp->code = opt_icmpcode; /* should be indifferent */ + icmp->checksum = 0; +- icmp->un.echo.id = getpid() & 0xffff; ++ icmp->un.echo.id = icmp_ip_id == DEFAULT_ICMP_IP_ID ? getpid() & 0xffff : icmp_ip_id; + icmp->un.echo.sequence = _icmp_seq; + + /* data */ --- hping3-3.a2.ds2.orig/debian/patches/090_fr_manpage.diff +++ hping3-3.a2.ds2/debian/patches/090_fr_manpage.diff @@ -0,0 +1,276 @@ +Use of hping2 fr manpage + +--- a/docs/french/hping2-fr.8 ++++ b/docs/french/hping2-fr.8 +@@ -1,9 +1,9 @@ +-.TH HPING2 8 "2001 Aug 14" ++.TH HPING3 8 "2001 Aug 14" + .\" french translation by Denis Ducamp + .SH NOM +-hping2 \- envoie des paquets TCP/IP (presque) arbitraires à des systèmes réseaux ++hping3 \- envoie des paquets TCP/IP (presque) arbitraires à des systèmes réseaux + .SH RESUME +-.B hping2 ++.B hping3 + [ + .B \-hvnqVDzZ012WrfxykQbFSRPAUXYjJBuTG + ] [ +@@ -111,16 +111,19 @@ + ] [ + .B \-\-rand-source + ] ++] [ ++.B \-\-beep ++] + hostname + .br + .ad + .SH DESCRIPTION +-hping2 est un outil réseau capable d'envoyer des paquets TCP/IP sur ++hping3 est un outil réseau capable d'envoyer des paquets TCP/IP sur + commande et d'afficher les réponses de la cible comme le programme ping le +-fait avec les réponses ICMP. hping2 traite la fragmentation, les contenus de ++fait avec les réponses ICMP. hping3 traite la fragmentation, les contenus de + paquets et les tailles arbitraires, et peut être utilisé dans le but de + transférer des fichiers encapsulés dans les protocoles supportés. En +-utilisant hping2 vous êtes capable d'effectuer au moins les tâches ++utilisant hping3 vous êtes capable d'effectuer au moins les tâches + suivantes : + + - Tester les règles d'un firewall +@@ -135,7 +138,7 @@ + - Beaucoup d'autres. + + .I C'est également un bon outil didactique pour apprendre TCP/IP. +-hping2 est développé et maintenu par antirez@invece.org et est sous la ++hping3 est développé et maintenu par antirez@invece.org et est sous la + version 2 de la licence GPL. Le développement est ouvert donc vous pouvez + m'envoyer des patches, suggestions et affronts sans inhibition. + .SH SITE DE HPING +@@ -160,9 +163,9 @@ + .I -c --count count + Arrête après avoir envoyé (et reçu) + .I count +-paquets réponse. Après que le dernier paquet a été envoyé hping2 attend ++paquets réponse. Après que le dernier paquet a été envoyé hping3 attend + COUNTREACHED_TIMEOUT secondes les réponses du système cible. Vous avez la +-possibilité de régler COUNTREACHED_TIMEOUT en éditant hping2.h ++possibilité de régler COUNTREACHED_TIMEOUT en éditant hping3.h + .TP + .I -i --interval + Attend le nombre spécifié de secondes ou de micro secondes entre l'envoie de +@@ -172,11 +175,11 @@ + à X secondes, --interval uX fixe + .I wait + à X micro secondes. Le défaut est d'attendre une seconde entre chaque +-paquet. En utilisant hping2 pour transférer des fichiers fixer cette option ++paquet. En utilisant hping3 pour transférer des fichiers fixer cette option + est très important pour augmenter le taux de transfert. Même en utilisant +-hping2 pour effectuer des scans passifs/avec usurpation d'adresse vous ++hping3 pour effectuer des scans passifs/avec usurpation d'adresse vous + devriez fixer cette option, voir +-.B HPING2-HOWTO ++.B HPING3-HOWTO + pour plus d'informations. + .TP + .I --fast +@@ -187,6 +190,10 @@ + ordinateur peut envoyer des paquets à cause de la conception basée sur les + signaux). + .TP ++.I --flood ++Envoi les paquets aussi vite que possible sans prendre en compte les réponses ++de retour. Cette méthode est encore plus rapide que l'option -i u0. ++.TP + .I -n --numeric + Sortie numérique seulement, aucune tentative ne sera faite pour chercher les + noms symboliques pour les adresses système. +@@ -196,14 +203,14 @@ + moment du démarrage et quand c'est fini. + .TP + .I -I --interface interface name +-Par défaut sur les systèmes linux et BSD hping2 utilise l'interface de ++Par défaut sur les systèmes linux et BSD hping3 utilise l'interface de + routage par défaut. Sur d'autres systèmes ou quand il n'y a pas d'interface +-de routage par défaut hping2 utilise la première interface non loopback. +-Quoi qu'il en soit vous avez la possibilité de forcer hping2 à utiliser ++de routage par défaut hping3 utilise la première interface non loopback. ++Quoi qu'il en soit vous avez la possibilité de forcer hping3 à utiliser + l'interface dont vous avez besoin en utilisant cette option. Note : vous + n'avez pas besoin de spécifier le nom complet, par exemple -I et va + correspondre à eth0 ethernet0 myet1 et cetera. Si aucune interface ne +-correspond hping2 essayera d'utiliser lo. ++correspond hping3 essayera d'utiliser lo. + .TP + .I -V --verbose + Active la sortie verbeuse. Les réponses TCP seront affichées comme suit : +@@ -213,7 +220,7 @@ + .TP + .I -D --debug + Active le mode de débogage, c'est utile quand vous rencontrez quelques +-problèmes avec hping2. Quand le mode de débogage est activé vous obtiendrez ++problèmes avec hping3. Quand le mode de débogage est activé vous obtiendrez + plus d'informations à propos + .B de la détection des interfaces, de l'accès au niveau données, du + .B réglage des interfaces, des options d'analyse, de la fragmentation, du +@@ -227,9 +234,13 @@ + sortant en pressant CTRL+Z une ou deux fois. + .TP + .I -Z --unbind +-Dé-lie CTRL+Z ainsi vous serez capable d'arrêter hping2 ++Dé-lie CTRL+Z ainsi vous serez capable d'arrêter hping3 ++.TP ++.I --beep ++Emet un « bip » pour tous les paquets correspondants reçus (mais pas ++pour les erreurs ICMP). + .SH SELECTION DE PROTOCOLE +-Le protocole par défaut est TCP, par défaut hping2 enverra des entêtes TCP ++Le protocole par défaut est TCP, par défaut hping3 enverra des entêtes TCP + sur le port 0 du système cible avec une winsize (ndt : taille de fenêtre) de + 64 sans aucun drapeau TCP activé. Souvent c'est la meilleure manière de + faire un 'ping caché', utile quand la cible est derrière un firewall qui +@@ -237,17 +248,17 @@ + 0 a de bonnes probabilités de ne pas être journalisé. + .TP + .I -0 --rawip +-Mode RAW IP, dans ce mode hping2 enverra une entête IP avec les données ++Mode RAW IP, dans ce mode hping3 enverra une entête IP avec les données + ajoutées avec --signature et/ou --file, voir également --ipproto qui vous + autorise à fixer le champ protocole IP. + .TP + .I -1 --icmp +-Mode ICMP, par défaut hping2 enverra un paquet ICMP echo-request, vous ++Mode ICMP, par défaut hping3 enverra un paquet ICMP echo-request, vous + pouvez fixer un autre type/code ICMP en utilisant les options + .B --icmptype --icmpcode + .TP + .I -2 --udp +-Mode UDP, par défaut hping2 enverra des paquets UDP vers le port 0 du ++Mode UDP, par défaut hping3 enverra des paquets UDP vers le port 0 du + système cible. Les options réglables des entêtes UDP sont les suivantes : + .B --baseport, --destport, --keep. + .TP +@@ -296,12 +307,12 @@ + détails intéressants. + .TP + .I -9 --listen signature +-Mode d'écoute de HPING2, en utilisant cette option hping2 attend les paquets ++Mode d'écoute de HPING3, en utilisant cette option hping3 attend les paquets + qui contiennent + .I signature + et exporte de la fin de la + .I signature +-à la fin du paquet. Par exemple si hping2 --listen TEST lit un paquet qui ++à la fin du paquet. Par exemple si hping3 --listen TEST lit un paquet qui + contient + .B 234-09sdflkjs45-TESThello_world + il affichera +@@ -314,7 +325,7 @@ + Quoi qu'il en soit les réponses seront envoyées à l'adresse usurpée, ainsi + vous ne serez pas capable de les voir. Afin de voir comment il est possible + d'effectuer des scans avec des adresses usurpées/passifs voir le fichier +-.BR HPING2-HOWTO . ++.BR HPING3-HOWTO . + + .TP + .I --rand-source +@@ -359,7 +370,7 @@ + ou + .B --bind + Dans le doute essayez +-.BR "" "`" "hping2 some.host.com -t 1 --traceroute" "'." ++.BR "" "`" "hping3 some.host.com -t 1 --traceroute" "'." + .TP + .I -N --id + Fixe le champ ip->id . La valeur du champ id par défaut est aléatoire mais +@@ -374,12 +385,12 @@ + .I -W --winid + Le champ id des systèmes Windows* avant Win2k ont un byte ordering (ndt : + ordre des +-octets) différent, si cette option est activée hping2 affichera proprement ++octets) différent, si cette option est activée hping3 affichera proprement + les champs id des réponses de ces Windows. + .TP + .I -r --rel + Affiche les incréments du champ id au lieu du champ id. Voir le fichier +-.B HPING2-HOWTO ++.B HPING3-HOWTO + pour plus d'informations. Les incréments ne sont pas calculés comme + id[N]-id[N-1] mais en utilisant une compensation de pertes de paquets. Voir + le fichier relid.c pour plus d'informations. +@@ -468,7 +479,7 @@ + .SH OPTIONS TCP/UDP + .TP + .I -s --baseport source port +-hping2 utilise le port source afin de deviner les numéros de séquence des ++hping3 utilise le port source afin de deviner les numéros de séquence des + réponses. Il commence avec un numéro de port source de base, et incrémente + ce numéro pour chaque paquet envoyé. Quand un paquet est reçu alors le + numéro de séquence peut être calculé comme +@@ -513,7 +524,7 @@ + d'analyser si les numéros de séquence TCP sont prévisibles. Exemple de + sortie : + +-.B #hping2 win98 --seqnum -p 139 -S -i u1 -I eth0 ++.B #hping3 win98 --seqnum -p 139 -S -i u1 -I eth0 + .nf + HPING uaz (eth0 192.168.4.41): S set, 40 headers + 0 data bytes + 2361294848 +2361294848 +@@ -568,9 +579,9 @@ + .SH OPTIONS COMMUNES + .TP + .I -d --data data size +-Fixe la taille du corps du paquet. Attention, en utilisant --data 40 hping2 ++Fixe la taille du corps du paquet. Attention, en utilisant --data 40 hping3 + ne générera pas des paquets de 0 octet mais de entête_de_protocole+40 +-octets. hping2 affichera en information la taille des paquets comme première ++octets. hping3 affichera en information la taille des paquets comme première + ligne de sortie, comme ceci : + .B HPING www.yahoo.com (ppp0 204.71.200.67): NO FLAGS are set, 40 headers + 40 data bytes + .TP +@@ -608,9 +619,9 @@ + qui suit : + .nf + .I [host_a] +-.B # hping2 host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd ++.B # hping3 host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd + .I [host_b] +-.B # hping2 host_a --listen signature --safe --icmp ++.B # hping3 host_a --listen signature --safe --icmp + .fi + .TP + .I -u --end +@@ -619,14 +630,14 @@ + cela vous dit quand la fin du fichier a été atteinte. D'ailleurs cela + prévient que l'autre côté accepte plus de paquets. S'il vous plaît, pour + plus d'informations voir le fichier +-.BR HPING2-HOWTO . ++.BR HPING3-HOWTO . + .TP + .I -T --traceroute +-Mode traceroute. En utilisant cette option hping2 incrémentera le ttl pour ++Mode traceroute. En utilisant cette option hping3 incrémentera le ttl pour + chaque paquet + .B ICMP time to live 0 during transit + reçu. Essayez +-.BR "hping2 host --traceroute" . ++.BR "hping3 host --traceroute" . + Cette option implique --bind et --ttl 1. Vous pouvez l'emporter sur le ttl à + 1 en utilisant l'option --ttl. Depuis 2.0.0 stable il affiche les + informations de RTT. +@@ -634,7 +645,7 @@ + garde le ttl fixe en mode traceroute, ainsi vous pouvez contrôler simplement + un noeud sur la route. Par exemple, pour contrôler comment le 5ème noeud + change ou comment son RTT change vous pouvez essayer +-.BR "hping2 host --traceroute --ttl 5 --tr-keep-ttl" . ++.BR "hping3 host --traceroute --ttl 5 --tr-keep-ttl" . + .TP + .I --tr-stop + Si cette option est spécifiée hping quittera dès que le premier paquet qui +@@ -764,4 +775,4 @@ + .SH VOIR AUSSI + ping(8), traceroute(8), ifconfig(8), nmap(1) + .SH TRADUCTEUR +-Denis Ducamp +\ No newline at end of file ++Denis Ducamp --- hping3-3.a2.ds2.orig/debian/patches/100_hyphen_used_as_minus_sign.diff +++ hping3-3.a2.ds2/debian/patches/100_hyphen_used_as_minus_sign.diff @@ -0,0 +1,228 @@ +Correct some hyphen used as minus (thanks lintian). + +--- a/docs/hping3.8 ++++ b/docs/hping3.8 +@@ -165,9 +165,9 @@ + .I -i --interval + Wait + the specified number of seconds or micro seconds between sending each packet. +---interval X set ++\-\-interval X set + .I wait +-to X seconds, --interval uX set ++to X seconds, \-\-interval uX set + .I wait + to X micro seconds. + The default is to wait +@@ -178,14 +178,14 @@ + for more information. + .TP + .I --fast +-Alias for -i u10000. Hping will send 10 packets for second. ++Alias for \-i u10000. Hping will send 10 packets for second. + .TP + .I --faster +-Alias for -i u1. Faster then --fast ;) (but not as fast as your computer can send packets due to the signal-driven design). ++Alias for \-i u1. Faster then \-\-fast ;) (but not as fast as your computer can send packets due to the signal-driven design). + .TP + .I --flood + Sent packets as fast as possible, without taking care to show incoming replies. +-This is ways faster than to specify the -i u0 option. ++This is ways faster than to specify the \-i u0 option. + .TP + .I -n --numeric + Numeric output only, No attempt will be made to lookup symbolic names for host addresses. +@@ -200,7 +200,7 @@ + hping3 uses the first non-loopback interface. + However you are able to force hping3 to use the interface you need using + this option. Note: you don't need to specify the whole name, for +-example -I et will match eth0 ethernet0 myet1 et cetera. If no interfaces ++example \-I et will match eth0 ethernet0 myet1 et cetera. If no interfaces + match hping3 will try to use lo. + .TP + .I -V --verbose +@@ -236,7 +236,7 @@ + .TP + .I -0 --rawip + RAW IP mode, in this mode hping3 will send IP header with data +-appended with --signature and/or --file, see also --ipproto that ++appended with \-\-signature and/or \-\-file, see also \-\-ipproto that + allows you to set the ip protocol field. + .TP + .I -1 --icmp +@@ -292,7 +292,7 @@ + .I signature + and dump from + .I signature +-end to packet's end. For example if hping3 --listen TEST reads a packet ++end to packet's end. For example if hping3 \-\-listen TEST reads a packet + that contain + .B 234-09sdflkjs45-TESThello_world + it will display +@@ -413,10 +413,10 @@ + .I -C --icmptype type + Set icmp type, default is + .B ICMP echo request +-(implies --icmp). ++(implies \-\-icmp). + .TP + .I -K --icmpcode code +-Set icmp code, default is 0 (implies --icmp). ++Set icmp code, default is 0 (implies \-\-icmp). + .TP + .I --icmp-ipver + Set IP version of IP header contained into ICMP data, default is 4. +@@ -438,10 +438,10 @@ + Set ICMP checksum, for default is the valid checksum. + .TP + .I --icmp-ts +-Alias for --icmptype 13 (to send ICMP timestamp requests). ++Alias for \-\-icmptype 13 (to send ICMP timestamp requests). + .TP + .I --icmp-addr +-Alias for --icmptype 17 (to send ICMP address mask requests). ++Alias for \-\-icmptype 17 (to send ICMP address mask requests). + .SH TCP/UDP RELATED OPTIONS + .TP + .I -s --baseport source port +@@ -540,7 +540,7 @@ + .SH COMMON OPTIONS + .TP + .I -d --data data size +-Set packet body size. Warning, using --data 40 hping3 will not generate ++Set packet body size. Warning, using \-\-data 40 hping3 will not generate + 0 byte packets but protocol_header+40 bytes. hping3 will display + packet size information as first line output, like this: + .B HPING www.yahoo.com (ppp0 204.71.200.67): NO FLAGS are set, 40 headers + 40 data bytes +@@ -594,8 +594,8 @@ + .B ICMP time to live 0 during transit + received. Try + .BR "hping3 host --traceroute" . +-This option implies --bind and --ttl 1. You can override the ttl of 1 +-using the --ttl option. Since 2.0.0 stable it prints RTT information. ++This option implies \-\-bind and \-\-ttl 1. You can override the ttl of 1 ++using the \-\-ttl option. Since 2.0.0 stable it prints RTT information. + .TP + .I --tr-keep-ttl + Keep the TTL fixed in traceroute mode, so you can monitor just one hop +@@ -709,7 +709,7 @@ + .SH AUTHOR + Salvatore Sanfilippo , with the help of the people mentioned in AUTHORS file and at http://www.hping.org/authors.html + .SH BUGS +-Even using the --end and --safe options to transfer files the final packet ++Even using the \-\-end and \-\-safe options to transfer files the final packet + will be padded with 0x00 bytes. + .PP + Data is read without care about alignment, but alignment is enforced +--- a/docs/french/hping2-fr.8 ++++ b/docs/french/hping2-fr.8 +@@ -170,9 +170,9 @@ + .I -i --interval + Attend le nombre spécifié de secondes ou de micro secondes entre l'envoie de + chaque paquet. +---interval X fixe ++\-\-interval X fixe + .I wait +-à X secondes, --interval uX fixe ++à X secondes, \-\-interval uX fixe + .I wait + à X micro secondes. Le défaut est d'attendre une seconde entre chaque + paquet. En utilisant hping3 pour transférer des fichiers fixer cette option +@@ -183,16 +183,16 @@ + pour plus d'informations. + .TP + .I --fast +-Alias pour -i u10000. Hping enverra 10 paquets par seconde. ++Alias pour \-i u10000. Hping enverra 10 paquets par seconde. + .TP + .I --faster +-Alias pour -i u1. Plus rapide que --fast ;) (mais pas aussi rapide que votre ++Alias pour \-i u1. Plus rapide que \-\-fast ;) (mais pas aussi rapide que votre + ordinateur peut envoyer des paquets à cause de la conception basée sur les + signaux). + .TP + .I --flood + Envoi les paquets aussi vite que possible sans prendre en compte les réponses +-de retour. Cette méthode est encore plus rapide que l'option -i u0. ++de retour. Cette méthode est encore plus rapide que l'option \-i u0. + .TP + .I -n --numeric + Sortie numérique seulement, aucune tentative ne sera faite pour chercher les +@@ -208,7 +208,7 @@ + de routage par défaut hping3 utilise la première interface non loopback. + Quoi qu'il en soit vous avez la possibilité de forcer hping3 à utiliser + l'interface dont vous avez besoin en utilisant cette option. Note : vous +-n'avez pas besoin de spécifier le nom complet, par exemple -I et va ++n'avez pas besoin de spécifier le nom complet, par exemple \-I et va + correspondre à eth0 ethernet0 myet1 et cetera. Si aucune interface ne + correspond hping3 essayera d'utiliser lo. + .TP +@@ -249,7 +249,7 @@ + .TP + .I -0 --rawip + Mode RAW IP, dans ce mode hping3 enverra une entête IP avec les données +-ajoutées avec --signature et/ou --file, voir également --ipproto qui vous ++ajoutées avec \-\-signature et/ou \-\-file, voir également \-\-ipproto qui vous + autorise à fixer le champ protocole IP. + .TP + .I -1 --icmp +@@ -312,7 +312,7 @@ + .I signature + et exporte de la fin de la + .I signature +-à la fin du paquet. Par exemple si hping3 --listen TEST lit un paquet qui ++à la fin du paquet. Par exemple si hping3 \-\-listen TEST lit un paquet qui + contient + .B 234-09sdflkjs45-TESThello_world + il affichera +@@ -446,7 +446,7 @@ + .BR "ICMP echo request" . + .TP + .I -K --icmpcode code +-Fixe le code ICMP, le défaut est 0 (implique --icmp). ++Fixe le code ICMP, le défaut est 0 (implique \-\-icmp). + .TP + .I --icmp-ipver + Fixe la version IP de l'entête IP contenue dans les données ICMP, le défaut +@@ -472,10 +472,10 @@ + Fixe la somme de contrôle ICMP, le défaut est la somme de contrôle valide. + .TP + .I --icmp-ts +-Alias pour --icmptype 13 (pour envoyer des requêtes ICMP timestamp). ++Alias pour \-\-icmptype 13 (pour envoyer des requêtes ICMP timestamp). + .TP + .I --icmp-addr +-Alias pour --icmptype 17 (pour envoyer des requêtes ICMP masque réseau). ++Alias pour \-\-icmptype 17 (pour envoyer des requêtes ICMP masque réseau). + .SH OPTIONS TCP/UDP + .TP + .I -s --baseport source port +@@ -579,7 +579,7 @@ + .SH OPTIONS COMMUNES + .TP + .I -d --data data size +-Fixe la taille du corps du paquet. Attention, en utilisant --data 40 hping3 ++Fixe la taille du corps du paquet. Attention, en utilisant \-\-data 40 hping3 + ne générera pas des paquets de 0 octet mais de entête_de_protocole+40 + octets. hping3 affichera en information la taille des paquets comme première + ligne de sortie, comme ceci : +@@ -638,8 +638,8 @@ + .B ICMP time to live 0 during transit + reçu. Essayez + .BR "hping3 host --traceroute" . +-Cette option implique --bind et --ttl 1. Vous pouvez l'emporter sur le ttl à +-1 en utilisant l'option --ttl. Depuis 2.0.0 stable il affiche les ++Cette option implique \-\-bind et \-\-ttl 1. Vous pouvez l'emporter sur le ttl à ++1 en utilisant l'option \-\-ttl. Depuis 2.0.0 stable il affiche les + informations de RTT. + .I --tr-keep-ttl + garde le ttl fixe en mode traceroute, ainsi vous pouvez contrôler simplement +@@ -758,7 +758,7 @@ + Salvatore Sanfilippo , avec l'aide des personnes + mentionnées dans le fichier AUTHORS et sur http://www.hping.org/authors.html + .SH BOGUES +-Même en utilisant les options --end et --safe pour transférer des fichiers, ++Même en utilisant les options \-\-end et \-\-safe pour transférer des fichiers, + le paquet final sera rembourré avec des octets 0x00. + .PP + Les données sont lues sans tenir compte de l'alignement, mais l'alignement --- hping3-3.a2.ds2.orig/debian/patches/110_dontfrag_offbyone.diff +++ hping3-3.a2.ds2/debian/patches/110_dontfrag_offbyone.diff @@ -0,0 +1,13 @@ +Off-by-one error with --dontfrag (#537704). + +--- a/sendip_handler.c ++++ b/sendip_handler.c +@@ -19,7 +19,7 @@ + { + ip_optlen = ip_opt_build(ip_opt); + +- if (!opt_fragment && (size+ip_optlen+20 >= h_if_mtu)) ++ if (!opt_fragment && (size+ip_optlen+20 > h_if_mtu)) + { + /* auto-activate fragmentation */ + virtual_mtu = h_if_mtu-20; --- hping3-3.a2.ds2.orig/debian/patches/120_rtt_icmp_unreachable.diff +++ hping3-3.a2.ds2/debian/patches/120_rtt_icmp_unreachable.diff @@ -0,0 +1,31 @@ +Add RTT handling for ICMP destination unreachable packets. + +--- a/waitpacket.c ++++ b/waitpacket.c +@@ -229,6 +229,7 @@ + { + struct myicmphdr icmp; + struct myiphdr quoted_ip; ++ struct myudphdr quoted_udp; + + /* Check if the packet can contain the ICMP header */ + if (size < ICMPHDR_SIZE) { +@@ -286,6 +287,18 @@ + case 3: + if (!opt_quiet) + log_icmp_unreach(inet_ntoa(src), icmp.code); ++ if (quoted_ip.protocol == IPPROTO_UDP) ++ { ++ int sequence = 0, status; ++ float ms_delay = 0.0; ++ unsigned short port; ++ ++ /* Get RTT for UDP packet */ ++ memcpy("ed_udp, packet+ICMPHDR_SIZE+(quoted_ip.ihl<<2), sizeof(quoted_udp)); ++ port = ntohs(quoted_udp.uh_sport); ++ status = rtt(&sequence, port, &ms_delay); ++ printf("status=%d port=%d seq=%d\n", status, port, sequence); ++ } + return 1; + case 11: + if (opt_traceroute) --- hping3-3.a2.ds2.orig/debian/patches/130_spelling_error_in_binary.diff +++ hping3-3.a2.ds2/debian/patches/130_spelling_error_in_binary.diff @@ -0,0 +1,152 @@ +Fix spelling error in binary (lintian -IE) + +--- a/parseoptions.c ++++ b/parseoptions.c +@@ -174,7 +174,7 @@ + str[j++] = '/'; + break; + } +- fprintf(stderr, "invalid IP adress in route\n"); ++ fprintf(stderr, "invalid IP address in route\n"); + fail_parse_route(); + case ':': + if ((!i) && j && j < 4) +--- a/getifname.c ++++ b/getifname.c +@@ -206,7 +206,7 @@ + printf("DEBUG: Output interface address: %s\n", + inet_ntoa(output_if_addr.sin_addr)); + /* Put something in saved_ifname in order to tell +- that the output adress is known */ ++ that the output address is known */ + saved_ifname[0] = 'X'; saved_ifname[1] = 0; + } else { + fprintf(stderr, "Warning: Unable to guess the output " +--- a/usage.c ++++ b/usage.c +@@ -50,7 +50,7 @@ + " -r --rel relativize id field (to estimate host traffic)\n" + " -f --frag split packets in more frag. (may pass weak acl)\n" + " -x --morefrag set more fragments flag\n" +-" -y --dontfrag set dont fragment flag\n" ++" -y --dontfrag set don't fragment flag\n" + " -g --fragoff set the fragment offset\n" + " -m --mtu set virtual mtu, implies --frag if packet size > mtu\n" + " -o --tos type of service (default 0x00), try --tos help\n" +@@ -126,8 +126,8 @@ + "ICMP help:\n" + " ICMP concerned packet options:\n" + " --icmp-ipver set ip version ( default 4 )\n" +-" --icmp-iphlen set ip header lenght ( default IPHDR_SIZE >> 2)\n" +-" --icmp-iplen set ip total lengtht ( default real lenght )\n" ++" --icmp-iphlen set ip header length ( default IPHDR_SIZE >> 2)\n" ++" --icmp-iplen set ip total length ( default real length )\n" + " --icmp-ipid set ip id ( default random )\n" + " --icmp-ipproto set ip protocol ( default IPPROTO_TCP )\n" + " --icmp-ipsrc set ip source ( default 0.0.0.0 )\n" +--- a/sendtcp.c ++++ b/sendtcp.c +@@ -50,7 +50,7 @@ + memcpy(&pseudoheader->saddr, &local.sin_addr.s_addr, 4); + memcpy(&pseudoheader->daddr, &remote.sin_addr.s_addr, 4); + pseudoheader->protocol = 6; /* tcp */ +- pseudoheader->lenght = htons(TCPHDR_SIZE+tcp_opt_size+data_size); ++ pseudoheader->length = htons(TCPHDR_SIZE+tcp_opt_size+data_size); + + /* tcp header */ + tcp->th_dport = htons(dst_port); +--- a/sendudp.c ++++ b/sendudp.c +@@ -46,7 +46,7 @@ + memcpy(&pseudoheader->saddr, &local.sin_addr.s_addr, 4); + memcpy(&pseudoheader->daddr, &remote.sin_addr.s_addr, 4); + pseudoheader->protocol = 17; /* udp */ +- pseudoheader->lenght = htons(packet_size); ++ pseudoheader->length = htons(packet_size); + + /* udp header */ + udp->uh_dport = htons(dst_port); +--- a/sendicmp.c ++++ b/sendicmp.c +@@ -243,7 +243,7 @@ + memcpy(&pseudoheader->saddr, &icmp_ip_src.sin_addr.s_addr, 4); + memcpy(&pseudoheader->daddr, &icmp_ip_dst.sin_addr.s_addr, 4); + pseudoheader->protocol = icmp_ip.protocol; +- pseudoheader->lenght = icmp_ip.tot_len; ++ pseudoheader->length = icmp_ip.tot_len; + icmp_udp->uh_sport = htons(icmp_ip_srcport); + icmp_udp->uh_dport = htons(icmp_ip_dstport); + icmp_udp->uh_ulen = htons(UDPHDR_SIZE + udp_data_len); +--- a/hping2.h ++++ b/hping2.h +@@ -134,7 +134,7 @@ + + /* fragmentation defines */ + #define MF ((unsigned short)0x2000) /* more fragments */ +-#define DF ((unsigned short)0x4000) /* dont fragment */ ++#define DF ((unsigned short)0x4000) /* don't fragment */ + #define NF ((unsigned short)0x0000) /* no more fragments */ + + /* ip options defines */ +@@ -337,7 +337,7 @@ + __u32 daddr; + __u8 zero; + __u8 protocol; +- __u16 lenght; ++ __u16 length; + }; + + #define PSEUDOHDR_SIZE sizeof(struct pseudohdr) +--- a/ars.c ++++ b/ars.c +@@ -698,7 +698,7 @@ + memcpy(&pseudo.daddr, &ip->daddr, 4); + pseudo.protocol = (pkt->p_layer[layer].l_type == ARS_TYPE_TCP) + ? ARS_IPPROTO_TCP : ARS_IPPROTO_UDP; +- pseudo.lenght = htons(ars_relative_size(pkt, layer)); ++ pseudo.length = htons(ars_relative_size(pkt, layer)); + + /* Finally do the checksum */ + ars_multi_cksum(&mc, ARS_MC_INIT, NULL, 0); +--- a/datahandler.c ++++ b/datahandler.c +@@ -26,7 +26,7 @@ + } + + if (opt_sign) { +- memcpy(data, sign, signlen); /* lenght pre-checked */ ++ memcpy(data, sign, signlen); /* length pre-checked */ + data+=signlen; + data_size-=signlen; + } +--- a/ars.h ++++ b/ars.h +@@ -67,7 +67,7 @@ + #define ARS_MAX_IP_SIZE 65535 + + #define ARS_IP_MF ((unsigned short)0x2000) /* more fragments */ +-#define ARS_IP_DF ((unsigned short)0x4000) /* dont fragment */ ++#define ARS_IP_DF ((unsigned short)0x4000) /* don't fragment */ + #define ARS_IP_RF ((unsigned short)0x8000) /* reserved fragment flag */ + + #define ARS_IPOPT_COPY 0x80 +@@ -308,7 +308,7 @@ + __u32 daddr; + __u8 zero; + __u8 protocol; +- __u16 lenght; ++ __u16 length; + }; + + /* The IGRP header structure */ +--- a/sendip_handler.c ++++ b/sendip_handler.c +@@ -35,7 +35,7 @@ + unsigned short fragment_flag = 0; + + if (opt_mf) fragment_flag |= MF; /* more fragments */ +- if (opt_df) fragment_flag |= DF; /* dont fragment */ ++ if (opt_df) fragment_flag |= DF; /* don't fragment */ + send_ip((char*)&local.sin_addr, + (char*)&remote.sin_addr, + packet, size, fragment_flag, ip_frag_offset, --- hping3-3.a2.ds2.orig/debian/patches/140_data_size_udp.diff +++ hping3-3.a2.ds2/debian/patches/140_data_size_udp.diff @@ -0,0 +1,18 @@ +Fix incorrect data size check for UDP. +--- a/parseoptions.c ++++ b/parseoptions.c +@@ -569,9 +573,12 @@ + if (opt_numeric == TRUE) opt_gethost = FALSE; + + /* some error condition */ +- if (data_size+IPHDR_SIZE+TCPHDR_SIZE > 65535) { ++ if (data_size+IPHDR_SIZE+ ++ (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE) > 65535) { + printf("Option error: sorry, data size must be <= %lu\n", +- (unsigned long)(65535-IPHDR_SIZE+TCPHDR_SIZE)); ++ (unsigned long)(65535-(IPHDR_SIZE+ ++ (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE))) ++ ); + exit(1); + } + else if (count <= 0 && count != -1) { --- hping3-3.a2.ds2.orig/debian/patches/150_gnu_kfreebsd.diff +++ hping3-3.a2.ds2/debian/patches/150_gnu_kfreebsd.diff @@ -0,0 +1,147 @@ +Fix FTBFS: GNU/kFreeBSD not in arch list(s) +Index: hping3-3.a2.ds2/getifname.c +=================================================================== +--- hping3-3.a2.ds2.orig/getifname.c 2009-09-19 18:48:10.000000000 +0200 ++++ hping3-3.a2.ds2/getifname.c 2009-09-19 18:48:10.000000000 +0200 +@@ -19,7 +19,7 @@ + #include + + #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ +- defined(__bsdi__) || defined(__APPLE__) ++ defined(__bsdi__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) + #include + #include + #endif /* defined(__*BSD__) */ +@@ -29,7 +29,7 @@ + + #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \ + !defined(__linux__) && !defined(__sun__) && !defined(__bsdi__) && \ +- !defined(__APPLE__) ++ !defined(__APPLE__) && !defined(__FreeBSD_kernel__) + #error Sorry, interface code not implemented. + #endif + +@@ -174,7 +174,7 @@ + } + + #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ +- defined(__bsdi__) || defined(__APPLE__) ++ defined(__bsdi__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) + + /* return interface informations : + - from the specified (-I) interface +Index: hping3-3.a2.ds2/ars.c +=================================================================== +--- hping3-3.a2.ds2.orig/ars.c 2009-09-19 18:48:10.000000000 +0200 ++++ hping3-3.a2.ds2/ars.c 2009-09-19 18:48:10.000000000 +0200 +@@ -914,7 +914,8 @@ + return -ARS_INVALID; + } + ip = (struct ars_iphdr*) packet; +-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI ++#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI || \ ++ defined OSTYPE_GNUKFREEBSD + ip->tot_len = ntohs(ip->tot_len); + ip->frag_off = ntohs(ip->frag_off); + #endif +Index: hping3-3.a2.ds2/sendip.c +=================================================================== +--- hping3-3.a2.ds2.orig/sendip.c 2009-09-19 18:47:49.000000000 +0200 ++++ hping3-3.a2.ds2/sendip.c 2009-09-19 18:48:10.000000000 +0200 +@@ -48,7 +48,8 @@ + ip->ihl = (IPHDR_SIZE + optlen + 3) >> 2; + ip->tos = ip_tos; + +-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI ++#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI || \ ++ defined OSTYPE_GNUKFREEBSD + /* FreeBSD */ + /* NetBSD */ + ip->tot_len = packetsize; +Index: hping3-3.a2.ds2/configure +=================================================================== +--- hping3-3.a2.ds2.orig/configure 2009-09-19 18:48:09.000000000 +0200 ++++ hping3-3.a2.ds2/configure 2009-09-19 18:51:40.000000000 +0200 +@@ -48,6 +48,13 @@ + CONFIGOSTYPE=BSDI + fi + ++# for GNU/kFreeBSD, change GNU/KFREEBSD to GNUKFREEBSD, to ++# not including '/' ++if [ $CONFIGOSTYPE = "GNU/KFREEBSD" ] ++then ++ CONFIGOSTYPE=GNUKFREEBSD ++fi ++ + case $CONFIGOSTYPE in + SUNOS) + SOLARISLIB="-lsocket -lresolv -lnsl" +Index: hping3-3.a2.ds2/libpcap_stuff.c +=================================================================== +--- hping3-3.a2.ds2.orig/libpcap_stuff.c 2009-09-19 18:48:08.000000000 +0200 ++++ hping3-3.a2.ds2/libpcap_stuff.c 2009-09-19 18:48:10.000000000 +0200 +@@ -34,7 +34,8 @@ + printf("[open_pcap] pcap_open_live: %s\n", errbuf); + return -1; + } +-#if (!defined OSTYPE_LINUX) && (!defined __sun__) ++#if (!defined OSTYPE_LINUX) && (!defined __sun__) && \ ++ (!defined OSTYPE_GNUKFREEBSD) + /* Return the packets to userspace as fast as possible */ + if (ioctl(pcap_fileno(pcapfp), BIOCIMMEDIATE, &on) == -1) + perror("[open_pcap] ioctl(... BIOCIMMEDIATE ...)"); +Index: hping3-3.a2.ds2/script.c +=================================================================== +--- hping3-3.a2.ds2.orig/script.c 2009-09-19 18:48:08.000000000 +0200 ++++ hping3-3.a2.ds2/script.c 2009-09-19 18:48:10.000000000 +0200 +@@ -66,7 +66,8 @@ + static struct recv_handler *HpingRecvGetHandler(struct recv_handler *ra, int len, char *ifname, Tcl_Interp *interp) + { + int i; +- #if (!defined OSTYPE_LINUX) && (!defined __sun__) ++ #if (!defined OSTYPE_LINUX) && (!defined __sun__) && \ ++ (!defined OSTYPE_GNUKFREEBSD) + int on = 1; + #endif + +@@ -87,7 +88,8 @@ + ra[i].rh_pcapfp = pcap_open_live(ifname, 99999, 0, 1, ra[i].rh_pcap_errbuf); + if (ra[i].rh_pcapfp == NULL) + return NULL; +- #if (!defined OSTYPE_LINUX) && (!defined __sun__) ++ #if (!defined OSTYPE_LINUX) && (!defined __sun__) && \ ++ (!defined OSTYPE_GNUKFREEBSD) + /* Return the packets to userspace as fast as possible */ + if (ioctl(pcap_fileno(ra[i].rh_pcapfp), BIOCIMMEDIATE, &on) == -1) { + /* XXX non-critical error */ +Index: hping3-3.a2.ds2/interface.c +=================================================================== +--- hping3-3.a2.ds2.orig/interface.c 2009-09-19 18:47:50.000000000 +0200 ++++ hping3-3.a2.ds2/interface.c 2009-09-19 18:48:10.000000000 +0200 +@@ -28,7 +28,7 @@ + #include /* close */ + + #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ +- defined(__bsdi__) || defined(__APPLE__) ++ defined(__bsdi__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) + #include + #include + #include +@@ -37,7 +37,7 @@ + + #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \ + !defined(__linux__) && !defined(__sun__) && !defined(__bsdi__) && \ +- !defined(__APPLE__) ++ !defined(__APPLE__) && !defined(__FreeBSD_kernel__) + #error Sorry, interface code not implemented. + #endif + +@@ -187,7 +187,7 @@ + #endif + + #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ +- defined(__bsdi__) || defined(__APPLE__) ++ defined(__bsdi__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) + /* I wish getifaddrs() API on linux... -- SS */ + int hping_get_interfaces(struct hpingif *hif, int ilen) + { --- hping3-3.a2.ds2.orig/debian/patches/160_tcp_mss.diff +++ hping3-3.a2.ds2/debian/patches/160_tcp_mss.diff @@ -0,0 +1,179 @@ +Add tcp-mss support. +--- a/main.c ++++ b/main.c +@@ -44,7 +44,8 @@ + signlen, + lsr_length = 0, + ssr_length = 0, +- tcp_ack; ++ tcp_ack, ++ tcp_mss; + + + unsigned short int +@@ -95,6 +96,7 @@ + opt_tcpexitcode = FALSE, + opt_badcksum = FALSE, + opt_tr_keep_ttl = FALSE, ++ opt_tcp_mss = FALSE, + opt_tcp_timestamp = FALSE, + opt_tr_stop = FALSE, + opt_tr_no_rtt = FALSE, +--- a/globals.h ++++ b/globals.h +@@ -32,7 +32,8 @@ + tcp_seqnum, + set_ack, + ip_header_length, +- tcp_ack; ++ tcp_ack, ++ tcp_mss; + + extern unsigned short int + data_size; +@@ -77,6 +78,7 @@ + opt_tcpexitcode, + opt_badcksum, + opt_tr_keep_ttl, ++ opt_tcp_mss, + opt_tcp_timestamp, + opt_tr_stop, + opt_tr_no_rtt, +--- a/parseoptions.c ++++ b/parseoptions.c +@@ -31,7 +31,7 @@ + OPT_RROUTE, OPT_IPPROTO, OPT_ICMP_IPVER, OPT_ICMP_IPHLEN, + OPT_ICMP_IPLEN, OPT_ICMP_IPID, OPT_ICMP_IPPROTO, OPT_ICMP_CKSUM, + OPT_ICMP_TS, OPT_ICMP_ADDR, OPT_TCPEXITCODE, OPT_FAST, OPT_TR_KEEP_TTL, +- OPT_TCP_TIMESTAMP, OPT_TR_STOP, OPT_TR_NO_RTT, OPT_ICMP_HELP, ++ OPT_TCP_TIMESTAMP, OPT_TCP_MSS, OPT_TR_STOP, OPT_TR_NO_RTT, OPT_ICMP_HELP, + OPT_RAND_DEST, OPT_RAND_SOURCE, OPT_LSRR, OPT_SSRR, OPT_ROUTE_HELP, + OPT_ICMP_IPSRC, OPT_ICMP_IPDST, OPT_ICMP_SRCPORT, OPT_ICMP_DSTPORT, + OPT_ICMP_GW, OPT_FORCE_ICMP, OPT_APD_SEND, OPT_SCAN, OPT_FASTER, +@@ -124,6 +124,7 @@ + { '\0', "force-icmp", OPT_FORCE_ICMP, AGO_NOARG }, + { '\0', "beep", OPT_BEEP, AGO_NOARG }, + { '\0', "flood", OPT_FLOOD, AGO_NOARG }, ++ { '\0', "tcp-mss", OPT_TCP_MSS, AGO_NEEDARG|AGO_EXCEPT0 }, + AGO_LIST_TERM + }; + +@@ -556,6 +557,10 @@ + case OPT_FLOOD: + opt_flood = TRUE; + break; ++ case OPT_TCP_MSS: ++ opt_tcp_mss = TRUE; ++ tcp_mss = strtoul(ago_optarg, NULL, 0); ++ break; + } + } + +--- a/usage.c ++++ b/usage.c +@@ -87,6 +87,7 @@ + " -X --xmas set X unused flag (0x40)\n" + " -Y --ymas set Y unused flag (0x80)\n" + " --tcpexitcode use last tcp->th_flags as exit code\n" ++" --tcp-mss enable the TCP MSS option with the given value\n" + " --tcp-timestamp enable the TCP timestamp option to guess the HZ/uptime\n" + "Common\n" + " -d --data data size (default is 0)\n" +--- a/sendtcp.c ++++ b/sendtcp.c +@@ -28,10 +28,12 @@ + char *packet, *data; + struct mytcphdr *tcp; + struct pseudohdr *pseudoheader; +- unsigned char *tstamp; ++ unsigned char *opts; + ++ if (opt_tcp_mss) ++ tcp_opt_size += 4; + if (opt_tcp_timestamp) +- tcp_opt_size = 12; ++ tcp_opt_size += 12; + + packet_size = TCPHDR_SIZE + tcp_opt_size + data_size; + packet = malloc(PSEUDOHDR_SIZE + packet_size); +@@ -41,7 +43,7 @@ + } + pseudoheader = (struct pseudohdr*) packet; + tcp = (struct mytcphdr*) (packet+PSEUDOHDR_SIZE); +- tstamp = (unsigned char*) (packet+PSEUDOHDR_SIZE+TCPHDR_SIZE); ++ opts = (unsigned char*) (packet+PSEUDOHDR_SIZE+TCPHDR_SIZE); + data = (char*) (packet+PSEUDOHDR_SIZE+TCPHDR_SIZE+tcp_opt_size); + + memset(packet, 0, PSEUDOHDR_SIZE+packet_size); +@@ -64,14 +66,24 @@ + tcp->th_win = htons(src_winsize); + tcp->th_flags = tcp_th_flags; + ++ /* tcp MSS option */ ++ if (opt_tcp_mss) { ++ opts[0] = 2; ++ opts[1] = 4; /* 4 bytes, kind+len+MSS */ ++ opts[2] = tcp_mss >> 8; ++ opts[3] = tcp_mss & 0xff; ++ opts += 4; ++ } ++ + /* tcp timestamp option */ + if (opt_tcp_timestamp) { + __u32 randts = rand() ^ (rand() << 16); +- tstamp[0] = tstamp[1] = 1; /* NOOP */ +- tstamp[2] = 8; +- tstamp[3] = 10; /* 10 bytes, kind+len+T1+T2 */ +- memcpy(tstamp+4, &randts, 4); /* random */ +- memset(tstamp+8, 0, 4); /* zero */ ++ opts[0] = opts[1] = 1; /* NOOP */ ++ opts[2] = 8; ++ opts[3] = 10; /* 10 bytes, kind+len+T1+T2 */ ++ memcpy(opts+4, &randts, 4); /* random */ ++ memset(opts+8, 0, 4); /* zero */ ++ opts += 12; + } + + /* data */ +--- a/docs/hping3.8 ++++ b/docs/hping3.8 +@@ -98,6 +98,8 @@ + ] [ + .B \-\-tcpexitcode + ] [ ++.B \-\-tcp-mss ++] [ + .B \-\-tcp-timestamp + ] [ + .B \-\-tr-stop +@@ -510,6 +512,9 @@ + .I -b --badcksum + Send packets with a bad UDP/TCP checksum. + .TP ++.I --tcp-mss ++Enable the TCP MSS option and set it to the given value. ++.TP + .I --tcp-timestamp + Enable the TCP timestamp option, and try to guess the timestamp update + frequency and the remote system uptime. +--- a/docs/french/hping2-fr.8 ++++ b/docs/french/hping2-fr.8 +@@ -99,6 +99,8 @@ + ] [ + .B \-\-tcpexitcode + ] [ ++.B \-\-tcp-mss ++] [ + .B \-\-tcp-timestamp + ] [ + .B \-\-tr-stop +@@ -549,6 +551,9 @@ + .I -b --badcksum + Envoie des paquets avec une mauvaise somme de contrôle UDP/TCP + .TP ++.I --tcp-mss ++Active l'option TCP MSS et la fixe avec la valeur donnée. ++.TP + .I --tcp-timestamp + Active l'option TCP timestamp, et essaye de deviner la fréquence de mise à + jour du timestamp et l'uptime du système distant. --- hping3-3.a2.ds2.orig/debian/patches/series +++ hping3-3.a2.ds2/debian/patches/series @@ -0,0 +1,16 @@ +010_install.diff +020_libpcap0.8.diff +030_bytesex.diff +040_spelling.diff +050_personality.diff +060_version.diff +070_tcl.diff +080_ip_id_field.diff +090_fr_manpage.diff +100_hyphen_used_as_minus_sign.diff +110_dontfrag_offbyone.diff +120_rtt_icmp_unreachable.diff +130_spelling_error_in_binary.diff +140_data_size_udp.diff +150_gnu_kfreebsd.diff +160_tcp_mss.diff --- hping3-3.a2.ds2.orig/debian/rules +++ hping3-3.a2.ds2/debian/rules @@ -0,0 +1,76 @@ +#!/usr/bin/make -f + +include /usr/share/quilt/quilt.make + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info + touch configure-stamp + +build: patch configure-stamp build-stamp + +build-stamp: + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: clean-patched unpatch +clean-patched: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp patch-stamp + + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + $(MAKE) install DESTDIR=$(CURDIR)/debian/hping3/ + mkdir -p $(CURDIR)/debian/hping3/usr/share/man/fr/man8 + gzip -9 -c $(CURDIR)/docs/french/hping2-fr.8 > $(CURDIR)/debian/hping3/usr/share/man/fr/man8/hping3.8.gz + + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs CHANGES + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress -X.htcl # do not compress example TCL scripts + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- hping3-3.a2.ds2.orig/debian/watch +++ hping3-3.a2.ds2/debian/watch @@ -0,0 +1 @@ +# No upstream release since 2005.