Commit d241423e authored by Marcos Fouces's avatar Marcos Fouces

New upstream version 5.8.2

parent c70f8ff0
autom4te.cache
*.tar.gz
......@@ -6,10 +6,36 @@ Legend:
- Bug fixed
! Known issue / missing feature
T50 5.8.2 - Sep 10th, 2018
- cksum() RFC 1071 compliance and endianess fixes.
T50 5.8.1 - Sep 4th, 2018
* Some routines were simplified to increase performance.
+ Display Statistics on process termination: Number of packets and throughput (experimental).
(each process will print their statistics preceeded by [PID:...]).
T50 5.8 - Jun 27th, 2018
- Lots of fields were in little endian format (Intel platforms);
- TCP option --ack-seq wasn't being evaluated at command line;
- TCP option --sequence wasn't being evaluated at command ilne;
- TCP option --data-offset wasn't being evaluated at command line;
- TCP option --urg-pointer wasn't being evaluated at command line;
- Corrected range checkings for options;
- Checksums were in little endian format as well (Intel platforms);
* Make sure functions with more than one pointer as arguments have __restrict__ keyword in all of them.
This is a hint to the compiler optimization routines in C99/C11.
* Makefile compile and link options changed -z norelro and -z execstack were reported to cause freezes;
* Using -ftree-vectorize only for x86-64 (Intel), 'cause not all i386 supports SIMD.
T50 5.7.3 - Jun 19th, 2018
* No more GNU Build System. Plain Makefile, bogus configuration script and maintainer's setversion.sh.
Version configuration are in src/include/configuration.h file.
- Forgot to enable USE_ANSI feature on Makefile.
* Added execstack and norelro options to linker (smaller executable).
T50 5.7.2 - Apr 29th, 2018
- When configuring with --enable-debug, lots of compile erros occur. fixed!
* Uses RDRAND on Intel platforms, if it's implemented, preferably.
* RDRAND doesn't need a random seed...
* Prefeer to use RDRAND on Intel platforms, if it's implemented.
* Simplification of randomizer functions due to the fact that RDRAND is, at least, 4 times faster than xorshift128+.
T50 5.7.1 - Mar 9th, 2018
......
# vim: set noet :
#
# __________ ________ _____
# |__ ___/| ____/ / _ \ the fastest packet injector.
# | | |____ \ / /_\ \
# | | / \\ \_/ \
# |____| /________/\\_______/
#
# NOTE: I've got rid of autoconf 'cause there is a dependency there.
# This way you don't need anything other than this makefile to
# compile the project.
VERSION=5.8.2
# Change it to clang if you feel lucky!
CC=gcc
LD=$(CC)
INCLUDEDIR=src/include
CFLAGS=-std=gnu11
LDFLAGS=
LDLIBS=
# Just define DEBUG environment var to compile for debugging:
#
# $ DEBUG=1 make
#
ifdef DEBUG
CFLAGS += -O0 -g
else
# Optimization level 2 (better results) and no canaries.
CFLAGS += -O2 -DNDEBUG
ARCHITECTURE = $(shell arch)
# Options for x86-64
ifeq ($(ARCHITECTURE),x86_64)
CFLAGS += -march=native -ftree-vectorize -flto -fno-stack-protector
LDFLAGS += -flto
endif
# Options for i386
ifeq ($(ARCHITECTURE),i686)
CFLAGS += -march=native -flto -fno-stack-protector
LDFLAGS += -flto
endif
# TODO: tunning for cortex-a#?
# Options for ARMv7-a
ifneq ($(findstr armv7,$(ARCHITECTURE)),)
CFLAGS += -march=armv7-a -fno-stack-protector -flto
LDFLAGS += -flto
endif
# Options for ARMv8-a
ifneq ($(findstr armv8,$(ARCHITECTURE)),)
CFLAGS += -march=armv8-a -fno-stack-protector -flto
LDFLAGS += -flto
endif
# strip symbols and turn more linker optimizations on (if available).
LDFLAGS += -s -O2
endif
CFLAGS += -I $(INCLUDEDIR) -std=gnu11
# Added to use ANSI CSI codes (beautifier).
ifdef USE_ANSI
CFLAGS += -DUSE_ANSI
endif
EXECUTABLE=bin/t50
OBJECTS=\
src/cidr.o \
src/cksum.o \
src/config.o \
src/errors.o \
src/main.o \
src/memalloc.o \
src/modules.o \
src/netio.o \
src/randomizer.o \
src/shuffle.o \
src/usage.o \
src/help/egp_help.o \
src/help/eigrp_help.o \
src/help/general_help.o \
src/help/gre_help.o \
src/help/icmp_help.o \
src/help/igmp_help.o \
src/help/ip_help.o \
src/help/ipsec_help.o \
src/help/ospf_help.o \
src/help/rip_help.o \
src/help/rsvp_help.o \
src/help/tcp_udp_dccp_help.o \
src/modules/dccp.o \
src/modules/egp.o \
src/modules/eigrp.o \
src/modules/gre.o \
src/modules/icmp.o \
src/modules/igmpv1.o \
src/modules/igmpv3.o \
src/modules/ip.o \
src/modules/ipsec.o \
src/modules/ospf.o \
src/modules/ripv1.o \
src/modules/ripv2.o \
src/modules/rsvp.o \
src/modules/tcp.o \
src/modules/udp.o
.PHONY: all clean distclean dist install uninstall
all: $(EXECUTABLE)
# Now we'll compile to ./bin/ directory!
# Explicit rule needed 'cause we have multiple objects.
$(EXECUTABLE): $(OBJECTS)
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
# Implicit rules (all .c files will be compiled!)
src/%.o: src/%.c
src/help/%.o: src/help/%.c
src/modules/%.o: src/modules/%.c
# 'clean' only deletes the object files.
clean:
@echo 'Deleting .o files...'
-find src/ -type f -name '*.o' -delete
# distclean delete the object files AND the executable.
distclean: clean
-rm $(EXECUTABLE) dist/*.gz dist/*.asc
# Shortcut to check if user has root privileges.
define checkifroot
if [ `id -u` -ne 0 ]; then \
echo 'Need root privileges!'; \
exit 1; \
fi
endef
# install and uninstall rules are very simple!
install:
@$(call checkifroot)
@if [ ! -e "$(EXECUTABLE)" ]; then \
echo "Try 'make' first."; \
exit 1; \
fi;
cp bin/t50 /sbin/; cp doc/t50.8 /usr/share/man/man8/; \
chown root: /sbin/t50 /usr/share/man/man8; \
chmod 0750 /sbin/t50; \
gzip -9 /usr/share/man/man8/t50.8; \
chmod 0664 /usr/share/man/man8/t50.8.gz
uninstall:
@$(call checkifroot)
rm /sbin/t50 /usr/share/man/man8/t50.8.gz
# Needed to build the project source tarball (no signature generation here).
dist: distclean
tar -czvf dist/t50-$(VERSION).tar.gz --exclude=*.tar.gz --exclude=*.asc *
SUBDIRS = src .
man_MANS = doc/t50.8
EXTRA_DIST = $(man_MANS) \
doc/README.md \
doc/DOWNLOAD.md \
CHANGELOG \
LICENSE
This diff is collapsed.
......@@ -65,17 +65,26 @@ The main differentiator of the T50 is that it is able to send all protocols, seq
##HOW TO INSTALL
Use the default GNU Build System:
```bash
$ ./configure
$ make
$ sudo make install
```
##CHECKING TARBALL AUTHENTICITY ON GITHUB
##COMPILE OPTIONS
Define environment variable DEBUG before compiling if you don't want full optimizations to take place and symbols linked on executable.
Define USE_ANSI if you want some colorized texts, using ANSI CSI escape codes.
Example:
```bash
$ USE_ANSI=1 make
```
##CHECKING TARBALL AUTHENTICITY
I will attach a signature file for T50 tarballs on GitHub from now on.
I will attach a signature file for T50 tarballs on SourceForge.
To get my public key with GPG:
......@@ -92,10 +101,10 @@ uid Frederico Lamberti Pissarra <fredericopissarra@gmail.com>
sub 4096R/F9AA8B75 2016-10-06 [expires: 2019-10-06]
```
After downloading the tar.gz file (f.i, t50-7.1.tar.gz), get the .asc file as well. To verify if the tarball is authentic, just type the following command:
After downloading the tar.gz file (f.i, t50-5.8.tar.gz), get the .asc file as well. To verify if the tarball is authentic, just type the following command:
```bash
$ gpg --verify tar-7.1.tar.gz.asc tar-7.1.tar.gz
$ gpg --verify t50-5.8.tar.gz.asc t50-5.8.tar.gz
gpg: Signature made Qua 25 Abr 2018 16:46:52 -03 using RSA key ID C09C2054
gpg: Good signature from "Frederico Lamberti Pissarra <fredericopissarra@gmail.com>"
```
This diff is collapsed.
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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, or (at your 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# T50 Build System Configuration File.
#
AC_PREREQ([2.69])
define([VERSION_MAJOR], [5])
define([VERSION_MINOR], [7])
define([VERSION_FIX], [2])
define([VERSION_NUMBER], VERSION_MAJOR[.]VERSION_MINOR[.]VERSION_FIX)
define([T50_GROUP], [t50-dev@googlegroups.com])
AC_INIT([t50],[VERSION_NUMBER],[T50_GROUP],[],[https://github.com/fredericopissarra/t50.git])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/include/configuration.h])
#AC_CANONINCAL_TARGET
#if test "x${target_os}" != "xlinux-gnu"; then
# echo "Cannot compile for this target: ${target_os}. T50 will work only on linux."
# exit 1
#fi
AM_INIT_AUTOMAKE([foreign subdir-objects])
# FIXME: AC_PROG_CC need this?!
CFLAGS=""
LDFLAGS=""
# Use specific compilation flags for debug or release mode.
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [Enable T50 debug information]),
[AM_CFLAGS="-O0 -g -D__HAVE_DEBUG__"; AM_LDFLAGS="-g"],
[AM_CFLAGS="-O2 -DNDEBUG -fno-stack-protector"; AM_LDFLAGS="-s"])
# Use -march=native only if is safe, otherwise try to use -mtune.
AX_GCC_ARCHFLAG([yes],
[AM_CFLAGS="${AM_CFLAGS} -march=native"],
[AX_CHECK_COMPILE_FLAG[-mtune=native],
[AM_CFLAGS="${AM_CFLAGS} -mtune=native"],[]])
AC_ARG_ENABLE([ansi],
AS_HELP_STRING([--enable-ansi], [Enable ANSI codes on T50 messages]),
[AM_CFLAGS="${AM_CFLAGS} -DUSE_ANSI"],[])
AC_PROG_CC
AC_C_STRINGIZE
AC_C_INLINE
AC_C_RESTRICT
AX_C___ATTRIBUTE__
AX_CHECK_COMPILE_FLAG([-std=gnu11],
[AM_CFLAGS+=" -std=gnu11"],
[echo "GNU C11 standard not supported? Aborting..."; exit 1])
AC_PROG_INSTALL
# Define T50 compiler definitions
AC_DEFINE([__HAVE_TURBO__],[1],[Use fork to spawn extra process])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
AC_CHECK_HEADER_STDBOOL
AC_TYPE_PID_T
#AC_TYPE_SIZE_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_REALLOC
# FIXME: regcomp() will vanish, later!
AC_CHECK_FUNCS([alarm regcomp socket strcasecmp strchr strdup strerror strpbrk strtoul])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_OUTPUT
Download and Installing {#download}
=======================
Download T50 source code from sourceforge at http://t50.sf.net or from GitHub at http:://github.com/fredericopissarra/t50.git
Download T50 source code from sourceforge at http://t50.sf.net or from GitLab at http:://gitlab.com/fredericopissarra/t50
To compile and install just do:
<pre>
$ ./configure
$ make
$ sudo make install</pre>
......
.TH T50 8 2017-06-27 "5.6" "T50 man page"
.TH T50 8 2018-09-5 "5.8" "T50 man page"
.SH NAME
T50 - network packet injector
.SH SYNOPSIS
......@@ -14,10 +14,13 @@ This is NOT a DoS tool, but a tool to inject packets using various protocols.
.BI host[/CIDR]
The host address is the target of T50. It can be informed in one of two formats: IP address or URI name. This address can be informed as a range of IPs (by omitting one or mode octects) or using a CIDR separating the IP (full or partial) or URI with "/##", for instance: "192.168/16" or "host.com.local/22". When using a partial IP address T50 will calculate CIDR automatically (8, 16 or 24 bits, if the first, second or third octect [from right to left] are omitted, respectively).
Notice that, sometimes, the "host[/CIDR]" argument is misinterpreted as an option. When this happens, you can use the pseudo option '--' before the host address.
Notice that, sometimes, the "host[/CIDR]" argument is misinterpreted as an option. When this happens, you can use the pseudo option '--' before the host address:
.IP
# t50 --flood -- 192.168.1.32/27
Also, to avoid this error you can provide the host address as the first argument.