Foros de daboweb
HARDWARE Y SISTEMAS OPERATIVOS, GNU/Linux, Windows, Mac => GNU/Linux, Unix, *BSD and Free Software, Android => Mensaje iniciado por: Pengüin en 23 de Abril de 2013, 11:27:20 pm
-
Installing Nemesis on Linux (Error: Libnet Library not found)
September 15th, 2011
Posted in Installation . Linux
Write comment
Fb-Button
This brief post deals with installing the packet injection tool Nemesis on a Debian-like machine which probably causes some issues related to the libnet library.
When trying to compile Nemesis the following error gets thrown:
ERROR! Libnet library not found, go get it from
http://www.packetfactory.net/projects/libnet/
or use the --with-libnet-* options, if you have it installed
in unusual place
Because the given URL is not available and most of the HowTos I’ve found didn’t really help me much I’ve decided to write this brief post how to fix this. It seems that Nemesis can only be compiled against libnet-1.0.2.a as stated on the Nemesis website ;) . So grab the tar ball from here and compile it. In my case I put libnet to /usr/local/src:
wget http://www.seronline.de/download/libnet-1.0.2a.tar.gz /usr/local/src
cd /usr/local/src
tar -zxvf libnet-1.0.2a.tar.gz
cd libnet-1.0.2a
./configure && make && make install
Now switch into the nemesis folder and use the –with-libnet-* options to specify where it can find libnet:
./configure --with-libnet-includes=/usr/local/src/libnet-1.0.2a/include \ --with-libnet-libraries=/usr/local/src/libnet-1.0.2a/lib
make && make install
Tras seguir bastantes manuales y pasos no consigo instalar nemesis en el s.o.¿Tiene alguna solución?. :-o
-
¿Es el mismo error que te aparece a ti?
-
¿Es el mismo error que te aparece a ti?
Me da de salida :
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include \ --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
configure: error: invalid variable name: --with-libnet-libraries
¿Qué más puedo hacer?. :-o
-
¿Instalaste libnet-devel? ¿la ruta a libnet es correcta? Se me hace raro que tenga la 'L' en mayúscula: Libnet-1.0.2a
Además, quita esa diagonal en el comando:
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include \ --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
^
Para que quede así:
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
-
Buenas.
Si haces ./configure --help verás las opciones disponibles. Busca alguna que tenga que ver con la librería que te falta. Es que a veces en los foros se explican las cosas en plan «esto y esto», pero sin dar la instrucción o el comando completo, dándolo por sabido.
Si has instalado libnet desde los fuentes en /usr/src/, como pareces dar a entender, tal vez tengas que agregar esa ruta al path de búsqueda del compilador. Si está previsto en el configure, «maravitupendo», pero si no, lo mismo tienes que trastear el propio configure.am (.ac) o algún Makefile.in. Ya se sabe que lo de compilar por cuenta propia siempre es algo más complicado.
También, si no eres experto, sería preferible lanzar los comandos de compilación uno a uno, para ir solucionando las complicaciones más paso a paso. Yo haría primero «./configure», y cuando no diera error haría «make» y cuando no hubiese más errores «make install», en lugar de ./configure && make && make install del tirón y sin respirar.
Y no pongas el nombre de la librería en las instrucciones del tipo «--libnet-include=» pon sólo el path del directorio donde se encuentra. Por ejemplo: /usr/local/src/include o tal vez /usr/local/src/libnet/include y /usr/local/src/libinclude (por dar más o menos una idea). El programa ya conoce el nombre de los archivos que busca, lo que le falta es saber dónde están.
Y una puntualización sobre la barra invertida (sin ánimo de parecer pedante), pero es que eso puede significar que el comando continúa en la línea siguiente. Hay quien lo hace así en lugar de escribirlo todo seguido ocupando varias líneas sin separación. Por lo que si la barra te coincide con el fin de una línea (seguida de un retorno de carro), funcionará, pero si se mete ahí en medio así como así, pues seguramente estorbará.
Saludos.
-
Nemesis 1.4 Debian wheezy amd64.
:dabo:
He cambiado el nombre de la ruta y lo he simplificado cómo dice shicefgo : :cansao:
./configure /usr/local/src/libnet/include /usr/local/src/libnet/lib
Y lo hago también cómo Mr_X : :???:
./configure --with-libnet-includes=/usr/local/src/libnet/include --with-libnet-libraries=/usr/local/src/libnet/lib
Y me devuelve esto : (Y con sólo ./configure también devuelve esto).
./configure /usr/local/src/libnet/include /usr/local/src/libnet/lib
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /usr/local/src/libnet/include
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /usr/local/src/libnet/lib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... /usr/local/src/libnet/include
checking host system type... /usr/local/src/libnet/include
checking for style of include used by make... GNU
checking for /usr/local/src/libnet/include-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... none
checking for gcc option to accept ANSI C... none needed
checking for /usr/local/src/libnet/include-gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) none
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
configure: WARNING: Your OS is not officially supported yet
configure: WARNING: Nemesis may not work properly
checking for an ANSI C-conforming const... yes
checking for gawk... (cached) gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for fabs in -lm... yes
checking for inet_ntoa in -lnsl... yes
checking for socket in -lsocket... no
checking for hstrerror in -lresolv... yes
checking for libnet_build_ip in -lnet... no
ERROR! Libnet library not found, go get it from
http://www.packetfactory.net/projects/libnet/
or use the --with-libnet-* options, if you have it installed
in unusual place
Estoy ofuscada no se que mas hacer. :-o
-
Si haces ./configure --help verás las opciones disponibles...
Como lo comenta shicefgo, deberías probar la ayuda del archivo de configuración. También verifica la ruta de libnet...
-
Si haces ./configure --help verás las opciones disponibles...
Como lo comenta shicefgo, deberías probar la ayuda del archivo de configuración. También verifica la ruta de libnet...
Mr_X , gracias estoy abierta a más sugerencias. :cry:
-
Y ¿qué opciones te muestra la ayuda del configure de nemesis? ¿cómo instalaste libnet?
-
Y ¿qué opciones te muestra la ayuda del configure de nemesis? ¿cómo instalaste libnet?
Opciones de ./configure de nemesis :
./configure --help
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors
--enable-debug enable debugging options (bugreports and developers)
--enable-profile enable profiling options (developers only)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-libnet-includes=DIR libnet include directory
--with-libnet-libraries=DIR libnet library directory
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
¿cómo instalaste libnet?
Desde synaptic libnet1-dev e instalando (libnet-1.0.2a.tar.gz). :verysad:
-
Si seguiste las instrucciones de tu mensaje original
wget http://www.seronline.de/download/libnet-1.0.2a.tar.gz /usr/local/src
cd /usr/local/src
tar -zxvf libnet-1.0.2a.tar.gz
cd libnet-1.0.2a
./configure && make && make install
El comando tendría que ser:
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
Sólo asegúrate que la ruta a libnet-1.0.2a es la correcta...
-
Si seguiste las instrucciones de tu mensaje original
wget http://www.seronline.de/download/libnet-1.0.2a.tar.gz /usr/local/src
cd /usr/local/src
tar -zxvf libnet-1.0.2a.tar.gz
cd libnet-1.0.2a
./configure && make && make install
Aquí me menciona que no reconoce x86_64-pc , te lo muestro :
./configure && make && make install
creating cache ./config.cache
Beginning autoconfiguration process for libnet-1.0.2a...
checking host system type... Invalid configuration `x86_64-pc-linux-gnu': machine `x86_64-pc' not recognized
checking target system type... Invalid configuration `x86_64-pc-linux-gnu': machine `x86_64-pc' not recognized
checking build system type... Invalid configuration `x86_64-pc-linux-gnu': machine `x86_64-pc' not recognized
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for working const... yes
checking for a BSD compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... yes
checking for ranlib... ranlib
checking for ar... ar
checking for ln... ln
checking for strerror... yes
checking for pcap_open_live in -lpcap... yes
checking low-level packet interface type... found SOCK_PACKET
configure: warning: apparently your OS is not officially supported yet
configure: warning: this may not work
you'll have to edit the makefile by hand
please send diffs to [email protected]
checking for libnet_build_ip in -lnet... no
checking machine endianess... lil
checking if unaligned accesses fail... no
checking for sys/sockio.h... no
updating cache ./config.cache
creating ./config.status
creating Makefile
creating test/Makefile
creating test/TCP/Makefile
creating test/Ethernet/Makefile
creating test/UDP/Makefile
creating test/ICMP/Makefile
creating test/Random/Makefile
creating test/OSPF/Makefile
creating util/Makefile
creating util/Get-mac/Makefile
creating example/Makefile
creating libnet-config
creating include/config.h
sed -e 's/.*/#define VERSION "&"/' ./VERSION > version.h
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_resolve.c -o src/libnet_resolve.o
In file included from src/libnet_resolve.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
src/libnet_resolve.c: In function ‘libnet_host_lookup’:
src/libnet_resolve.c:67:17: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:35:0,
from src/libnet_resolve.c:36:
/usr/include/stdio.h:361:12: note: expected ‘char * __restrict__’ but argument is of type ‘u_char *’
src/libnet_resolve.c:71:9: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign]
src/libnet_resolve.c:71:9: note: expected ‘char *’ but argument is of type ‘u_char *’
src/libnet_resolve.c: In function ‘libnet_host_lookup_r’:
src/libnet_resolve.c:95:17: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:35:0,
from src/libnet_resolve.c:36:
/usr/include/stdio.h:361:12: note: expected ‘char * __restrict__’ but argument is of type ‘u_char *’
src/libnet_resolve.c:100:9: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign]
src/libnet_resolve.c:100:9: note: expected ‘char *’ but argument is of type ‘u_char *’
src/libnet_resolve.c: In function ‘libnet_name_resolve’:
src/libnet_resolve.c:116:9: warning: pointer targets in passing argument 1 of ‘inet_addr’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:71:0,
from src/libnet_resolve.c:36:
/usr/include/arpa/inet.h:35:18: note: expected ‘const char *’ but argument is of type ‘u_char *’
src/libnet_resolve.c:118:13: warning: pointer targets in passing argument 1 of ‘gethostbyname’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:73:0,
from src/libnet_resolve.c:36:
/usr/include/netdb.h:145:24: note: expected ‘const char *’ but argument is of type ‘u_char *’
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_socket.c -o src/libnet_socket.o
In file included from src/libnet_socket.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_checksum.c -o src/libnet_checksum.o
In file included from src/libnet_checksum.c:37:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_prand.c -o src/libnet_prand.o
In file included from src/libnet_prand.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_version.c -o src/libnet_version.o
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_write_ip.c -o src/libnet_write_ip.o
In file included from src/libnet_write_ip.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_insert_ipo.c -o src/libnet_insert_ipo.o
In file included from src/libnet_insert_ipo.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_insert_tcpo.c -o src/libnet_insert_tcpo.o
In file included from src/libnet_insert_tcpo.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_error.c -o src/libnet_error.o
In file included from src/libnet_error.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_link_sockpacket.c -o src/libnet_link_sockpacket.o
In file included from src/libnet_link_sockpacket.c:52:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_packet_mem.c -o src/libnet_packet_mem.o
In file included from src/libnet_packet_mem.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_ip.c -o src/libnet_build_ip.o
In file included from src/libnet_build_ip.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_tcp.c -o src/libnet_build_tcp.o
In file included from src/libnet_build_tcp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_udp.c -o src/libnet_build_udp.o
In file included from src/libnet_build_udp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_arp.c -o src/libnet_build_arp.o
In file included from src/libnet_build_arp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_ethernet.c -o src/libnet_build_ethernet.o
In file included from src/libnet_build_ethernet.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_icmp.c -o src/libnet_build_icmp.o
In file included from src/libnet_build_icmp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_igmp.c -o src/libnet_build_igmp.o
In file included from src/libnet_build_igmp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_dns.c -o src/libnet_build_dns.o
In file included from src/libnet_build_dns.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_snmp.c -o src/libnet_build_snmp.o
In file included from src/libnet_build_snmp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_rip.c -o src/libnet_build_rip.o
In file included from src/libnet_build_rip.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_ospf.c -o src/libnet_build_ospf.o
In file included from src/libnet_build_ospf.c:39:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_build_vrrp.c -o src/libnet_build_vrrp.o
In file included from src/libnet_build_vrrp.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_asn1.c -o src/libnet_asn1.o
In file included from src/libnet_asn1.c:59:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_hex_dump.c -o src/libnet_hex_dump.o
In file included from src/libnet_hex_dump.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_if_addr.c -o src/libnet_if_addr.o
In file included from src/libnet_if_addr.c:37:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
src/libnet_if_addr.c: In function ‘libnet_ifaddrlist’:
src/libnet_if_addr.c:56:52: warning: variable ‘mp’ set but not used [-Wunused-but-set-variable]
gcc -O2 -funroll-loops -fomit-frame-pointer -Wall -DHAVE_CONFIG_H -c src/libnet_port_list.c -o src/libnet_port_list.o
In file included from src/libnet_port_list.c:36:0:
src/../include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
src/../include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
src/libnet_port_list.c: In function ‘libnet_plist_chain_dump_string’:
src/libnet_port_list.c:259:13: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:35:0,
from src/libnet_port_list.c:36:
/usr/include/stdio.h:361:12: note: expected ‘char * __restrict__’ but argument is of type ‘u_char *’
src/libnet_port_list.c:263:13: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:35:0,
from src/libnet_port_list.c:36:
/usr/include/stdio.h:361:12: note: expected ‘char * __restrict__’ but argument is of type ‘u_char *’
src/libnet_port_list.c:268:13: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:35:0,
from src/libnet_port_list.c:36:
/usr/include/stdio.h:361:12: note: expected ‘char * __restrict__’ but argument is of type ‘u_char *’
src/libnet_port_list.c:271:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
In file included from src/../include/libnet.h:36:0,
from src/libnet_port_list.c:36:
/usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘u_char *’
src/libnet_port_list.c:271:5: warning: pointer targets in passing argument 1 of ‘__strdup’ differ in signedness [-Wpointer-sign]
In file included from /usr/include/string.h:637:0,
from src/../include/libnet.h:36,
from src/libnet_port_list.c:36:
/usr/include/x86_64-linux-gnu/bits/string2.h:1303:14: note: expected ‘const char *’ but argument is of type ‘u_char *’
src/libnet_port_list.c:271:5: warning: pointer targets in return differ in signedness [-Wpointer-sign]
ar -cr lib/libnet.a src/libnet_resolve.o src/libnet_socket.o src/libnet_checksum.o src/libnet_prand.o src/libnet_version.o src/libnet_write_ip.o src/libnet_insert_ipo.o src/libnet_insert_tcpo.o src/libnet_error.o src/libnet_link_sockpacket.o src/libnet_packet_mem.o src/libnet_build_ip.o src/libnet_build_tcp.o src/libnet_build_udp.o src/libnet_build_arp.o src/libnet_build_ethernet.o src/libnet_build_icmp.o src/libnet_build_igmp.o src/libnet_build_dns.o src/libnet_build_snmp.o src/libnet_build_rip.o src/libnet_build_ospf.o src/libnet_build_vrrp.o src/libnet_asn1.o src/libnet_hex_dump.o src/libnet_if_addr.o src/libnet_port_list.o
ranlib lib/libnet.a
ar -cr lib/libnet.a src/libnet_resolve.o src/libnet_socket.o src/libnet_checksum.o src/libnet_prand.o src/libnet_version.o src/libnet_write_ip.o src/libnet_insert_ipo.o src/libnet_insert_tcpo.o src/libnet_error.o src/libnet_link_sockpacket.o src/libnet_packet_mem.o src/libnet_build_ip.o src/libnet_build_tcp.o src/libnet_build_udp.o src/libnet_build_arp.o src/libnet_build_ethernet.o src/libnet_build_icmp.o src/libnet_build_igmp.o src/libnet_build_dns.o src/libnet_build_snmp.o src/libnet_build_rip.o src/libnet_build_ospf.o src/libnet_build_vrrp.o src/libnet_asn1.o src/libnet_hex_dump.o src/libnet_if_addr.o src/libnet_port_list.o
ranlib lib/libnet.a
./ensure-dir.sh /usr 755
./ensure-dir.sh /usr/lib/ 755
./ensure-dir.sh /usr/include/libnet 755
./ensure-dir.sh /usr/include/ 755
./ensure-dir.sh 755
chmod: falta un operando después de «755»
Pruebe `chmod --help' para más información.
./ensure-dir.sh /usr/bin/ 755
./install-sh lib/libnet.a /usr/lib/
rm -f /usr/lib/libpwrite.a
cd /usr/lib/; ln -f -s libnet.a libpwrite.a
./install-sh include/libnet.h /usr/include/
./install-sh include/libnet/libnet-headers.h /usr/include/libnet
./install-sh include/libnet/libnet-functions.h /usr/include/libnet
./install-sh include/libnet/libnet-structures.h /usr/include/libnet
./install-sh include/libnet/libnet-macros.h /usr/include/libnet
./install-sh include/libnet/libnet-asn1.h /usr/include/libnet
./install-sh include/libnet/libnet-ospf.h /usr/include/libnet
./install-sh doc/libnet.3
install: no destination specified
make: *** [install] Error 1
El comando tendría que ser:
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
Sólo asegúrate que la ruta a libnet-1.0.2a es la correcta...
Sí la ruta es correcta y pongo lo que tu has escrito y me da esta salida de error :
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... none
checking for gcc option to accept ANSI C... none needed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) none
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for gawk... (cached) gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for fabs in -lm... yes
checking for inet_ntoa in -lnsl... yes
checking for socket in -lsocket... no
checking for hstrerror in -lresolv... yes
checking for libnet_build_ip in -lnet... yes
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for strings.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking machine/endian.h usability... no
checking machine/endian.h presence... no
checking for machine/endian.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking libnet.h usability... no
checking libnet.h presence... no
checking for libnet.h... no
ERROR! Libnet header not found, go get it from
http://www.packetfactory.net/projects/libnet/
or use the --with-libnet-* options, if you have it installed
in unusual place
:cry:
-
Prueba lo siguiente:
Entra en el directorio donde tengas libnet (según parece /usr/local/src/Libnet-1.0.2a) y compila e instala normalmente.
Una vez instalada libnet, comprueba que en ese mismo directorio existe un archivo llamado libnet-config. Cópialo a /usr/local/bin y comprueba que tenga permiso de ejecución. Ahora vuelve a intentar compilar e instalar nemesis, sin añadirle parámetros al configure, a ver si hay suerte.
Saludos.
-
Prueba lo siguiente:
Entra en el directorio donde tengas libnet (según parece /usr/local/src/Libnet-1.0.2a) y compila e instala normalmente.
Una vez instalada libnet, comprueba que en ese mismo directorio existe un archivo llamado libnet-config. Cópialo a /usr/local/bin y comprueba que tenga permiso de ejecución. Ahora vuelve a intentar compilar e instalar nemesis, sin añadirle parámetros al configure, a ver si hay suerte.
Saludos.
He seguidos todos tus pasos y me devuelve : :cry:
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... none
checking for gcc option to accept ANSI C... none needed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) none
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for gawk... (cached) gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for fabs in -lm... yes
checking for inet_ntoa in -lnsl... yes
checking for socket in -lsocket... no
checking for hstrerror in -lresolv... yes
checking for libnet_build_ip in -lnet... no
ERROR! Libnet library not found, go get it from
http://www.packetfactory.net/projects/libnet/
or use the --with-libnet-* options, if you have it installed
in unusual place
Nada que se resiste y no quiere , ¿qué otras opciones quedan?. :-o
-
Bueno, es que me ha picado la curiosidad de que las opciones del configure no funcionen y me he bajado los fuentes de los dos paquetes: libnet y nemesis.
El configure.in de nemesis utiliza el shell-script libnet-config para obtener algunos flags a pasar al compilador. Las opciones del configure «--with-libnet-include» y «--with-libnet-libraries» parece, a simple vista y sin profundizar, que estén ahí más para dar el pego que para otra cosa.
Así que he compilado e instalado libnet con ./configure, a continuación make y por último y ya como root make install. Esto ha situado el archivo de cabecera libnet.h directamente en /usr/include y el resto en /usr/include/libnet. El binario libnet.a se copia a /usr/lib. También he abierto libnet.h para ver si había algún error y todo está correcto, en él se incluyen los demás archivos de cabecera de /usr/include/libnet.
El archivo configure.in de nemesis hace uso del script libnet-config, por lo que éste debe estar instalado en el path y tener permisos de ejecución para todo el mundo. Cuando hice ./configure en nemesis, una vez correctamente instalada libnet, sin haber copiado libnet-config al path (/usr/local/bin o /usr/bin), me daba el mismo error que a tí, pero una vez copiado ese script a su sitio el ./configure no me ha dado ningún error.
Pero ayer tenía prisa y no compilé. Hoy he intentado compilar nemesis (con make) y ahí si que hay un error «chungo» (al menos con mi compilador gcc versión 4.7.3):
fgo@yoda:~/tmp/nemesis/nemesis-1.4$ make
make all-recursive
make[1]: se ingresa al directorio `/home/fgo/tmp/nemesis/nemesis-1.4'
Making all in src
make[2]: se ingresa al directorio `/home/fgo/tmp/nemesis/nemesis-1.4/src'
gcc -DHAVE_CONFIG_H -I. -I.. -DLIBNET_LIL_ENDIAN -I/usr/local/include -I/sw/include -g -O2 -Wall -funroll-loops -pipe -c nemesis-functions.c
nemesis-functions.c: In function ‘nemesis_check_link’:
nemesis-functions.c:342:36: error: dereferencing pointer to incomplete type
make[2]: *** [nemesis-functions.o] Error 1
make[2]: se sale del directorio `/home/fgo/tmp/nemesis/nemesis-1.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/home/fgo/tmp/nemesis/nemesis-1.4'
make: *** [all] Error 2
Te pego también la salida del ./configure para que compruebes que yo no he obtenido errores haciéndolo como te he descrito:
fgo@yoda:~/tmp/nemesis/nemesis-1.4$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/fgo/tmp/nemesis/nemesis-1.4/missing: Unknown `--is-lightweight' option
Try `/home/fgo/tmp/nemesis/nemesis-1.4/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... none
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) none
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for gawk... (cached) gawk
checking whether ln -s works... yes
checking for fabs in -lm... yes
checking for inet_ntoa in -lnsl... yes
checking for socket in -lsocket... no
checking for hstrerror in -lresolv... yes
checking for libnet_build_ip in -lnet... yes
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for strings.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking machine/endian.h usability... no
checking machine/endian.h presence... no
checking for machine/endian.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking libnet.h usability... yes
checking libnet.h presence... yes
checking for libnet.h... yes
checking for libnet version 1.0.2a... yes
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for gethostbyname... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for isascii... yes
checking for working memcmp... yes
checking for memset... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strrchr... yes
checking for strtoul... yes
checking for getopt... yes
checking for inet_aton... yes
checking for strlcat... no
checking for strlcpy... no
checking for strsep... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
fgo@yoda:~/tmp/nemesis/nemesis-1.4$
El error de compilación lo da la línea nº 342 del archivo src/nemesis-functions.c en la posicón 36. Pego el código de la función que contiene esa línea:
/**
* Determine if a source Ethernet address has been specified and fill in the
* ETHERhdr structure if necessary.
*
* @param eth ETHERhdr pointer containing the source Ethernet address
* @param device char pointer containing the Ethernet device name
*
* @return 0 on sucess, -1 on failure
*/
int nemesis_check_link(ETHERhdr *eth, char *device)
{
int i;
struct ether_addr *e = NULL;
struct libnet_link_int l2;
memset(&l2, 0, sizeof(struct libnet_link_int));
#ifdef DEBUG
printf("DEBUG: determining if device %s\n has a hardware address "
"assigned.\n", device);
#endif
if (!memcmp(eth->ether_shost, zero, 6))
{
memset(&l2, 0, sizeof(l2));
if ((e = libnet_get_hwaddr(&l2, device, errbuf)) == NULL) /* Posible origen el error */
return -1;
for (i = 0; i < 6; i++)
eth->ether_shost[i] = e->ether_addr_octet[i]; /* Línea 342 */
return 0;
}
else
return 0;
}
El tipo de error viene a ser que un puntero no está correctamente desreferenciado (más o menos mal traducido). El puntero en cuestión es la variable 'e' que apunta (valga la redundancia) a una estructura de tipo ether_addr. Este error puede ser debido a la versión de mi compilador (estoy en Debian Sid), ya que gcc ha ido evolucionando hacia un control cada vez más estricto de los tipos de las variables.
El origen del error podría estar en el valor devuelto por la función libnet_get_hwaddr(&l2, device, errbuf), como indico en un comentario en el código de arriba, pero esto ya es cosa de andar trasteando el código, o «hackeando», en el sentido auténtico del término.
Esa función rellena los datos de una determinada estructura si ha sido especificada una dirección ethernet. Si consigues llegar al mismo punto que yo, y obtienes también el mismo error de compilación, puedes optar por un horrororosísimo parche haciendo que esa función devuelva un '-1', como si el resultado del intento de obtener un valor para 'e' hubiera sido nulo, y a ver qué pasa :???:. También puedes optar por que devuelva '0', como si todo hubiera ido bien, depende de la influencia que pueda tener en el resultado. Pero yo voto por -1 y que haya suerte.
/**
* Determine if a source Ethernet address has been specified and fill in the
* ETHERhdr structure if necessary.
*
* @param eth ETHERhdr pointer containing the source Ethernet address
* @param device char pointer containing the Ethernet device name
*
* @return 0 on sucess, -1 on failure
*/
int nemesis_check_link(ETHERhdr *eth, char *device)
{
return -1;
}
Pues nada, «peazo tostón que m'aquedao», qué le vamos a hacer. :ciego:
Saludos.
-
Gracias por vuestra paciencia , shicefgo no entiendo en lo último que posteas que devo hacer estoy confusa , no se cómo empezar o que editar. :cry:
-
En ese post hay muchas cosas, vuelve a leerlo despacio, que en él detallo todo lo que he hecho hasta poner en marcha al nemesis ese. Funciona, pero supongo que las opciones relacionadas con la dirección ethernet no irán bien.
Resumiendo:
Instala libnet.
Copia el script libnet-config a /usr/local/bin o /usr/bin.
Y ya deberías poder ejecutar el ./configure de nemesis sin que te de errores relacionados con libnet.
Si al compilar obtienes el mismo error que yo, ya podremos volver sobre el asunto, pero lo primero es instalar libnet y conseguir que el configure de nemesis no de errores.
Ah, las autotools... no en vano hay que gente que dice que deberían llamarse autohell (http://www.shlomifish.org/open-source/anti/autohell/) (autoinfierno) :cry:
Yo también me he pasado ya a CMake ;)
Saludos.
-
Parece que libnet tiene errores, además de que nemesis no compila por defecto en la arquitectura x86_64. Revisa este mensaje (http://forum.ivorde.ro/checking-for-libnet-build-ip-in-lnet-no-error-libnet-library-not-found-t135.html) en otro foro...
-
Pero es que yo he instalado libnet sin problemas, y con el parche asqueroso ese que devuelve -1, he echado a andar nemesis. Los fuentes los he descargado a partir de los enlaces que ha puesto Pengüin.
He aquí la salida de un src/nemesis efectuado desde dentro la carpeta nemesis-1.4:
fgo@yoda:~/tmp/nemesis/nemesis-1.4$ src/nemesis
NEMESIS -=- The NEMESIS Project Version 1.4 (Build 26)
NEMESIS Usage:
src/nemesis [mode] [options]
NEMESIS modes:
arp
dns
ethernet
icmp
igmp
ip
ospf (currently non-functional)
rip
tcp
udp
NEMESIS options:
To display options, specify a mode with the option "help".
Y cuando, como root, hago: src/nemesis ip me dice:
IP Packet Injected
O sea, que algo hace...
Visto esto, me da por pensar que el problema con libnet puede ser debido a las «autoinfierno» y no a la librería en sí misma, y ya que lo mencionas, también es posible que el problema de compilación que he obtenido sea debido a la antigüedad del paquete y a que mi arquitectura es de 64 bits. Pero vamos, que se instala una máquina virtual de 32 bits y se hacen pruebas. (Aunque yo no estoy muy por la labor de andar perdiendo mucho más tiempo con esto).
Ah, una cosa más por si acaso: Instalar las autotools (paquetes autoconf y automake) y hacer un autoreconf previo al ./configure. Es que estuve trasteando en el configure.in de nemesis (al final lo dejé como estaba) y cuando se toca ahí hay que reconfigurar, y tal vez eso haya influido en mi resultado...
Saludos.
-
Parece que libnet tiene errores, además de que nemesis no compila por defecto en la arquitectura x86_64. Revisa este mensaje (http://forum.ivorde.ro/checking-for-libnet-build-ip-in-lnet-no-error-libnet-library-not-found-t135.html) en otro foro...
Uso :
Edit "/usr/include/libnet/libnet-headers.h" file (use your specific location) and change:
Code:
#if (!__GLIBC__)
struct ether_addr
{
u_char ether_addr_octet[6];
};
#endif
to
Code:
//#if (!__GLIBC__)
struct ether_addr
{
u_char ether_addr_octet[6];
};
//#endif
Y me compila pero sólo ./configure :
./configure --with-libnet-includes=/usr/local/src/Libnet-1.0.2a/include --with-libnet-libraries=/usr/local/src/Libnet-1.0.2a/lib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... none
checking for gcc option to accept ANSI C... none needed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) none
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for gawk... (cached) gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for fabs in -lm... yes
checking for inet_ntoa in -lnsl... yes
checking for socket in -lsocket... no
checking for hstrerror in -lresolv... yes
checking for libnet_build_ip in -lnet... yes
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for strings.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking machine/endian.h usability... no
checking machine/endian.h presence... no
checking for machine/endian.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking libnet.h usability... yes
checking libnet.h presence... yes
checking for libnet.h... yes
checking for libnet version 1.0.2a... yes
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for gethostbyname... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for isascii... yes
checking for working memcmp... yes
checking for memset... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strrchr... yes
checking for strtoul... yes
checking for getopt... yes
checking for inet_aton... yes
checking for strlcat... no
checking for strlcpy... no
checking for strsep... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
Pero a la hora de hacer make falla :
make
make all-recursive
make[1]: se ingresa al directorio `/home/Eva/Escritorio/nemesis-1.4'
Making all in src
make[2]: se ingresa al directorio `/home/Eva/Escritorio/nemesis-1.4/src'
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/src/Libnet-1.0.2a/include -DLIBNET_LIL_ENDIAN -I/usr/local/include -I/sw/include -g -O2 -Wall -funroll-loops -pipe -c `test -f 'nemesis-functions.c' || echo './'`nemesis-functions.c
In file included from nemesis-functions.c:48:0:
/usr/local/src/Libnet-1.0.2a/include/libnet.h:87:8: warning: missing terminating " character [enabled by default]
/usr/local/src/Libnet-1.0.2a/include/libnet.h:89:50: warning: missing terminating " character [enabled by default]
nemesis-functions.c: In function ‘nemesis_check_link’:
nemesis-functions.c:342:36: error: dereferencing pointer to incomplete type
make[2]: *** [nemesis-functions.o] Error 1
make[2]: se sale del directorio `/home/Eva/Escritorio/nemesis-1.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/home/Eva/Escritorio/nemesis-1.4'
make: *** [all] Error 2
¿Qué puedo seguir haciendo?. :-o :cry:
-
Estupendo, ya has conseguido que las autotools funcionen.
Ahora tienes el error de compilación que yo pasé por alto haciendo que una función devolviese un valor fijo. Te explico los pasos con mayor detalle que antes.
Entra al directorio /src dentro de nemesis-1.4, y carga en un editor de texto llano (nada de cosas ni remotamente parecidas a libreoffice y demás familia) el archivo llamado "nemesis-functions.c". Si no sabes a qué me refiero, utiliza nano (nano nemesis-functions.c). En la parte de abajo tiene un pequeño menú con instrucciones de uso. El carácter '^' significa "pulsar la tecla control además de la siguiente", es muy fácil de manejar. Pulsando Control+x te pregunta si quieres guardar antes de salir, te pide confirmación del nombre del archivo y listo.
Una vez cargado el archivo, busca este trozo de código:
/**
* Determine if a source Ethernet address has been specified and fill in the
* ETHERhdr structure if necessary.
*
* @param eth ETHERhdr pointer containing the source Ethernet address
* @param device char pointer containing the Ethernet device name
*
* @return 0 on sucess, -1 on failure
*/
int nemesis_check_link(ETHERhdr *eth, char *device)
{
int i;
struct ether_addr *e = NULL;
struct libnet_link_int l2;
memset(&l2, 0, sizeof(struct libnet_link_int));
#ifdef DEBUG
printf("DEBUG: determining if device %s\n has a hardware address "
"assigned.\n", device);
#endif
if (!memcmp(eth->ether_shost, zero, 6))
{
memset(&l2, 0, sizeof(l2));
if ((e = libnet_get_hwaddr(&l2, device, errbuf)) == NULL) /* Posible origen el error */
return -1;
for (i = 0; i < 6; i++)
eth->ether_shost[i] = e->ether_addr_octet[i]; /* Línea 342 */
return 0;
}
else
return 0;
}
Y borra todo lo que hay entre las llaves de apertura '{' y cierre '}' de la función (la primera y la última), y escribe entre ellas esta única línea: return -1; sin olvidarte del punto y coma; es decir, que te tendría que quedar lo siguiente (nano borra con control+k):
**
* Determine if a source Ethernet address has been specified and fill in the
* ETHERhdr structure if necessary.
*
* @param eth ETHERhdr pointer containing the source Ethernet address
* @param device char pointer containing the Ethernet device name
*
* @return 0 on sucess, -1 on failure
*/
int nemesis_check_link(ETHERhdr *eth, char *device)
{
return -1;
}
Como supongo que guardas el paquete comprimido de nemesis, no te preocupes si te equivocas, lo vuelves a descomprimir y lo reintentas.
Una vez modificada esa función, guarda el archivo y ya puedes salir de src y recompilar.
Lo más probable es que las opciones para ethernet no funcionen, pero supongo que podrás utilizar el resto...
Saludos.
-
Shicefgo gracias , ahora sí funciona nemesis me lo a compilado y el resultado : :-d
nemesis
NEMESIS -=- The NEMESIS Project Version 1.4 (Build 26)
NEMESIS Usage:
nemesis [mode] [options]
NEMESIS modes:
arp
dns
ethernet
icmp
igmp
ip
ospf (currently non-functional)
rip
tcp
udp
NEMESIS options:
To display options, specify a mode with the option "help".
Gracias a todos , ahora estoy algo mas contenta con la solución.Lo doy por solucionado. :dabo: