mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-22 06:41:01 +02:00
tcpick: update debian patches, issue #262
This commit is contained in:
parent
f9856cb044
commit
8ea094b0a7
14 changed files with 769 additions and 308 deletions
18
net-misc/tcpick/files/CVE-2006-0048.patch
Normal file
18
net-misc/tcpick/files/CVE-2006-0048.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Description: Fix for CVE-2006-0048
|
||||
Author: Cédric Delfosse <cedric@debian.org>
|
||||
Origin: vendor
|
||||
Bug-Debian: http://bugs.debian.org/360571
|
||||
Last-Update: 2006-04-14
|
||||
|
||||
--- a/src/write.c
|
||||
+++ b/src/write.c
|
||||
@@ -244,6 +244,9 @@ out_flavour( enum FLAVOUR flavour,
|
||||
if( flags.separator && ( out == stdout ) ) /* FIXME: sucks? */
|
||||
color( c_SEPARATOR, stdout, SEPARATOR "\n" );
|
||||
|
||||
+ /* Temporary fix for CVE-2006-0048 */
|
||||
+ if (buflen < 0) buflen = 0;
|
||||
+
|
||||
switch ( flavour ) {
|
||||
case HEX_ASCII_DUMP:
|
||||
out_xa( out, buf, buflen );
|
||||
233
net-misc/tcpick/files/fix-build-with-gcc5.patch
Normal file
233
net-misc/tcpick/files/fix-build-with-gcc5.patch
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
Description: Fix build with GCC 5
|
||||
GCC 5 is more picky with external references which are not properly
|
||||
declared with forward references. Add all relevant functions to tcpick.h
|
||||
to avoid this problem and fix the problems put into light by this change
|
||||
(some invalid function calls).
|
||||
Author: Raphaël Hertzog <hertzog@debian.org>
|
||||
Bug-Debian: http://bugs.debian.org/778141
|
||||
Origin: vendor
|
||||
Last-Update: 2015-07-13
|
||||
|
||||
--- a/src/tcpick.h
|
||||
+++ b/src/tcpick.h
|
||||
@@ -10,10 +10,12 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
+#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
+#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
# include <signal.h>
|
||||
@@ -114,3 +116,102 @@
|
||||
#include "flags.h"
|
||||
#include "lookup.h"
|
||||
#include "timer.h"
|
||||
+
|
||||
+/* From args.c */
|
||||
+void parse_args(int argc, char ** argv);
|
||||
+
|
||||
+/* From colors.c */
|
||||
+void textcolor(FILE * out, int attr, int fg, int bg);
|
||||
+void resetcolor(FILE * out);
|
||||
+void color(int attr, int fg, FILE * out, char *fmt, ...);
|
||||
+
|
||||
+/* From datalink.c */
|
||||
+char *datalink2str(int dl_id);
|
||||
+int datalink2off(int dl_id);
|
||||
+
|
||||
+/* From display.c */
|
||||
+char * status2str(enum STATUS status);
|
||||
+int display_status( FILE * out, struct CONN * conn, enum STATUS status );
|
||||
+int display_header( FILE * out );
|
||||
+int out_h( FILE * out, u_char * buf, int buflen );
|
||||
+int out_hn( FILE * out, u_char * buf, int buflen );
|
||||
+int out_p( FILE * out, u_char * buf, int buflen );
|
||||
+int out_xa (FILE * out, u_char * buf, int buflen);
|
||||
+int out_x (FILE * out, u_char * buf, int buflen);
|
||||
+
|
||||
+/* From fragments.c */
|
||||
+int
|
||||
+addfr( struct FRAGMENT ** first,
|
||||
+ int wlen,
|
||||
+ u_int32_t data_off,
|
||||
+ u_char * payload,
|
||||
+ int payload_len );
|
||||
+
|
||||
+int
|
||||
+flush_ack( struct HOST_DESC * desc,
|
||||
+ struct CONN * conn_ptr,
|
||||
+ int ack_num );
|
||||
+
|
||||
+/* From lookup_query.c */
|
||||
+char * lookup_new(struct in_addr ia);
|
||||
+char * lookup(struct in_addr ia);
|
||||
+char * getportname(u_int16_t port);
|
||||
+
|
||||
+/* From lookup_tree.c */
|
||||
+struct _l_node *_l_alloc(struct in_addr, char *);
|
||||
+char *_l_get(struct in_addr);
|
||||
+int _l_insert(struct _l_node * new);
|
||||
+
|
||||
+/* Form msg.c */
|
||||
+void err(char *fmt, ...);
|
||||
+void msg(int v, int attr, int fg, char *fmt, ...);
|
||||
+void sorry(char * func, char * desc);
|
||||
+
|
||||
+/* From quit.c */
|
||||
+void fault(char * func, char * desc);
|
||||
+void suicide(char * func, char * fmt, ...);
|
||||
+void print_statistics();
|
||||
+void cleanup();
|
||||
+void exit_signal(int sig_type);
|
||||
+
|
||||
+/* From tcpick.c */
|
||||
+void signal_setup(int sig, void (*handler)( ));
|
||||
+
|
||||
+/* From time.c */
|
||||
+char * time_ascii(char * ret);
|
||||
+
|
||||
+/* From timer.c */
|
||||
+void set_timer();
|
||||
+void check_expired();
|
||||
+void sigalrm_callback(int sig_type);
|
||||
+
|
||||
+/* From tracker.c */
|
||||
+int status_switch(struct CONN * prev, enum STATUS status);
|
||||
+int newconn( struct CONN * prev_ring );
|
||||
+int rmconn( struct CONN * prev_ring );
|
||||
+int free_desc( struct HOST_DESC * desc, int freedescfilename );
|
||||
+
|
||||
+/* From verify.c */
|
||||
+int
|
||||
+verify();
|
||||
+
|
||||
+/* From write.c */
|
||||
+char *
|
||||
+avail_filename(struct CONN * conn_ptr,
|
||||
+ enum PART side, char * ext);
|
||||
+
|
||||
+void
|
||||
+open_file(struct CONN * conn_ptr,
|
||||
+ struct HOST_DESC * desc);
|
||||
+
|
||||
+int
|
||||
+flowflush(struct CONN * conn_ptr,
|
||||
+ struct HOST_DESC * desc,
|
||||
+ u_char * buf,
|
||||
+ int buflen);
|
||||
+
|
||||
+int
|
||||
+out_flavour(enum FLAVOUR flavour,
|
||||
+ FILE * out,
|
||||
+ u_char * buf,
|
||||
+ int buflen);
|
||||
--- a/src/loop.c
|
||||
+++ b/src/loop.c
|
||||
@@ -95,8 +95,7 @@ got_packet (u_char * useless,
|
||||
#endif /* TCPICK_DEBUG */
|
||||
|
||||
if( flags.header > 0 )
|
||||
- display_header( stdout, ippacket, tcppacket,
|
||||
- payload_len );
|
||||
+ display_header(stdout);
|
||||
|
||||
verify(); /* call the core to manage the packet */
|
||||
|
||||
--- a/src/display.c
|
||||
+++ b/src/display.c
|
||||
@@ -297,7 +297,7 @@ out_x (FILE * out, u_char * buf, int buf
|
||||
color( c_NONPRINT, out, pos % 2 ? "%2.2x " : "%2.2x", *( buf + pos ) );
|
||||
else
|
||||
/* hex space fill */
|
||||
- fprintf(out, pos % 2 ? " " : " ", *( buf + pos ) );
|
||||
+ fprintf(out, pos % 2 ? " " : " ");
|
||||
pos++;
|
||||
} while ( pos % 16 );
|
||||
|
||||
--- a/src/tcpick.c
|
||||
+++ b/src/tcpick.c
|
||||
@@ -50,10 +50,10 @@
|
||||
#include "tcpick.h"
|
||||
#include "globals.h"
|
||||
|
||||
-char *errbuf[PCAP_ERRBUF_SIZE];
|
||||
+char errbuf[PCAP_ERRBUF_SIZE];
|
||||
struct bpf_program filter_compiled;
|
||||
bpf_u_int32 netp; /* ip */
|
||||
-bpf_u_int32 maskp; /* subnet mask */
|
||||
+bpf_u_int32 maskp = PCAP_NETMASK_UNKNOWN; /* subnet mask */
|
||||
struct in_addr addr;
|
||||
char *other_args = NULL;
|
||||
pcap_t *descr;
|
||||
@@ -238,7 +238,7 @@ int main(int argc, char **argv)
|
||||
&filter_compiled,
|
||||
filter,
|
||||
0,
|
||||
- (int)net
|
||||
+ maskp
|
||||
) == -1) )
|
||||
err("error compiling filter \"%s\"",filter);
|
||||
|
||||
--- a/src/time.c
|
||||
+++ b/src/time.c
|
||||
@@ -42,7 +42,7 @@ char * time_ascii(char * ret)
|
||||
tzp = (struct timezone * ) S_malloc( sizeof(struct timezone) );
|
||||
|
||||
memset(tp, 0, sizeof(struct timeval));
|
||||
- memset(tzp, 0, sizeof(struct timeval));
|
||||
+ memset(tzp, 0, sizeof(struct timezone));
|
||||
|
||||
if(gettimeofday(tp, tzp)) {
|
||||
|
||||
@@ -58,7 +58,7 @@ char * time_ascii(char * ret)
|
||||
brokentime->tm_hour,
|
||||
brokentime->tm_min,
|
||||
brokentime->tm_sec,
|
||||
- tp->tv_usec
|
||||
+ (int)tp->tv_usec
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -79,7 +79,7 @@ char * time_ascii(char * ret)
|
||||
brokentime->tm_hour,
|
||||
brokentime->tm_min,
|
||||
brokentime->tm_sec,
|
||||
- tp->tv_usec
|
||||
+ (int)tp->tv_usec
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -99,7 +99,7 @@ char * time_ascii(char * ret)
|
||||
return ret;
|
||||
|
||||
retNULL:
|
||||
- sprintf(ret,"");
|
||||
+ ret[0] = '\0';
|
||||
return NULL;
|
||||
|
||||
}
|
||||
--- a/src/debug.c
|
||||
+++ b/src/debug.c
|
||||
@@ -32,7 +32,7 @@ void
|
||||
print_conn_chain (struct CONN * f)
|
||||
{
|
||||
while (f) {
|
||||
- printf ("%x->",f);
|
||||
+ printf ("%p->",f);
|
||||
|
||||
if (f == f->next) {
|
||||
printf ("inf\n");
|
||||
@@ -48,7 +48,7 @@ int
|
||||
print_fragment_chain(struct FRAGMENT * f)
|
||||
{
|
||||
while (f) {
|
||||
- printf ("%x(%i,%i)->",f,f->off,f->len);
|
||||
+ printf ("%p(%i,%i)->",f,f->off,f->len);
|
||||
|
||||
if (f == f->next) {
|
||||
printf ("inf\n");
|
||||
40
net-misc/tcpick/files/fix-double-free-error.patch
Normal file
40
net-misc/tcpick/files/fix-double-free-error.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
Description: Fix double-free error
|
||||
tcpick try to free twice the pointer to the filename it uses to write
|
||||
the data. This patches fixes that.
|
||||
Author: Cedric Delfosse <cedric@debian.org>
|
||||
Bug-Debian: http://bugs.debian.org/319864
|
||||
Last-Update: 2005-07-26
|
||||
Origin: vendor, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=319864#19
|
||||
|
||||
--- a/src/tracker.c
|
||||
+++ b/src/tracker.c
|
||||
@@ -99,8 +99,9 @@ int rmconn( struct CONN * prev_ring )
|
||||
if( curr->next == NULL )
|
||||
last_conn = prev_ring;
|
||||
|
||||
- free_desc( &(curr->client) );
|
||||
- free_desc( &(curr->server) );
|
||||
+ free_desc( &(curr->client), 1);
|
||||
+ if (flags.writer.type == UNIQUE) free_desc( &(curr->server), 0);
|
||||
+ else free_desc( &(curr->server), 1);
|
||||
S_free( curr );
|
||||
|
||||
conn = first_conn;
|
||||
@@ -124,7 +125,7 @@ int rmconn( struct CONN * prev_ring )
|
||||
count_opened--;
|
||||
}
|
||||
|
||||
-int free_desc( struct HOST_DESC * desc )
|
||||
+int free_desc( struct HOST_DESC * desc, int freedescfilename )
|
||||
/* frees the host descriptor and closes the file */
|
||||
{
|
||||
struct FRAGMENT * tmp;
|
||||
@@ -134,7 +135,7 @@ int free_desc( struct HOST_DESC * desc )
|
||||
if (flags.writer.type == UNIQUE)
|
||||
desc->oth->file = NULL;
|
||||
}
|
||||
- if( desc->filename ) {
|
||||
+ if( desc->filename && freedescfilename ) {
|
||||
S_free( desc->filename );
|
||||
desc->filename = NULL;
|
||||
}
|
||||
26
net-misc/tcpick/files/fix-infinite-loop-on-powerpc.patch
Normal file
26
net-misc/tcpick/files/fix-infinite-loop-on-powerpc.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
Description: Fix infinite loop on powerpc
|
||||
On the ppc C compiler, char is an unsigned data type. This means that
|
||||
no variable of type char can ever compare equal to the int value -1. gcc
|
||||
tries to warn you about this when you compile tcpick, by saying:
|
||||
.
|
||||
args.c:195: warning: comparison is always true due to limited range of
|
||||
data type
|
||||
.
|
||||
tcpick therefore never makes it past the getopt loop. The following
|
||||
patch fixes the problem.
|
||||
Author: Alan Curry <pacman@world.std.com>
|
||||
Origin: other, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327327#5
|
||||
Bug-Debian: http://bugs.debian.org/327327
|
||||
Last-Update: 2005-09-09
|
||||
|
||||
--- a/src/args.c
|
||||
+++ b/src/args.c
|
||||
@@ -149,7 +149,7 @@ parse_display_rebuild ( char * s )
|
||||
void
|
||||
parse_args(int argc, char ** argv)
|
||||
{
|
||||
- char opt;
|
||||
+ int opt;
|
||||
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
static struct option long_options[]=
|
||||
22
net-misc/tcpick/files/fix-man-invocation.patch
Normal file
22
net-misc/tcpick/files/fix-man-invocation.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Description: Fix man invocation
|
||||
Upon startup, tcpick says:
|
||||
.
|
||||
important: `man 1 tcpick' explains all options available
|
||||
.
|
||||
but the man page is in section 8, not 1. This patch fixes that.
|
||||
Bug-Debian: http://bugs.debian.org/265067
|
||||
Origin: vendor
|
||||
Author: Cédric Delfosse <cedric@debian.org>
|
||||
Last-Update: 2004-08-18
|
||||
|
||||
--- a/src/args.c
|
||||
+++ b/src/args.c
|
||||
@@ -386,7 +386,7 @@ parse_args(int argc, char ** argv)
|
||||
if(flags.versionandquit) {
|
||||
color( c_USAGE, stdout, PACKAGE_STRING "\n"
|
||||
" Author: " AUTHOR "\n"
|
||||
- " for other info try `man 1 tcpick', or `%s --help'\n\n"
|
||||
+ " for other info try `man tcpick', or `%s --help'\n\n"
|
||||
TERMS ,TCPICK_NAME);
|
||||
exit( TCPICK_SUCCESS );
|
||||
}
|
||||
342
net-misc/tcpick/files/fix-spelling-errors.patch
Normal file
342
net-misc/tcpick/files/fix-spelling-errors.patch
Normal file
|
|
@ -0,0 +1,342 @@
|
|||
Description: Fix spelling errors on source code, man page and doc files
|
||||
Author: Marcos Fouces <mfouces@yahoo.es>
|
||||
--- a/AUTHORS
|
||||
+++ b/AUTHORS
|
||||
@@ -117,7 +117,7 @@
|
||||
RPM:
|
||||
****
|
||||
|
||||
-Mantained by Dag Wieers, with a lot of platforms available:
|
||||
+Maintained by Dag Wieers, with a lot of platforms available:
|
||||
`http://dag.wieers.com/packages/tcpick/'
|
||||
|
||||
Lou Afonso has compiled version 0.1.20
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
Francesco Stablum (duskdruid:despammed.com):
|
||||
|
||||
- * Now '\r' and '\t' charachters are printable in 'P' and 'U' modes.
|
||||
+ * Now '\r' and '\t' characters are printable in 'P' and 'U' modes.
|
||||
|
||||
* MacOSX "BIOCSRTIMEOUT: Invalid argument" bug should be fixed.
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
Shah discovered it)
|
||||
|
||||
* Bugfix: `u' flag of `-w' worked as with `b' flag either if `b'
|
||||
- wasn't choosen.
|
||||
+ wasn't chosen.
|
||||
|
||||
07/09/04 0.2.0-devel1
|
||||
*********************
|
||||
@@ -222,10 +222,10 @@
|
||||
I have added another set of displaying option, that are prefixed
|
||||
with -b. The -b options are useful to view data only when
|
||||
acknowledged (exactly like data written to files) and with this is
|
||||
- particulary useful the raw mode (-bR) that you can use if you want
|
||||
+ particularly useful the raw mode (-bR) that you can use if you want
|
||||
to redirect data with a pipe to another software.
|
||||
|
||||
- * The newline carachter is suppressed when displaying the payload of
|
||||
+ * The newline character is suppressed when displaying the payload of
|
||||
the packet or an acknowledged stream in the case there are no
|
||||
banners except the case of the hexdump's.
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
* In the hexdump+ascii red dots rapresents now the unprintable
|
||||
carachter.
|
||||
|
||||
- * the lenght of the payload is now displayed in the packet banner
|
||||
+ * the length of the payload is now displayed in the packet banner
|
||||
|
||||
* rewritten the core of verify.c and fragments.c
|
||||
|
||||
@@ -486,9 +486,9 @@
|
||||
added lot of write to file features:
|
||||
* header writing, (-wH)
|
||||
|
||||
- * only printable charachters writing (-wP)
|
||||
+ * only printable characters writing (-wP)
|
||||
|
||||
- * unprintable charachters transformed into hexadecimal code (-wU)
|
||||
+ * unprintable characters transformed into hexadecimal code (-wU)
|
||||
|
||||
* added other options (see manpage for details) -s -P -R -U
|
||||
|
||||
@@ -512,13 +512,13 @@
|
||||
**************
|
||||
|
||||
* now you can display data in the packet in hexdump mode (-x) and
|
||||
- you can watch at the printable ascii charachters too, using -X
|
||||
+ you can watch at the printable ascii characters too, using -X
|
||||
option
|
||||
|
||||
28/11/03 0.1.5
|
||||
**************
|
||||
|
||||
- * better options managment, including long options
|
||||
+ * better options management, including long options
|
||||
|
||||
* added data showing in hexadecimal
|
||||
|
||||
@@ -538,6 +538,6 @@
|
||||
24/11/03 0.1.1
|
||||
**************
|
||||
|
||||
- * fixed bad managing of payload (now ack packets whith no data are
|
||||
+ * fixed bad managing of payload (now ack packets with no data are
|
||||
dropped)
|
||||
|
||||
--- a/EXAMPLES
|
||||
+++ b/EXAMPLES
|
||||
@@ -7,7 +7,7 @@
|
||||
1.1 connection status
|
||||
=====================
|
||||
|
||||
-Tcpick is a sniffer able to understand wich status has the connection
|
||||
+Tcpick is a sniffer able to understand which status has the connection
|
||||
(SYN-SENT, SYN-RECEIVED and so on). To see the connection tracker in
|
||||
action on eth0 simply type:
|
||||
|
||||
--- a/OPTIONS
|
||||
+++ b/OPTIONS
|
||||
@@ -27,7 +27,7 @@
|
||||
tcpick is a textmode sniffer libpcap-based that can track tcp streams
|
||||
and saves the data captured in different files, each for every connec-
|
||||
tion, or displays them in the terminal in different formats (hexdump,
|
||||
- printable charachters, raw...) Useful for picking files in a passive
|
||||
+ printable characters, raw...) Useful for picking files in a passive
|
||||
way. It is useful to keep track of what users of a network are doing,
|
||||
and is usable with textmode tools like grep, sed, awk. Happy data
|
||||
hunting :-)
|
||||
@@ -131,11 +131,11 @@
|
||||
and -yX options.
|
||||
|
||||
-yP Shows data contained in the tcp packets. Non-printable
|
||||
- charachters are transformed in dots: ".". Newline character is
|
||||
+ characters are transformed in dots: ".". Newline character is
|
||||
preserved. This is the best way, in my opinion to show data
|
||||
like HTTP requests, IRC communication, SMTP stuff and so on.
|
||||
|
||||
- -yR Displays all kind of charachters, printable and non printable.
|
||||
+ -yR Displays all kind of characters, printable and non printable.
|
||||
If something binary is transmitted, the effect will probably be
|
||||
like watching with "cat" at a gzipped file.
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
-yX Shows all data after the header in hexadecimal and ascii dump
|
||||
with 16 bytes per line.
|
||||
|
||||
- -yU Shows all data after the header, but Unprintable charachters are
|
||||
+ -yU Shows all data after the header, but Unprintable characters are
|
||||
displayed as hexadecimal values between a "<" and a ">" symbol.
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
If you use the additional flag b of the -w option (i.e. -wPub), in the
|
||||
file will be written this banner:
|
||||
|
||||
- [client|server] offset before:offset after (lenght of rebuilded seg-
|
||||
+ [client|server] offset before:offset after (length of rebuilded seg-
|
||||
ment)
|
||||
|
||||
to distinguish between client and server data.
|
||||
@@ -177,10 +177,10 @@
|
||||
changes. Useful for sniffing binary or compressed files.
|
||||
(-wRC only the client, -wRS only the server)
|
||||
|
||||
- -wP Unprintable charachters are written like dots.
|
||||
+ -wP Unprintable characters are written like dots.
|
||||
(-wPC only the client, -wPS only the server)
|
||||
|
||||
- -wU Unprintable charachters are displayed as hexadecimal values
|
||||
+ -wU Unprintable characters are displayed as hexadecimal values
|
||||
between a "<" and a ">" symbol.
|
||||
(-wPC only the client, -wPS only the server)
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
you are able to track only the first connection (-T1) matched by
|
||||
tcpick and data are displayed as raw. Only data from the client
|
||||
are put on stdout. All messages and banners are suppressed,
|
||||
- except error messages (-S -v0), so this option is particulary
|
||||
+ except error messages (-S -v0), so this option is particularly
|
||||
useful to download an entire fully rebuilded and acknowledged
|
||||
connection.
|
||||
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -6,7 +6,7 @@
|
||||
connections data in different files, or it can display all the stream
|
||||
on the terminal, when the connection is closed. There are useful
|
||||
display modes like hexdump, hexdump + ascii, only printable
|
||||
-charachters, raw mode and so on. Available a color mode too, helpful to
|
||||
+characters, raw mode and so on. Available a color mode too, helpful to
|
||||
read better the output of the program. Actually it can handle eth and
|
||||
ppp interfaces. It is useful to keep track of what users of a network
|
||||
are doing, and is usable with textmode tools like grep, sed, awk.
|
||||
--- a/src/fragments.c
|
||||
+++ b/src/fragments.c
|
||||
@@ -162,7 +162,7 @@
|
||||
int ack_num )
|
||||
/* called by established_packet
|
||||
* when a "ack" packet comes to the network device,
|
||||
- * data that are unacknowledged will be acknowledged and immediatly
|
||||
+ * data that are unacknowledged will be acknowledged and immediately
|
||||
* sent to the write engine wrebuild
|
||||
*/
|
||||
{
|
||||
--- a/src/ip.h
|
||||
+++ b/src/ip.h
|
||||
@@ -127,7 +127,7 @@
|
||||
u_short ip_id; /* identification */
|
||||
u_short ip_off; /* fragment offset field */
|
||||
#define IP_RF 0x8000 /* reserved fragment flag */
|
||||
-#define IP_DF 0x4000 /* dont fragment flag */
|
||||
+#define IP_DF 0x4000 /* don't fragment flag */
|
||||
#define IP_MF 0x2000 /* more fragments flag */
|
||||
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
|
||||
u_int8_t ip_ttl; /* time to live */
|
||||
--- a/src/lookup_query.c
|
||||
+++ b/src/lookup_query.c
|
||||
@@ -86,7 +86,7 @@
|
||||
return service=(char *)strdup(ptr->s_name);
|
||||
}
|
||||
debug( "service name NOT resolved: %d",ntohs(port) );
|
||||
- /* \n carachter should be inserted because this messages comes after
|
||||
+ /* \n character should be inserted because this messages comes after
|
||||
* a "printf" message not ended in \n in another function
|
||||
*/
|
||||
s_port=(char *)S_calloc(128,1);
|
||||
--- a/src/lookup_tree.c
|
||||
+++ b/src/lookup_tree.c
|
||||
@@ -206,7 +206,7 @@
|
||||
_l_root->parent = NULL;
|
||||
}
|
||||
|
||||
- /* 2. step: the left side C of the node D becames the
|
||||
+ /* 2. step: the left side C of the node D becomes the
|
||||
* right of the node B */
|
||||
|
||||
B->right = D->left;
|
||||
@@ -260,7 +260,7 @@
|
||||
|
||||
D->parent = B->parent;
|
||||
|
||||
- /* 2. step: the right side C of the node D becames the
|
||||
+ /* 2. step: the right side C of the node D becomes the
|
||||
* left of the node B */
|
||||
B->left = D->right;
|
||||
|
||||
--- a/src/loop.c
|
||||
+++ b/src/loop.c
|
||||
@@ -72,7 +72,7 @@
|
||||
#ifdef TCPICK_DEBUG
|
||||
if( payload_len != (hdr->len - (int)( payload - packet ) ) ) {
|
||||
suicide( "got_packet",
|
||||
- "payload lenght calculated with iplen and hdr->len\n"
|
||||
+ "payload length calculated with iplen and hdr->len\n"
|
||||
"differs by %d bytes\n"
|
||||
"hdr->len = %d\n"
|
||||
"datalink_size = %d\n"
|
||||
--- a/src/tcpick.c
|
||||
+++ b/src/tcpick.c
|
||||
@@ -245,7 +245,7 @@
|
||||
pcap_setfilter( descr, &filter_compiled );
|
||||
}
|
||||
|
||||
- /* getting information about the datalink type of the device choosen
|
||||
+ /* getting information about the datalink type of the device chosen
|
||||
(not all are supported) */
|
||||
datalink_id = pcap_datalink( descr );
|
||||
datalink_str = (char *)datalink2str( datalink_id );
|
||||
--- a/tcpick.8
|
||||
+++ b/tcpick.8
|
||||
@@ -53,7 +53,7 @@
|
||||
tcp streams and saves the
|
||||
data captured in different files, each for every connection,
|
||||
or displays them in the terminal in different
|
||||
-formats (hexdump, printable charachters, raw...)
|
||||
+formats (hexdump, printable characters, raw...)
|
||||
Useful for picking files in a passive way.
|
||||
It is useful to keep track of what users of a network are doing, and is
|
||||
usable with textmode tools like grep, sed, awk.
|
||||
@@ -141,7 +141,7 @@
|
||||
discarded. If \fInumber\fP is not specified, it will be set to \fB1\fP.
|
||||
.TP
|
||||
.B \-v \fIverbosity\fP
|
||||
-Quite unuseful, yet. Set verbosity level. Actually there are not
|
||||
+Quite useless, yet. Set verbosity level. Actually there are not
|
||||
really many
|
||||
extra messages to display, this means it is enabled by default
|
||||
(\fB-v1\fP).
|
||||
@@ -171,13 +171,13 @@
|
||||
\fB-yX\fP options.
|
||||
.TP
|
||||
.B \-yP
|
||||
-Shows data contained in the tcp packets. Non-printable charachters are
|
||||
+Shows data contained in the tcp packets. Non-printable characters are
|
||||
transformed in dots: "\fB.\fP". Newline character is preserved.
|
||||
This is the best way, in my opinion to show data like HTTP requests,
|
||||
IRC communication, SMTP stuff and so on.
|
||||
.TP
|
||||
.B \-yR
|
||||
-Displays all kind of charachters, printable and non printable. If
|
||||
+Displays all kind of characters, printable and non printable. If
|
||||
something binary is transmitted, the effect will probably be like
|
||||
watching with "\fBcat\fP" at a gzipped file.
|
||||
.TP
|
||||
@@ -189,7 +189,7 @@
|
||||
bytes per line.
|
||||
.TP
|
||||
.B \-yU
|
||||
-Shows all data after the header, but \fBU\fPnprintable charachters are
|
||||
+Shows all data after the header, but \fBU\fPnprintable characters are
|
||||
displayed as hexadecimal values between a "<" and a ">" symbol.
|
||||
|
||||
.SH REBUILD AND WRITE THE TCP STREAM TO FILE
|
||||
@@ -212,7 +212,7 @@
|
||||
(i.e. \fB-wPub\fP), in the file will be written this banner:
|
||||
|
||||
.br
|
||||
-\fB[client|server] offset before:offset after (lenght of rebuilded
|
||||
+\fB[client|server] offset before:offset after (length of rebuilded
|
||||
segment)\fP
|
||||
.br
|
||||
|
||||
@@ -234,12 +234,12 @@
|
||||
(\fB-wRC\fP only the client, \fB-wRS\fP only the server)
|
||||
.TP
|
||||
.B \-wP
|
||||
-Unprintable charachters are written like dots.
|
||||
+Unprintable characters are written like dots.
|
||||
.br
|
||||
(\fB-wPC\fP only the client, \fB-wPS\fP only the server)
|
||||
.TP
|
||||
.B \-wU
|
||||
-\fBU\fPnprintable charachters are
|
||||
+\fBU\fPnprintable characters are
|
||||
displayed as hexadecimal values between a "<" and a ">" symbol.
|
||||
.br
|
||||
(\fB-wPC\fP only the client, \fB-wPS\fP only the server)
|
||||
@@ -288,7 +288,7 @@
|
||||
client are
|
||||
put on stdout. All messages and banners are suppressed, except error
|
||||
messages (\fB-S -v0\fP),
|
||||
-so this option is particulary useful to download an entire
|
||||
+so this option is particularly useful to download an entire
|
||||
fully rebuilded and acknowledged connection.
|
||||
.TP
|
||||
\fB -PS --pipe server \fP
|
||||
--- a/src/text.h
|
||||
+++ b/src/text.h
|
||||
@@ -49,7 +49,7 @@
|
||||
"Usage: " OPTIONS \
|
||||
"Example: tcpick " EXAMPLEARGS "\n\n" \
|
||||
"for an updated list of options see tcpick(1) manpage\n" \
|
||||
- "to see version and license informations try `tcpick --version'\n" \
|
||||
+ "to see version and license information try `tcpick --version'\n" \
|
||||
"or read the `COPYING' file, released with the package\n\n" \
|
||||
"tcpick homepage: http://tcpick.sourceforge.net\n\n" \
|
||||
MAILING_LIST \
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
Description:Tcpick can display timestamps in the output with the -t and -td switch. It currently computes a timestamp on the fly which has the following consequences
|
||||
* Inaccurate timestamps when it is operated in real time mode (-i switch)
|
||||
* Nonsense when reassembling off-line captures / when reading pcap files
|
||||
Author: Gerard Wagener
|
||||
Bug-Ubuntu:https://bugs.launchpad.net/ubuntu/+source/tcpick/+bug/364688
|
||||
|
||||
--- a/src/extern.h
|
||||
+++ b/src/extern.h
|
||||
@@ -13,6 +13,7 @@
|
||||
extern struct ip *ippacket;
|
||||
extern struct tcphdr *tcppacket;
|
||||
extern struct udphdr *udppacket;
|
||||
+extern struct pcap_pkthdr* phdr;
|
||||
extern u_char *payload;
|
||||
extern int payload_len;
|
||||
extern struct FLAGS flags;
|
||||
--- a/src/globals.h
|
||||
+++ b/src/globals.h
|
||||
@@ -12,6 +12,7 @@
|
||||
struct ip *ippacket;
|
||||
struct tcphdr *tcppacket;
|
||||
struct udphdr *udppacket;
|
||||
+struct pcap_pkthdr* phdr = NULL;
|
||||
u_char *payload;
|
||||
int payload_len = 0;
|
||||
struct FLAGS flags;
|
||||
--- a/src/loop.c
|
||||
+++ b/src/loop.c
|
||||
@@ -38,6 +38,9 @@
|
||||
|
||||
{ /* FIXME: this function is too long */
|
||||
|
||||
+/* Keep track of the original pcap header in order to put correct timestamps */
|
||||
+ phdr=(struct pcap_pkthdr *)hdr;
|
||||
+
|
||||
/* check if the flag for checking for expired connections
|
||||
is turned on */
|
||||
|
||||
--- a/src/time.c
|
||||
+++ b/src/time.c
|
||||
@@ -32,22 +32,16 @@
|
||||
{
|
||||
|
||||
struct timeval *tp;
|
||||
- struct timezone *tzp;
|
||||
struct tm * brokentime;
|
||||
|
||||
if(flags.displaytime == NOTHING_TIME)
|
||||
goto retNULL;
|
||||
|
||||
- tp = (struct timeval * ) S_malloc( sizeof(struct timeval) );
|
||||
- tzp = (struct timezone * ) S_malloc( sizeof(struct timezone) );
|
||||
+ tp = &phdr->ts;
|
||||
+ if(!tp) {
|
||||
|
||||
- memset(tp, 0, sizeof(struct timeval));
|
||||
- memset(tzp, 0, sizeof(struct timezone));
|
||||
-
|
||||
- if(gettimeofday(tp, tzp)) {
|
||||
-
|
||||
- perror("gettimeofday returned not 0!");
|
||||
- goto retNULL;
|
||||
+ perror("No timestamp was available!");
|
||||
+ goto retNULL;
|
||||
|
||||
} else {
|
||||
brokentime = localtime(&(tp->tv_sec));
|
||||
@@ -93,9 +87,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- S_free ( tp );
|
||||
- S_free ( tzp );
|
||||
-
|
||||
return ret;
|
||||
|
||||
retNULL:
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
Re-merged patch by Robert Scheck <robert@fedoraproject.org> for tcpick <= 0.2.1,
|
||||
which works around the segmentation fault by aborting tcpick.
|
||||
|
||||
The patch is originally from Cédric Delfosse <cedric@debian.org> after the report
|
||||
by Andrea Barisani <andrea@inversepath.com> about the possibility maybe to trigger
|
||||
remotely the segfault condition in tcpick. It's also a better temporary fix rather
|
||||
the initial quick fix posted at the tcpick mailing list, which makes tcpick nearly
|
||||
unusable.
|
||||
|
||||
Further information:
|
||||
- http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0048
|
||||
- http://sourceforge.net/mailarchive/forum.php?thread_id=9989610&forum_id=37151
|
||||
- http://www.securityfocus.com/bid/17665
|
||||
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=360571
|
||||
|
||||
--- tcpick-0.2.1/src/write.c 2005-01-09 00:54:47.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/write.c.CVE-2006-0048 2006-09-09 23:43:07.000000000 +0200
|
||||
@@ -241,6 +241,9 @@
|
||||
if( flags.separator && ( out == stdout ) ) /* FIXME: sucks? */
|
||||
color( c_SEPARATOR, stdout, SEPARATOR "\n" );
|
||||
|
||||
+ if (buflen < 0)
|
||||
+ buflen = 0;
|
||||
+
|
||||
switch ( flavour ) {
|
||||
case HEX_ASCII_DUMP:
|
||||
out_xa( out, buf, buflen );
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
Re-merged patch by Robert Scheck <robert@fedoraproject.org> for tcpick <= 0.2.1,
|
||||
which fixes a double-free error detected by glibc on runtime during the execute of
|
||||
commands like "tcpick -wu -p -i eth0" causing a infinite loop after recording some
|
||||
sessions. The patch is originally from Cédric Delfosse <cedric@debian.org>.
|
||||
|
||||
Further information:
|
||||
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=319864
|
||||
- http://sourceforge.net/mailarchive/message.php?msg_id=20647778
|
||||
|
||||
--- tcpick-0.2.1/src/tracker.c 2004-12-31 14:53:30.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/tracker.c.cpu-loop 2006-09-10 00:17:59.000000000 +0200
|
||||
@@ -99,8 +99,11 @@
|
||||
if( curr->next == NULL )
|
||||
last_conn = prev_ring;
|
||||
|
||||
- free_desc( &(curr->client) );
|
||||
- free_desc( &(curr->server) );
|
||||
+ free_desc( &(curr->client), 1);
|
||||
+ if (flags.writer.type == UNIQUE)
|
||||
+ free_desc( &(curr->server), 0);
|
||||
+ else
|
||||
+ free_desc( &(curr->server), 1);
|
||||
S_free( curr );
|
||||
|
||||
conn = first_conn;
|
||||
@@ -124,7 +127,7 @@
|
||||
count_opened--;
|
||||
}
|
||||
|
||||
-int free_desc( struct HOST_DESC * desc )
|
||||
+int free_desc( struct HOST_DESC * desc, int freedescfilename )
|
||||
/* frees the host descriptor and closes the file */
|
||||
{
|
||||
struct FRAGMENT * tmp;
|
||||
@@ -134,7 +137,7 @@
|
||||
if (flags.writer.type == UNIQUE)
|
||||
desc->oth->file = NULL;
|
||||
}
|
||||
- if( desc->filename ) {
|
||||
+ if( desc->filename && freedescfilename ) {
|
||||
S_free( desc->filename );
|
||||
desc->filename = NULL;
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
Re-merged patch by Robert Scheck <robert@fedoraproject.org> for tcpick <= 0.2.1,
|
||||
to fix multiple "implicitly converted to pointer" messages during build; patch is
|
||||
originally from Dann Frazier <dannf@dannf.org>.
|
||||
|
||||
Further information:
|
||||
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=326927
|
||||
|
||||
--- tcpick-0.2.1/src/display.c 2004-12-31 14:53:30.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/display.c.pointers 2006-09-10 00:04:55.000000000 +0200
|
||||
@@ -28,6 +28,7 @@
|
||||
/* FIXME: most code is duplicated: find a better solution! */
|
||||
|
||||
#include "tcpick.h"
|
||||
+#include "lookup.h"
|
||||
#include "extern.h"
|
||||
|
||||
char *
|
||||
--- tcpick-0.2.1/src/tcpick.c 2005-01-18 13:25:36.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/tcpick.c.pointers 2006-09-10 00:06:02.000000000 +0200
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
#include "tcpick.h"
|
||||
#include "globals.h"
|
||||
+#include "datalink.h"
|
||||
|
||||
char *errbuf[PCAP_ERRBUF_SIZE];
|
||||
struct bpf_program filter_compiled;
|
||||
--- tcpick-0.2.1/src/write.c 2005-01-09 00:54:47.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/write.c.pointers 2006-09-10 00:06:47.000000000 +0200
|
||||
@@ -25,8 +25,11 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
+#define _GNU_SOURCE
|
||||
+#include <string.h>
|
||||
#include "tcpick.h"
|
||||
#include "extern.h"
|
||||
+#include "lookup.h"
|
||||
|
||||
__inline__ char *
|
||||
avail_filename(struct CONN * conn_ptr,
|
||||
--- tcpick-0.2.1/src/lookup.h 2004-12-31 14:53:30.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/lookup.h.pointers 2006-09-10 00:07:38.000000000 +0200
|
||||
@@ -26,6 +26,8 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
+#ifndef _LOOKUP_H
|
||||
+#define _LOOKUP_H
|
||||
|
||||
struct _l_node /* the node/leaf of the tree */
|
||||
{
|
||||
@@ -40,3 +42,9 @@
|
||||
char * name;
|
||||
struct in_addr ip;
|
||||
};
|
||||
+
|
||||
+char *lookup(struct in_addr ia);
|
||||
+struct _l_node *_l_alloc(struct in_addr, char *);
|
||||
+char *_l_get(struct in_addr);
|
||||
+
|
||||
+#endif
|
||||
--- tcpick-0.2.1/src/datalink.h 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/datalink.h.pointers 2006-09-10 00:08:22.000000000 +0200
|
||||
@@ -0,0 +1,29 @@
|
||||
+/*
|
||||
+ * datalink.h -- calculates datalink offsets
|
||||
+ * Part of the tcpick project
|
||||
+ *
|
||||
+ * Author: Francesco Stablum <duskdruid @ despammed.com>
|
||||
+ *
|
||||
+ * Copyright (C) 2003, 2004 Francesco Stablum
|
||||
+ * Licensed under the GPL
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * This program 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; either version 2 of the
|
||||
+ * License, or (at you option) any later version.
|
||||
+ *
|
||||
+ * This program 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., 59 Temple Place - Suite 330, Boston, MA 02111,
|
||||
+ * USA.
|
||||
+ */
|
||||
+
|
||||
+char *datalink2str(int dl_id);
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
Re-merged patch by Robert Scheck <robert@fedoraproject.org> for tcpick <= 0.2.1,
|
||||
because tcpick is possibly unusable on ppc architectures while it never gets past
|
||||
the getopt loop; patch is originally from Cédric Delfosse <cedric@debian.org>.
|
||||
|
||||
Further information:
|
||||
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327327
|
||||
|
||||
--- tcpick-0.2.1/src/args.c 2005-01-16 16:19:35.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/args.c.ppc 2006-09-09 23:51:42.000000000 +0200
|
||||
@@ -149,7 +149,7 @@
|
||||
void
|
||||
parse_args(int argc, char ** argv)
|
||||
{
|
||||
- char opt;
|
||||
+ int opt;
|
||||
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
static struct option long_options[]=
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
Fix a typo. Timezone is a bit longer on 64bit and it triggers
|
||||
a FORTIFY_SOURCE abort.
|
||||
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
|
||||
diff -up tcpick-0.2.1/src/time.c.timezone tcpick-0.2.1/src/time.c
|
||||
--- tcpick-0.2.1/src/time.c.timezone 2009-03-29 17:21:06.512148187 +0200
|
||||
+++ tcpick-0.2.1/src/time.c 2009-03-29 17:21:34.145151786 +0200
|
||||
@@ -42,7 +42,7 @@ char * time_ascii(char * ret)
|
||||
tzp = (struct timezone * ) S_malloc( sizeof(struct timezone) );
|
||||
|
||||
memset(tp, 0, sizeof(struct timeval));
|
||||
- memset(tzp, 0, sizeof(struct timeval));
|
||||
+ memset(tzp, 0, sizeof(struct timezone));
|
||||
|
||||
if(gettimeofday(tp, tzp)) {
|
||||
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
diff -ur tcpick-0.2.1.org/src/extern.h tcpick-0.2.1/src/extern.h
|
||||
--- tcpick-0.2.1.org/src/extern.h 2005-01-13 16:34:01.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/extern.h 2014-01-13 02:03:11.032836174 +0100
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
/* FIXME: it seems written by a ogre */
|
||||
+extern struct ether_header *etherpacket;
|
||||
extern struct ip *ippacket;
|
||||
extern struct tcphdr *tcppacket;
|
||||
extern struct udphdr *udppacket;
|
||||
diff -ur tcpick-0.2.1.org/src/globals.h tcpick-0.2.1/src/globals.h
|
||||
--- tcpick-0.2.1.org/src/globals.h 2005-01-13 16:33:54.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/globals.h 2014-01-13 02:07:09.356161517 +0100
|
||||
@@ -9,6 +9,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
+struct ether_header *etherpacket;
|
||||
struct ip *ippacket;
|
||||
struct tcphdr *tcppacket;
|
||||
struct udphdr *udppacket;
|
||||
diff -ur tcpick-0.2.1.org/src/loop.c tcpick-0.2.1/src/loop.c
|
||||
--- tcpick-0.2.1.org/src/loop.c 2005-01-16 16:26:56.000000000 +0100
|
||||
+++ tcpick-0.2.1/src/loop.c 2014-01-14 01:20:31.796544631 +0100
|
||||
@@ -51,6 +51,18 @@
|
||||
|
||||
count_packets++;
|
||||
|
||||
+ if (hdr->caplen != hdr->len) {
|
||||
+ debug("packet#%d: %d != %d!!! Don't have complete packet. Skipping.",
|
||||
+ count_packets, hdr->caplen, hdr->len);
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
+ etherpacket=(struct ether_header *) packet;
|
||||
+ if (ntohs(etherpacket->ether_type) != ETHERTYPE_IP) {
|
||||
+ debug("packet#%d: protocol is not IP. Skipping.", count_packets);
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
ippacket=(struct ip *)(packet + datalink_size);
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
@@ -69,9 +81,8 @@
|
||||
payload = (u_char *)(packet + datalink_size + IP_SIZE + tcp_size);
|
||||
payload_len = iplen - IP_SIZE - tcp_size;
|
||||
|
||||
-#ifdef TCPICK_DEBUG
|
||||
if( payload_len != (hdr->len - (int)( payload - packet ) ) ) {
|
||||
- suicide( "got_packet",
|
||||
+ /*suicide( "got_packet",
|
||||
"payload lenght calculated with iplen and hdr->len\n"
|
||||
"differs by %d bytes\n"
|
||||
"hdr->len = %d\n"
|
||||
@@ -90,9 +101,19 @@
|
||||
payload_len,
|
||||
(hdr->len - (int)( payload - packet ))
|
||||
);
|
||||
+ */
|
||||
+ /* take as much as we have as payload :-( */
|
||||
+ if (datalink_size + IP_SIZE + tcp_size < hdr->len) {
|
||||
+ payload_len = hdr->len - datalink_size - IP_SIZE - tcp_size;
|
||||
+ debug("packet#%d: %d < %d!!! Don't have complete TCP packet.",
|
||||
+ count_packets-1, hdr->len, datalink_size + iplen);
|
||||
+ } else {
|
||||
+ debug(stdout, "packet#%d: %d < %d!!! Don't have TCP payload. Skipping.",
|
||||
+ count_packets-1, hdr->len, datalink_size + iplen);
|
||||
+ goto end;
|
||||
+ }
|
||||
}
|
||||
|
||||
-#endif /* TCPICK_DEBUG */
|
||||
|
||||
if( flags.header > 0 )
|
||||
display_header( stdout, ippacket, tcppacket,
|
||||
@@ -103,6 +124,11 @@
|
||||
if( payload_len == 0 || SILENCE )
|
||||
goto end;
|
||||
|
||||
+ if( payload_len < 0) {
|
||||
+ debug("oops, got_packet bad payload length(TCP): %d", payload_len);
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
out_flavour( flags.display_payload,
|
||||
stdout, payload, payload_len );
|
||||
|
||||
@@ -116,6 +142,11 @@
|
||||
if( payload_len == 0 || SILENCE )
|
||||
goto end;
|
||||
|
||||
+ if( payload_len < 0) {
|
||||
+ debug("oops, got_packet bad payload length(UDP): %d", payload_len);
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
out_flavour( flags.display_payload,
|
||||
stdout, payload, payload_len );
|
||||
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI="5"
|
||||
EAPI=6
|
||||
|
||||
inherit eutils
|
||||
|
||||
|
|
@ -19,14 +18,17 @@ DEPEND="net-libs/libpcap"
|
|||
RDEPEND="${DEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/tcpick-0.2.1-CVE-2006-0048.patch
|
||||
epatch "${FILESDIR}"/tcpick-0.2.1-ppc.patch
|
||||
epatch "${FILESDIR}"/tcpick-0.2.1-cpu-loop.patch
|
||||
epatch "${FILESDIR}"/tcpick-0.2.1-timezone.patch
|
||||
epatch "${FILESDIR}"/tcpick-0.2.1-pointers.patch
|
||||
epatch "${FILESDIR}"/tcpick_0.2.1-shortpkts.patch
|
||||
epatch "${FILESDIR}"/CVE-2006-0048.patch
|
||||
epatch "${FILESDIR}"/fix-double-free-error.patch
|
||||
epatch "${FILESDIR}"/fix-man-invocation.patch
|
||||
epatch "${FILESDIR}"/fix-build-with-gcc5.patch
|
||||
epatch "${FILESDIR}"/fix-infinite-loop-on-powerpc.patch
|
||||
epatch "${FILESDIR}"/fix-spelling-errors.patch
|
||||
epatch "${FILESDIR}"/set-timestamp-pcap-header-structure.patch
|
||||
eapply_user
|
||||
}
|
||||
|
||||
|
||||
src_install () {
|
||||
dobin src/tcpick
|
||||
dodoc EXAMPLES OPTIONS README
|
||||
Loading…
Reference in a new issue