debian/0000775000000000000000000000000013116542313007167 5ustar debian/ettercap-graphical.install0000664000000000000000000000026012437034501014314 0ustar /usr/bin/ettercap /usr/bin/ettercap-pkexec /usr/share/ettercap/ettercap.png /usr/share/polkit-1 /usr/share/pixmaps /usr/share/applications /usr/share/man/man*/ettercap-pkexec* debian/watch0000664000000000000000000000017212437034501010220 0ustar version=3 http://ettercap.github.com/ettercap/downloads.html \ (?:.*[/=]|)v(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)).* debian/ettercap-dbg.postinst0000775000000000000000000000050612437034501013341 0ustar #! /bin/sh set -e # Replace documentation directory with symlink docdir="/usr/share/doc/${DPKG_MAINTSCRIPT_PACKAGE}" if [ -d ${docdir} -a ! -L $docdir ]; then if rmdir ${docdir} 2>/dev/null; then ln -sf /usr/share/doc/ettercap-common ${docdir} fi fi case "$1" in configure) ;; esac #DEBHELPER# debian/ettercap-graphical.menu0000664000000000000000000000030712437034501013614 0ustar ?package(ettercap-graphical):needs="X11" section="Applications/Network/Monitoring" \ title="ettercap (as root)" command="ettercap-pkexec -G" \ longtitle="Multipurpose sniffer/interceptor/logger" debian/copyright0000664000000000000000000000351612437034501011127 0ustar This work was packaged for Debian by: Murat Demirten on Wed, 12 Jul 2003 12:50:15 +0200 The upstream development repository is git://github.com/Ettercap/ettercap Some Fedora patches git://pkgs.fedoraproject.org/ettercap.git Upstream Authors: Alberto Ornaghi Marco Valleri Timothy Redaelli Emilio Escobar Eric Milam Bryan Schneiders Gianfranco Costamagna Antonio Collarino Copyright: Copyright (C) 2007 Alberto Ornaghi , Marco Valleri License: 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 your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Additional exemption: compiling, linking, and/or using OpenSSL is allowed. On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". The Debian packaging is: Copyright (C) 2001-2009 Murat Demirten Copyright (C) 2011 Barak A. Pearlmutter and is licensed under the GPL version 2 or (at your option) any later version, see above. debian/patches/0000775000000000000000000000000013116541415010620 5ustar debian/patches/debian-changes0000664000000000000000000006170312437034501013400 0ustar Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . ettercap (1:0.8.0-11) unstable; urgency=medium . * Removing ethtool as b-d for non linux kernels. Author: Gianfranco Costamagna --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- ettercap-0.8.0.orig/CMakeLists.txt +++ ettercap-0.8.0/CMakeLists.txt @@ -19,7 +19,7 @@ option(LIBRARY_BUILD "Build for libetter option(INSTALL_DESKTOP "Install ettercap desktop files" ON) -SET(VALID_BUILD_TYPES Debug Release) +SET(VALID_BUILD_TYPES Debug Release RelWithDebInfo) if(NOT CMAKE_BUILD_TYPE) # Default to using "Release" as our build type. --- ettercap-0.8.0.orig/cmake/Modules/EttercapLibCheck.cmake +++ ettercap-0.8.0/cmake/Modules/EttercapLibCheck.cmake @@ -1,6 +1,7 @@ ## The easy part set(EC_LIBS) +set(EC_LIBETTERCAP_LIBS) set(EC_INCLUDE) set(EF_LIBS) @@ -41,6 +42,7 @@ if(ENABLE_GTK) find_library(FOUND_GTHREAD gthread-2.0) if(FOUND_GTHREAD) set(EC_LIBS ${EC_LIBS} ${FOUND_GTHREAD}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${FOUND_GTHREAD}) endif(FOUND_GTHREAD) else(OS_DARWIN) set(EC_LIBS ${EC_LIBS} gthread-2.0) @@ -51,6 +53,7 @@ if(ENABLE_SSL) find_package(OpenSSL REQUIRED) set(HAVE_OPENSSL 1) set(EC_LIBS ${EC_LIBS} ${OPENSSL_LIBRARIES}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${OPENSSL_LIBRARIES}) set(EC_INCLUDE ${EC_INCLUDE} ${OPENSSL_INCLUDE_DIR}) else(ENABLE_SSL) set(HAVE_OPENSSL 0) @@ -58,6 +61,7 @@ endif(ENABLE_SSL) find_package(ZLIB REQUIRED) set(EC_LIBS ${EC_LIBS} ${ZLIB_LIBRARIES}) +set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${ZLIB_LIBRARIES}) set(EC_INCLUDE ${EC_INCLUDE} ${ZLIB_INCLUDE_DIRS}) set(EL_LIBS ${EL_LIBS} ${ZLIB_LIBRARIES}) @@ -65,6 +69,7 @@ set(CMAKE_THREAD_PREFER_PTHREAD 1) find_package(Threads REQUIRED) if(CMAKE_USE_PTHREADS_INIT) set(EC_LIBS ${EC_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${CMAKE_THREAD_LIBS_INIT}) set(EF_LIBS ${EF_LIBS} ${CMAKE_THREAD_LIBS_INIT}) set(EL_LIBS ${EL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) else(CMAKE_USE_PTHREADS_INIT) @@ -84,6 +89,8 @@ if(NOT HAVE_UTF8) if(HAVE_ICONV) set(HAVE_UTF8 1) set(EC_LIBS ${EC_LIBS} ${HAVE_ICONV}) +# Not needed the next one? + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_ICONV}) set(EL_LIBS ${EL_LIBS} ${HAVE_ICONV}) endif(HAVE_ICONV) endif(NOT HAVE_UTF8) @@ -104,6 +111,7 @@ if(ENABLE_PLUGINS) if(HAVE_DL) set(HAVE_PLUGINS 1) set(EC_LIBS ${EC_LIBS} ${HAVE_DL}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_DL}) endif(HAVE_DL) endif(HAVE_DLOPEN) endif(ENABLE_PLUGINS) @@ -151,6 +159,7 @@ CHECK_FUNCTION_EXISTS(strndup HAVE_STRND find_library(HAVE_PCAP pcap) if(HAVE_PCAP) set(EC_LIBS ${EC_LIBS} ${HAVE_PCAP}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_PCAP}) else(HAVE_PCAP) message(FATAL_ERROR "libpcap not found!") endif(HAVE_PCAP) @@ -190,12 +199,13 @@ endif(NOT LIBNET_FOUND) include_directories(${LIBNET_INCLUDE_DIR}) set(EC_LIBS ${EC_LIBS} ${LIBNET_LIBRARY}) - +set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${LIBNET_LIBRARY}) # end LIBNET find_library(HAVE_RESOLV resolv) if(HAVE_RESOLV) set(EC_LIBS ${EC_LIBS} ${HAVE_RESOLV}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_RESOLV}) set(HAVE_DN_EXPAND 1 CACHE PATH "Found dn_expand") endif(HAVE_RESOLV) @@ -204,5 +214,6 @@ if(PCRE_LIBRARY) set(HAVE_PCRE 1) include_directories(${PCRE_INCLUDE_DIR}) set(EC_LIBS ${EC_LIBS} ${PCRE_LIBRARY}) + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${PCRE_LIBRARY}) set(EF_LIBS ${EF_LIBS} ${PCRE_LIBRARY}) endif(PCRE_LIBRARY) --- ettercap-0.8.0.orig/cmake/Modules/EttercapOSTest.cmake +++ ettercap-0.8.0/cmake/Modules/EttercapOSTest.cmake @@ -1,3 +1,4 @@ +message("Building ${PROJECT_NAME} for detected system: ${CMAKE_SYSTEM_NAME}") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(OS_LINUX 1) elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") @@ -13,6 +14,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Dar set(OS_DARWIN 1) elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set(OS_SOLARIS 1) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "GNU") + set(OS_GNU 1) elseif(MINGW) set(OS_MINGW 1) set(OS_WINDOWS 1) --- ettercap-0.8.0.orig/include/config.h.cmake +++ ettercap-0.8.0/include/config.h.cmake @@ -6,6 +6,7 @@ #cmakedefine OS_BSD_NET #cmakedefine OS_BSD_OPEN #cmakedefine OS_DARWIN +#cmakedefine OS_GNU #cmakedefine WORDS_BIGENDIAN #cmakedefine OS_SIZEOF_P @OS_SIZEOF_P@ --- ettercap-0.8.0.orig/include/ec.h +++ ettercap-0.8.0/include/ec.h @@ -16,6 +16,10 @@ #include #endif +#ifndef PATH_MAX + #define PATH_MAX 1024 +#endif + #if !defined (__USE_GNU) /* for memmem(), strsignal(), etc etc... */ #define __USE_GNU #endif @@ -172,6 +176,9 @@ /* exported by ec_main */ EC_API_EXTERN void clean_exit(int errcode); +/* exported by ec_mem */ +EC_API_EXTERN void safe_free_mem(char **param, int *param_length, char *command); + #endif /* EC_H */ --- ettercap-0.8.0.orig/include/ef_functions.h +++ ettercap-0.8.0/include/ef_functions.h @@ -25,7 +25,7 @@ EF_API_EXTERN void test_filter(char *fil EF_API_EXTERN void print_fop(struct filter_op *fop, u_int32 eip); /* ef_syntax && ef_grammar */ -EF_API_EXTERN int yyerror(char *); +EF_API_EXTERN int yyerror(const char *); EF_API_EXTERN int yylex(void); /* ef_tables */ --- ettercap-0.8.0.orig/src/CMakeLists.txt +++ ettercap-0.8.0/src/CMakeLists.txt @@ -1,4 +1,5 @@ set(EC_SRC + ec_mem.c ec_capture.c ec_checksum.c ec_conf.c @@ -115,9 +116,6 @@ set(EC_SRC protocols/ec_wifi_radiotap.c ) -if (NOT LIBRARY_BUILD) - set(EC_SRC ${EC_SRC} ec_interfaces.c) -endif(NOT LIBRARY_BUILD) if(ENABLE_IPV6) set(EC_SRC ${EC_SRC} protocols/ec_icmp6.c protocols/ec_ip6.c mitm/ec_ip6nd_poison.c) @@ -142,6 +140,8 @@ elseif(OS_MINGW) set(EC_SRC ${EC_SRC} os/ec_mingw.c) elseif(OS_SOLARIS) set(EC_SRC ${EC_SRC} os/ec_solaris.c) +elseif(OS_GNU) + set(EC_SRC ${EC_SRC} os/ec_gnu.c) endif() if(NOT HAVE_STRLCAT) @@ -173,10 +173,8 @@ endif(NOT LIBRARY_BUILD) add_library(lib_ettercap SHARED ${EC_SRC}) add_dependencies(lib_ettercap libnet) +target_link_libraries(lib_ettercap ${EC_LIBETTERCAP_LIBS}) -if (NOT LIBRARY_BUILD) - add_executable(ettercap ec_main.c) -endif(NOT LIBRARY_BUILD) # Only compile lua stuff if lua is enabled! IF(ENABLE_LUA) @@ -194,21 +192,24 @@ IF(ENABLE_LUA) endif() endif(ENABLE_LUA) -if(NOT LIBRARY_BUILD) - target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS}) -else(NOT LIBRARY_BUILD) - target_link_libraries(lib_ettercap ${EC_LIBS}) -endif(NOT LIBRARY_BUILD) +#if(NOT LIBRARY_BUILD) + #target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS}) +#else(NOT LIBRARY_BUILD) + #target_link_libraries(lib_ettercap ${EC_LIBS}) +#endif(NOT LIBRARY_BUILD) set_target_properties(lib_ettercap PROPERTIES ENABLE_EXPORTS On LINK_INTERFACE_LIBRARIES "" # INSTALL_RPATH ${INSTALL_LIBDIR} OUTPUT_NAME ettercap + VERSION 0.0.1 + SOVERSION 0 ) if (NOT LIBRARY_BUILD) - target_link_libraries(ettercap lib_ettercap) + add_executable(ettercap ec_interfaces.c ec_main.c) + target_link_libraries(ettercap ec_interfaces lib_ettercap) set_target_properties(ettercap PROPERTIES INSTALL_RPATH ${INSTALL_LIBDIR} ) --- ettercap-0.8.0.orig/src/ec_encryption.c +++ ettercap-0.8.0/src/ec_encryption.c @@ -205,14 +205,14 @@ int set_wep_key(char *string) /* sanity check */ if (bit <= 0) - SEMIFATAL_ERROR("Unsupported WEP key lenght"); + SEMIFATAL_ERROR("Unsupported WEP key length"); /* the len of the secret part of the RC4 seed */ tmp_wkey_len = bit / 8 - WEP_IV_LEN; /* sanity check */ if (bit != 64 && bit != 128) - SEMIFATAL_ERROR("Unsupported WEP key lenght"); + SEMIFATAL_ERROR("Unsupported WEP key length"); /* get the type of the key */ p = ec_strtok(NULL, ":", &tok); @@ -227,7 +227,7 @@ int set_wep_key(char *string) SEMIFATAL_ERROR("Invalid parsing of the WEP key"); if (type == 's') { - /* escape the string and check its lenght */ + /* escape the string and check its length */ if (strescape((char *)tmp_wkey, p) != (int)tmp_wkey_len) SEMIFATAL_ERROR("Specified WEP key length does not match the given string"); } else if (type == 'p') { --- ettercap-0.8.0.orig/src/ec_encryption_ccmp.c +++ ettercap-0.8.0/src/ec_encryption_ccmp.c @@ -43,9 +43,9 @@ int wpa_ccmp_decrypt(u_char *mac, u_char *data, size_t len, struct wpa_sa sa); static inline void get_PN(u_char *PN, u_char *data); -static inline void get_B0(u_char *B0, u_char *mac, u_char *PN, size_t len); -static inline void get_AAD(u_char *AAD, u_char *mac, u_char *B0); -static int ccmp_decrypt(u_char *enc, u_char *B0, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx); +static inline void get_BZERO(u_char *BZERO, u_char *mac, u_char *PN, size_t len); +static inline void get_AAD(u_char *AAD, u_char *mac, u_char *BZERO); +static int ccmp_decrypt(u_char *enc, u_char *BZERO, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx); /*******************************************/ @@ -58,7 +58,7 @@ int wpa_ccmp_decrypt(u_char *mac, u_char u_char PN[6]; /* 48 bit Packet Number */ size_t data_len = len - sizeof(struct wpa_header); u_char AAD[AES_BLOCK_SIZE*2]; - u_char B0[AES_BLOCK_SIZE], A[AES_BLOCK_SIZE], B[AES_BLOCK_SIZE]; + u_char BZERO[AES_BLOCK_SIZE], A[AES_BLOCK_SIZE], B[AES_BLOCK_SIZE]; u_char decbuf[len]; AES_KEY aes_ctx; @@ -72,24 +72,24 @@ int wpa_ccmp_decrypt(u_char *mac, u_char /* get the Packet Number */ get_PN(PN, data); - /* get the B0 */ - memset(B0, 0, sizeof(B0)); - get_B0(B0, mac, PN, data_len); + /* get the BZERO */ + memset(BZERO, 0, sizeof(BZERO)); + get_BZERO(BZERO, mac, PN, data_len); /* get the Additional Authentication Data */ memset(AAD, 0, sizeof(AAD)); - get_AAD(AAD, mac, B0); + get_AAD(AAD, mac, BZERO); /* Start with the first block and AAD */ - AES_encrypt(B0, A, &aes_ctx); + AES_encrypt(BZERO, A, &aes_ctx); XOR_BLOCK(A, AAD, AES_BLOCK_SIZE); AES_encrypt(A, A, &aes_ctx); XOR_BLOCK(A, AAD + AES_BLOCK_SIZE, AES_BLOCK_SIZE); AES_encrypt(A, A, &aes_ctx); - B0[0] &= 0x07; - B0[14] = B0[15] = 0; - AES_encrypt(B0, B, &aes_ctx); + BZERO[0] &= 0x07; + BZERO[14] = BZERO[15] = 0; + AES_encrypt(BZERO, B, &aes_ctx); /* get the MIC trailer. it is after the end of our packet */ memcpy(mic, data + len, WPA_CCMP_TRAILER); @@ -100,7 +100,7 @@ int wpa_ccmp_decrypt(u_char *mac, u_char memcpy(decbuf, data + sizeof(struct wpa_header), len); /* decrypt the packet */ - if (ccmp_decrypt(decbuf, B0, B, A, mic, len, &aes_ctx) != 0) { + if (ccmp_decrypt(decbuf, BZERO, B, A, mic, len, &aes_ctx) != 0) { //DEBUG_MSG(D_VERBOSE, "WPA (CCMP) decryption failed, packet was skipped"); return -ENOTHANDLED; } @@ -142,25 +142,25 @@ static inline void get_PN(u_char *PN, u_ } -static inline void get_B0(u_char *B0, u_char *mac, u_char *PN, size_t len) +static inline void get_BZERO(u_char *BZERO, u_char *mac, u_char *PN, size_t len) { - B0[0] = 0x59; - B0[1] = 0; /* this will be set later by the callee */ + BZERO[0] = 0x59; + BZERO[1] = 0; /* this will be set later by the callee */ - memcpy(B0 + 2, mac + 10, ETH_ADDR_LEN); + memcpy(BZERO + 2, mac + 10, ETH_ADDR_LEN); - B0[8] = PN[5]; - B0[9] = PN[4]; - B0[10] = PN[3]; - B0[11] = PN[2]; - B0[12] = PN[1]; - B0[13] = PN[0]; + BZERO[8] = PN[5]; + BZERO[9] = PN[4]; + BZERO[10] = PN[3]; + BZERO[11] = PN[2]; + BZERO[12] = PN[1]; + BZERO[13] = PN[0]; - B0[14] = ( len >> 8 ) & 0xFF; - B0[15] = ( len & 0xFF ); + BZERO[14] = ( len >> 8 ) & 0xFF; + BZERO[15] = ( len & 0xFF ); } -static inline void get_AAD(u_char *AAD, u_char *mac, u_char *B0) +static inline void get_AAD(u_char *AAD, u_char *mac, u_char *BZERO) { AAD[0] = 0; /* AAD length >> 8 */ AAD[1] = 0; /* this will be set below */ @@ -177,17 +177,17 @@ static inline void get_AAD(u_char *AAD, if ( (mac[0] & (0x80 | 0x08)) == 0x88 ) { AAD[24] = mac[24] & 0x0f; /* just priority bits */ AAD[25] = 0; - B0[1] = AAD[24]; + BZERO[1] = AAD[24]; AAD[1] = 22 + 2; } else { memset(&AAD[24], 0, 2); - B0[1] = 0; + BZERO[1] = 0; AAD[1] = 22; } } -static int ccmp_decrypt(u_char *enc, u_char *B0, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx) +static int ccmp_decrypt(u_char *enc, u_char *BZERO, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx) { int i = 1; @@ -195,7 +195,7 @@ static int ccmp_decrypt(u_char *enc, u_c len -= WPA_CCMP_TRAILER; while (len >= AES_BLOCK_SIZE) { - CCMP_DECRYPT(i, B, B0, enc, A, AES_BLOCK_SIZE, ctx); + CCMP_DECRYPT(i, B, BZERO, enc, A, AES_BLOCK_SIZE, ctx); enc += AES_BLOCK_SIZE; len -= AES_BLOCK_SIZE; @@ -204,7 +204,7 @@ static int ccmp_decrypt(u_char *enc, u_c /* last block */ if (len != 0) { - CCMP_DECRYPT(i, B, B0, enc, A, len, ctx); + CCMP_DECRYPT(i, B, BZERO, enc, A, len, ctx); } return memcmp(mic, A, WPA_CCMP_TRAILER); --- ettercap-0.8.0.orig/src/ec_main.c +++ ettercap-0.8.0/src/ec_main.c @@ -79,7 +79,9 @@ int main(int argc, char *argv[]) /* activate the signal handler */ signal_handler(); - +#ifdef OS_GNU + fprintf(stdout,"%s is still not fully supported in this OS because of missing live capture support.", GBL_PROGRAM); +#endif /* ettercap copyright */ fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n", GBL_PROGRAM, GBL_VERSION, EC_COPYRIGHT, EC_AUTHORS); --- /dev/null +++ ettercap-0.8.0/src/ec_mem.c @@ -0,0 +1,44 @@ +/* + ettercap -- global variables handling module + + Copyright (C) ALoR & NaGA + + 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 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include + +void safe_free_mem(char **param, int *param_length, char *command) +{ + int k; + + SAFE_FREE(command); + for(k= 0; k < (*param_length); ++k) + SAFE_FREE(param[k]); + SAFE_FREE(param); +} + + + + + + + + +/* EOF */ + +// vim:ts=3:expandtab + --- ettercap-0.8.0.orig/src/ec_send.c +++ ettercap-0.8.0/src/ec_send.c @@ -18,13 +18,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include - +#include #if defined(OS_DARWIN) || defined(OS_BSD) + #define PCAP_DONT_INCLUDE_PCAP_BPF_H 1 + #include #include #include #endif +// Order MATTERS. ec.h includes pcap.h in ec_packet, hence the double inclusion of bpf.h file +/* +/usr/include/net/bpf.h:65:8: error: redefinition of 'struct bpf_program' + struct bpf_program { + ^ +In file included from /usr/include/pcap/pcap.h:51:0, + from /usr/include/pcap.h:45, + from /«PKGBUILDDIR»/include/ec_packet.h:11, + from /«PKGBUILDDIR»/include/ec_sniff.h:6, + from /«PKGBUILDDIR»/include/ec_globals.h:6, + from /«PKGBUILDDIR»/include/ec.h:52, +*/ +#include #include #include --- ettercap-0.8.0.orig/src/interfaces/CMakeLists.txt +++ ettercap-0.8.0/src/interfaces/CMakeLists.txt @@ -71,6 +71,13 @@ if(ENABLE_GTK) endif(ENABLE_GTK) -add_library(ec_interfaces STATIC ${EC_TEXT_SRC} ${EC_DAEMON_SRC} ${EC_WDG_SRC} ${EC_CURSES_SRC} ${EC_GTK_SRC}) +add_library(ec_interfaces STATIC ../ec_interfaces.c ${EC_TEXT_SRC} ${EC_DAEMON_SRC} ${EC_WDG_SRC} ${EC_CURSES_SRC} ${EC_GTK_SRC}) SET_TARGET_PROPERTIES(ec_interfaces PROPERTIES COMPILE_FLAGS -fPIC) target_link_libraries(ec_interfaces ${EC_LIBS}) +set_target_properties(ec_interfaces PROPERTIES + ENABLE_EXPORTS On + LINK_INTERFACE_LIBRARIES "" + # INSTALL_RPATH ${INSTALL_LIBDIR} + OUTPUT_NAME ec_interfaces + ) + --- ettercap-0.8.0.orig/src/interfaces/curses/widgets/wdg.h +++ ettercap-0.8.0/src/interfaces/curses/widgets/wdg.h @@ -117,7 +117,11 @@ extern void wdg_bug(char *file, const ch #define KEY_RETURN '\r' #define KEY_TAB '\t' #define KEY_CTRL_L 12 +// CTRL() is defined in /usr/include/.../ttydefaults.h which is pulled +// in by some long chain via /usr/include/libnet.h +#ifndef CTRL #define CTRL(x) ((x) & 0x1f) +#endif #define KEY_ESC CTRL('[') /* information about the current screen */ --- ettercap-0.8.0.orig/src/interfaces/curses/widgets/wdg_file.c +++ ettercap-0.8.0/src/interfaces/curses/widgets/wdg_file.c @@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include @@ -123,7 +124,7 @@ static int wdg_file_destroy(struct wdg_o /* dealloc the structures */ delwin(ww->win); - /* restore the initial workind direcory */ + /* restore the initial working directory */ chdir(ww->initpath); WDG_SAFE_FREE(wo->extend); --- ettercap-0.8.0.orig/src/interfaces/text/ec_text.c +++ ettercap-0.8.0/src/interfaces/text/ec_text.c @@ -554,18 +554,18 @@ static void text_stats(void) DEBUG_MSG("text_stats (queue) : %lu %lu", (unsigned long)GBL_STATS->queue_curr, (unsigned long)GBL_STATS->queue_max); - fprintf(stdout, "\n Received packets : %8lld\n", GBL_STATS->ps_recv); - fprintf(stdout, " Dropped packets : %8lld %.2f %%\n", GBL_STATS->ps_drop, + fprintf(stdout, "\n Received packets : %8llu\n", (long long unsigned int)GBL_STATS->ps_recv); + fprintf(stdout, " Dropped packets : %8llu %.2f %%\n", (long long unsigned int)GBL_STATS->ps_drop, (GBL_STATS->ps_recv) ? (float)GBL_STATS->ps_drop * 100 / GBL_STATS->ps_recv : 0 ); - fprintf(stdout, " Forwarded : %8lld bytes: %8lld\n\n", GBL_STATS->ps_sent, GBL_STATS->bs_sent); + fprintf(stdout, " Forwarded : %8llu bytes: %8llu\n\n", (long long unsigned int)GBL_STATS->ps_sent, (long long unsigned int)GBL_STATS->bs_sent); fprintf(stdout, " Current queue len : %lu/%lu\n", (unsigned long)GBL_STATS->queue_curr, (unsigned long)GBL_STATS->queue_max); fprintf(stdout, " Sampling rate : %d\n\n", GBL_CONF->sampling_rate); - fprintf(stdout, " Bottom Half received packet : pck: %8lld byte: %8lld\n", - GBL_STATS->bh.pck_recv, GBL_STATS->bh.pck_size); - fprintf(stdout, " Top Half received packet : pck: %8lld byte: %8lld\n", - GBL_STATS->th.pck_recv, GBL_STATS->th.pck_size); + fprintf(stdout, " Bottom Half received packet : pck: %8llu byte: %8lld\n", + (long long unsigned int)GBL_STATS->bh.pck_recv, GBL_STATS->bh.pck_size); + fprintf(stdout, " Top Half received packet : pck: %8llu byte: %8lld\n", + (long long unsigned int)GBL_STATS->th.pck_recv, GBL_STATS->th.pck_size); fprintf(stdout, " Interesting packets : %.2f %%\n\n", (GBL_STATS->bh.pck_recv) ? (float)GBL_STATS->th.pck_recv * 100 / GBL_STATS->bh.pck_recv : 0 ); --- ettercap-0.8.0.orig/src/lua/share/core/ettercap_ffi.lua +++ ettercap-0.8.0/src/lua/share/core/ettercap_ffi.lua @@ -135,17 +135,17 @@ struct packet_object { */ size_t disp_len; u_char * disp_data; - /* for modified packet this is the delta for the lenght */ + /* for modified packet this is the delta for the length */ int delta; size_t inject_len; /* len of the injection */ u_char *inject; /* the fuffer used for injection */ } DATA; - size_t fwd_len; /* lenght of the packet to be forwarded */ + size_t fwd_len; /* length of the packet to be forwarded */ u_char * fwd_packet; /* the pointer to the buffer to be forwarded */ - size_t len; /* total lenght of the packet */ + size_t len; /* total length of the packet */ u_char * packet; /* the buffer containing the real packet */ /* Trace current session for injector chain */ --- /dev/null +++ ettercap-0.8.0/src/os/ec_gnu.c @@ -0,0 +1,53 @@ +/* + ettercap -- GNU hurd specific functions + + 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 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +/* XXX GNU/hurd seems to be NOT supported at this point + See https://github.com/Ettercap/ettercap/issues/151 + http://www.mail-archive.com/debian-hurd@lists.debian.org/msg21345.html + These functions are just "stubs" to allow the package build for hurd + patches are welcome! +*/ +#include +void disable_ip_forward(void); +static void restore_ip_forward(void); +u_int16 get_iface_mtu(const char *iface); +void disable_interface_offload(void); + +/*******************************************/ + +void disable_ip_forward(void) +{ +} + +static void restore_ip_forward(void) +{ +} + +u_int16 get_iface_mtu(const char *iface) +{ + return 0; +} + +void disable_interface_offload(void) +{ +} + +/* EOF */ + +// vim:ts=3:expandtab + --- ettercap-0.8.0.orig/src/os/ec_linux.c +++ ettercap-0.8.0/src/os/ec_linux.c @@ -31,7 +31,6 @@ void disable_ip_forward(void); static void restore_ip_forward(void); u_int16 get_iface_mtu(const char *iface); void disable_interface_offload(void); -void safe_free_mem(char **param, int *param_length, char *command); /*******************************************/ @@ -133,15 +132,6 @@ u_int16 get_iface_mtu(const char *iface) return mtu; } -void safe_free_mem(char **param, int *param_length, char *command) -{ - int k; - - SAFE_FREE(command); - for(k= 0; k < (*param_length); ++k) - SAFE_FREE(param[k]); - SAFE_FREE(param); -} /* * disable segmentation offload on interface --- ettercap-0.8.0.orig/tests/CMakeLists.txt +++ ettercap-0.8.0/tests/CMakeLists.txt @@ -8,7 +8,7 @@ add_custom_target(test_verbose COMMAND $ macro(_t NAME) add_executable(test_${NAME} test_${NAME}.c) add_dependencies(test_${NAME} bundled_check) - target_link_libraries(test_${NAME} lib_ettercap ${CHECK_LIBRARY}) + target_link_libraries(test_${NAME} lib_ettercap ec_interfaces ${CHECK_LIBRARY}) add_test(test_${NAME} ${CMAKE_CURRENT_BINARY_DIR}/test_${NAME}) endmacro(_t NAME) --- ettercap-0.8.0.orig/tests/check/CMakeLists.txt +++ ettercap-0.8.0/tests/check/CMakeLists.txt @@ -34,6 +34,8 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}") ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "Release") SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}") +ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}") ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") SET(EXPORT_PREFIX ${CHECK_PREFIX}) --- ettercap-0.8.0.orig/utils/etterfilter/ef_grammar.y +++ ettercap-0.8.0/utils/etterfilter/ef_grammar.y @@ -412,7 +412,7 @@ struct { * This function is needed by bison. so it MUST exist. * It is the error handler. */ -int yyerror(char *s) +int yyerror(const char *s) { char *error; int i = 0; debian/patches/fix-host-crash.patch0000664000000000000000000003211212437034526014504 0ustar diff --git a/plug-ins/chk_poison/chk_poison.c b/plug-ins/chk_poison/chk_poison.c index 83e19ed..a39bc25 100644 --- a/plug-ins/chk_poison/chk_poison.c +++ b/plug-ins/chk_poison/chk_poison.c @@ -92,8 +92,8 @@ static int chk_poison_init(void *dummy) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_sec = GBL_CONF->arp_storm_delay; - tm.tv_nsec = 0; + tm.tv_sec = 0; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; #endif /* don't show packets while operating */ @@ -133,7 +133,7 @@ static int chk_poison_init(void *dummy) #if !defined(OS_WINDOWS) nanosleep(&tm, NULL); #else - usleep(GBL_CONF->arp_storm_delay); + usleep(GBL_CONF->arp_storm_delay * 1000); #endif } } diff --git a/plug-ins/isolate/isolate.c b/plug-ins/isolate/isolate.c index b00d8c4..cccf5de 100644 --- a/plug-ins/isolate/isolate.c +++ b/plug-ins/isolate/isolate.c @@ -185,8 +185,8 @@ EC_THREAD_FUNC(isolate) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_sec = GBL_CONF->arp_storm_delay; - tm.tv_nsec = 0; + tm.tv_sec = 0; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; #endif /* init the thread and wait for start up */ ec_thread_init(); @@ -207,7 +207,7 @@ EC_THREAD_FUNC(isolate) #if !defined(OS_WINDOWS) nanosleep(&tm, NULL); #else - usleep(GBL_CONF->arp_storm_delay); + usleep(GBL_CONF->arp_storm_delay * 1000); #endif } diff --git a/plug-ins/repoison_arp/repoison_arp.c b/plug-ins/repoison_arp/repoison_arp.c index a347a3c..2b1dd35 100644 --- a/plug-ins/repoison_arp/repoison_arp.c +++ b/plug-ins/repoison_arp/repoison_arp.c @@ -100,8 +100,8 @@ void repoison_victims(void *group_ptr, struct packet_object *po) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_sec = GBL_CONF->arp_storm_delay; - tm.tv_nsec = 0; + tm.tv_sec = 0; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; #endif LIST_HEAD(, hosts_list) *group_head = group_ptr; diff --git a/plug-ins/scan_poisoner/scan_poisoner.c b/plug-ins/scan_poisoner/scan_poisoner.c index 38c5384..0099d17 100644 --- a/plug-ins/scan_poisoner/scan_poisoner.c +++ b/plug-ins/scan_poisoner/scan_poisoner.c @@ -76,8 +76,8 @@ static int scan_poisoner_init(void *dummy) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_sec = GBL_CONF->arp_storm_delay; - tm.tv_nsec = 0; + tm.tv_sec = 0; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; #endif /* don't show packets while operating */ @@ -120,7 +120,7 @@ static int scan_poisoner_init(void *dummy) #if !defined(OS_WINDOWS) nanosleep(&tm, NULL); #else - usleep(GBL_CONF->arp_storm_delay); + usleep(GBL_CONF->arp_storm_delay * 1000); #endif } diff --git a/plug-ins/search_promisc/search_promisc.c b/plug-ins/search_promisc/search_promisc.c index 85032b0..c6448a0 100644 --- a/plug-ins/search_promisc/search_promisc.c +++ b/plug-ins/search_promisc/search_promisc.c @@ -84,8 +84,8 @@ static int search_promisc_init(void *dummy) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_sec = GBL_CONF->arp_storm_delay; - tm.tv_nsec = 0; + tm.tv_sec = 0; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; #endif /* don't show packets while operating */ GBL_OPTIONS->quiet = 1; diff --git a/src/ec_scan.c b/src/ec_scan.c index bb75883..37818c2 100644 --- a/src/ec_scan.c +++ b/src/ec_scan.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,12 @@ #include /* globals */ +static pthread_mutex_t scan_mutex = PTHREAD_MUTEX_INITIALIZER; +#define SCAN_LOCK do{ if (pthread_mutex_trylock(&scan_mutex)) { \ + ec_thread_exit(); return NULL;} \ + } while(0) +#define SCAN_UNLOCK do{ pthread_mutex_unlock(&scan_mutex); } while(0) + /* used to create the random list */ static LIST_HEAD (, ip_list) ip_list_head; @@ -43,8 +50,11 @@ static struct ip_list **rand_array; void build_hosts_list(void); void del_hosts_list(void); -static void scan_netmask(pthread_t pid); -static void scan_targets(pthread_t pid); +static void scan_netmask(); +#ifdef WITH_IPV6 +static void scan_ip6_onlink(); +#endif +static void scan_targets(); int scan_load_hosts(char *filename); int scan_save_hosts(char *filename); @@ -54,9 +64,7 @@ void add_host(struct ip_addr *ip, u_int8 mac[MEDIA_ADDR_LEN], char *name); static void random_list(struct ip_list *e, int max); static void get_response(struct packet_object *po); -static EC_THREAD_FUNC(capture_scan); static EC_THREAD_FUNC(scan_thread); -static void scan_decode(u_char *param, const struct pcap_pkthdr *pkthdr, const u_char *pkt); void __init hook_init(void); static void hosts_list_hook(struct packet_object *po); @@ -131,7 +139,6 @@ void build_hosts_list(void) */ static EC_THREAD_FUNC(scan_thread) { - pthread_t pid; struct hosts_list *hl; struct timespec ts; int i = 1, ret; @@ -158,6 +165,13 @@ static EC_THREAD_FUNC(scan_thread) if (threadize) ec_thread_init(); + /* Only one thread is allowed to scan at a time */ + SCAN_LOCK; + + /* if sniffing is not yet started we need a decoder for the ARP/ND replies */ + if (!GBL_SNIFF->active) + capture_start(GBL_IFACE); + /* * create a simple decode thread, it will call * the right HOOK POINT. so we only have to hook to @@ -165,7 +179,6 @@ static EC_THREAD_FUNC(scan_thread) */ hook_add(HOOK_PACKET_ARP_RP, &get_response); hook_add(HOOK_PACKET_ICMP6_NADV, &get_response); - pid = ec_thread_new("scan_cap", "decoder module while scanning", &capture_scan, NULL); /* * if at least one ip target is ANY, scan the whole netmask @@ -176,9 +189,9 @@ static EC_THREAD_FUNC(scan_thread) * FIXME: ipv4 host gets scanned twice if in target list */ if(GBL_TARGET1->all_ip || GBL_TARGET2->all_ip) { - scan_netmask(pid); + scan_netmask(); } - scan_targets(pid); + scan_targets(); /* * free the temporary array for random computations @@ -197,11 +210,17 @@ static EC_THREAD_FUNC(scan_thread) nanosleep(&ts, NULL); #endif - /* destroy the thread and remove the hook function */ - ec_thread_destroy(pid); + /* remove the hooks for parsing the ARP/ND packets during scan */ hook_del(HOOK_PACKET_ARP, &get_response); hook_del(HOOK_PACKET_ICMP6_NADV, &get_response); + /* if sniffing is not started we have to stop the decoder after scan */ + if (!GBL_SNIFF->active) + capture_stop(GBL_IFACE); + + /* Unlock Mutex */ + SCAN_UNLOCK; + /* count the hosts and print the message */ LIST_FOREACH(hl, &GBL_HOSTLIST, next) { char tmp[MAX_ASCII_ADDR_LEN]; @@ -271,68 +290,6 @@ void del_hosts_list(void) } } - -/* - * capture the packets and call the HOOK POINT - */ -static EC_THREAD_FUNC(capture_scan) -{ - DEBUG_MSG("capture_scan"); - - ec_thread_init(); - - pcap_loop(GBL_IFACE->pcap, -1, scan_decode, EC_THREAD_PARAM); - - return NULL; -} - - -/* - * parses the POs and executes the HOOK POINTs - */ -static void scan_decode(u_char *param, const struct pcap_pkthdr *pkthdr, const u_char *pkt) -{ - FUNC_DECODER_PTR(packet_decoder); - struct packet_object po; - bpf_u_int32 len; - u_char *data; - bpf_u_int32 datalen; - - CANCELLATION_POINT(); - - /* extract data and datalen from pcap packet */ - data = (u_char *)pkt; - datalen = pkthdr->caplen; - - /* alloc the packet object structure to be passet through decoders */ - packet_create_object(&po, data, datalen); - - /* set the po timestamp */ - memcpy(&po.ts, &pkthdr->ts, sizeof(struct timeval)); - - /* - * in this special parsing, the packet must be ignored by - * application layer, leave this untouched. - */ - po.flags |= PO_DONT_DISSECT; - - /* - * start the analysis through the decoders stack - * after this fuction the packet is completed (all flags set) - */ - packet_decoder = get_decoder(LINK_LAYER, GBL_PCAP->dlt); - BUG_IF(packet_decoder == NULL); - packet_decoder(data, datalen, &len, &po); - - /* free the structure */ - packet_destroy_object(&po); - - CANCELLATION_POINT(); - - return; -} - - /* * receives the ARP packets */ @@ -367,7 +324,7 @@ static void get_response(struct packet_object *po) /* * scan the netmask to find all hosts */ -static void scan_netmask(pthread_t pid) +static void scan_netmask(void) { u_int32 netmask, current, myip; int nhosts, i, ret; @@ -377,7 +334,7 @@ static void scan_netmask(pthread_t pid) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; tm.tv_sec = 0; #endif @@ -422,8 +379,10 @@ static void scan_netmask(pthread_t pid) /* user has requested to stop the task */ if (ret == UI_PROGRESS_INTERRUPTED) { INSTANT_USER_MSG("Scan interrupted by user. Partial results may have been recorded...\n"); - /* destroy the capture thread and remove the hook function */ - ec_thread_destroy(pid); + /* stop the capture thread if sniffing is not active */ + if (!GBL_SNIFF->active) + capture_stop(GBL_IFACE); + hook_del(HOOK_PACKET_ARP, &get_response); /* delete the temporary list */ LIST_FOREACH_SAFE(e, &ip_list_head, next, tmp) { @@ -452,11 +411,10 @@ static void scan_netmask(pthread_t pid) DEBUG_MSG("scan_netmask: Complete"); } - /* * scan only the target hosts */ -static void scan_targets(pthread_t pid) +static void scan_targets(void) { int nhosts = 0, found, n = 1, ret; struct ip_list *e, *i, *m, *tmp; @@ -469,7 +427,7 @@ static void scan_targets(pthread_t pid) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; tm.tv_sec = 0; #endif @@ -575,8 +533,10 @@ static void scan_targets(pthread_t pid) /* user has requested to stop the task */ if (ret == UI_PROGRESS_INTERRUPTED) { INSTANT_USER_MSG("Scan interrupted by user. Partial results may have been recorded...\n"); - /* destroy the capture thread and remove the hook function */ - ec_thread_destroy(pid); + /* stop the capture thread if sniffing is not active */ + if (!GBL_SNIFF->active) + capture_stop(GBL_IFACE); + hook_del(HOOK_PACKET_ARP, &get_response); hook_del(HOOK_PACKET_ICMP6_NADV, &get_response); /* delete the temporary list */ @@ -590,7 +550,7 @@ static void scan_targets(pthread_t pid) /* wait for a delay */ #if defined(OS_WINDOWS) - usleep(GBL_CONF->arp_storm_delay * 100); + usleep(GBL_CONF->arp_storm_delay * 1000); #else nanosleep(&tm, NULL); #endif diff --git a/src/mitm/ec_arp_poisoning.c b/src/mitm/ec_arp_poisoning.c index 7be6cb4..d5b4e6a 100644 --- a/src/mitm/ec_arp_poisoning.c +++ b/src/mitm/ec_arp_poisoning.c @@ -152,7 +152,7 @@ static void arp_poisoning_stop(void) #if !defined(OS_WINDOWS) struct timespec tm, ts; - tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; tm.tv_sec = 0; #endif @@ -201,7 +201,7 @@ static void arp_poisoning_stop(void) #if !defined(OS_WINDOWS) nanosleep(&tm, NULL); #else - usleep(GBL_CONF->arp_storm_delay); + usleep(GBL_CONF->arp_storm_delay * 1000); #endif } } @@ -212,7 +212,7 @@ static void arp_poisoning_stop(void) ts.tv_nsec = 0; nanosleep(&ts, NULL); #else - usleep(GBL_CONF->arp_poison_warm_up*1000); + usleep(GBL_CONF->arp_poison_warm_up*1000000); #endif } @@ -245,7 +245,7 @@ EC_THREAD_FUNC(arp_poisoner) #if !defined(OS_WINDOWS) struct timespec tm, ts; - tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; tm.tv_sec = 0; #endif @@ -299,7 +299,7 @@ EC_THREAD_FUNC(arp_poisoner) #if !defined(OS_WINDOWS) nanosleep(&tm, NULL); #else - usleep(GBL_CONF->arp_storm_delay); + usleep(GBL_CONF->arp_storm_delay * 1000); #endif } } @@ -315,17 +315,18 @@ EC_THREAD_FUNC(arp_poisoner) ts.tv_nsec = 0; nanosleep(&ts, NULL); #else - usleep(GBL_CONF->arp_poison_warm_up*1000); + usleep(GBL_CONF->arp_poison_warm_up*1000000); #endif i++; - } else + } else { #if !defined(OS_WINDOWS) ts.tv_sec = GBL_CONF->arp_poison_delay; ts.tv_nsec = 0; - nanosleep(&ts, NULL); + nanosleep(&ts, NULL); #else - usleep(GBL_CONF->arp_poison_delay); + usleep(GBL_CONF->arp_poison_delay * 1000000); #endif + } } return NULL; diff --git a/src/mitm/ec_port_stealing.c b/src/mitm/ec_port_stealing.c index da9c042..bb78573 100644 --- a/src/mitm/ec_port_stealing.c +++ b/src/mitm/ec_port_stealing.c @@ -211,7 +211,7 @@ static void port_stealing_stop(void) #if !defined(OS_WINDOWS) struct timespec tm; - tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000; + tm.tv_nsec = GBL_CONF->arp_storm_delay * 1000000; tm.tv_sec = 0; #endif debian/patches/626dc56686f15f2dda13c48f78c2a666cb6d8506.patch0000664000000000000000000000472213116541414017247 0ustar From 626dc56686f15f2dda13c48f78c2a666cb6d8506 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 9 Feb 2017 16:01:30 +0100 Subject: [PATCH] Exit gracefully in case of corrupted filters (Closes issue #782) --- utils/etterfilter/ef_compiler.c | 4 +++- utils/etterfilter/ef_main.c | 9 +++++++-- utils/etterfilter/ef_output.c | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) Index: ettercap-0.8.0/utils/etterfilter/ef_compiler.c =================================================================== --- ettercap-0.8.0.orig/utils/etterfilter/ef_compiler.c +++ ettercap-0.8.0/utils/etterfilter/ef_compiler.c @@ -253,7 +253,9 @@ struct filter_op *array = NULL; struct unfold_elm *ue; - BUG_IF(tree_root == NULL); + // invalid file + if (tree_root == NULL) + return 0; fprintf(stdout, " Unfolding the meta-tree "); fflush(stdout); Index: ettercap-0.8.0/utils/etterfilter/ef_main.c =================================================================== --- ettercap-0.8.0.orig/utils/etterfilter/ef_main.c +++ ettercap-0.8.0/utils/etterfilter/ef_main.c @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) { - + int ret_value = 0; /* etterfilter copyright */ fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n", GBL_PROGRAM, EC_VERSION, EC_COPYRIGHT, EC_AUTHORS); @@ -85,8 +85,12 @@ fprintf(stdout, "\n\nThe script contains errors...\n\n"); /* write to file */ - if (write_output() != ESUCCESS) - FATAL_ERROR("Cannot write output file (%s)", GBL_OPTIONS.output_file); + ret_value = write_output(); + if (ret_value == -ENOTHANDLED) + FATAL_ERROR("Cannot write output file (%s): the filter is not correctly handled.", GBL_OPTIONS.output_file); + else if (ret_value == -EINVALID) + FATAL_ERROR("Cannot write output file (%s): the filter format is not correct. ", GBL_OPTIONS.output_file); + return 0; } Index: ettercap-0.8.0/utils/etterfilter/ef_output.c =================================================================== --- ettercap-0.8.0.orig/utils/etterfilter/ef_output.c +++ ettercap-0.8.0/utils/etterfilter/ef_output.c @@ -52,6 +52,9 @@ if (fop == NULL) return -ENOTHANDLED; + if (ninst == 0) + return -EINVALID; + /* create the file */ fd = open(GBL_OPTIONS.output_file, O_CREAT | O_RDWR | O_TRUNC | O_BINARY, 0644); ON_ERROR(fd, -1, "Can't create file %s", GBL_OPTIONS.output_file); debian/patches/series0000664000000000000000000000013513116541415012034 0ustar debian-changes fix-host-crash.patch 626dc56686f15f2dda13c48f78c2a666cb6d8506.patch 803.patch debian/patches/803.patch0000664000000000000000000002304613116541414012157 0ustar From d14d2558da14a33abf7baab28957488a75d16af1 Mon Sep 17 00:00:00 2001 From: Alexander Koeppe Date: Thu, 1 Jun 2017 08:56:23 +0200 Subject: [PATCH 1/4] Add ASAN compiler flags in DEBUG build type --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) #Index: ettercap-0.8.0/CMakeLists.txt #=================================================================== #--- ettercap-0.8.0.orig/CMakeLists.txt #+++ ettercap-0.8.0/CMakeLists.txt #@@ -107,7 +107,27 @@ # set(ICON_DIR ${INSTALL_PREFIX}/share/pixmaps CACHE PATH "Binary files installation directory") # set(MAN_INSTALLDIR ${INSTALL_PREFIX}/share/man CACHE PATH "Path for manual pages") # #+ #+# set general build flags for debug build-type # set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb3 -DDEBUG -Wall -Wno-pointer-sign -pg" CACHE STRING "" FORCE) #+# append ASAN build flags if compiler version has support #+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") #+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8) #+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "" FORCE) #+ message("Building with ASAN support (GNU compiler)") #+ else (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8) #+ message("Building without ASAN support (GNU compiler)") #+ endif (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8) #+elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") #+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.1) #+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "" FORCE) #+ message("Building with ASAN support (Clang compiler)") #+ elseif (CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.1) #+ message("Building without ASAN support (Clang compiler)") #+ endif (CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.1) #+endif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") #+ #+# set build flags for release build-type # set(CMAKE_C_FLAGS_RELEASE "-O2 -w" CACHE STRING "" FORCE) # # if(OS_DARWIN) Index: ettercap-0.8.0/include/ec_strings.h =================================================================== --- ettercap-0.8.0.orig/include/ec_strings.h +++ ettercap-0.8.0/include/ec_strings.h @@ -30,7 +30,7 @@ EC_API_EXTERN int match_pattern(const char *s, const char *pattern); EC_API_EXTERN int base64_decode(char *bufplain, const char *bufcoded); -EC_API_EXTERN int strescape(char *dst, char *src); +EC_API_EXTERN int strescape(char *dst, char *src, size_t len); EC_API_EXTERN int str_replace(char **text, const char *s, const char *d); EC_API_EXTERN size_t strlen_utf8(const char *s); EC_API_EXTERN char * ec_strtok(char *s, const char *delim, char **ptrptr); Index: ettercap-0.8.0/src/ec_strings.c =================================================================== --- ettercap-0.8.0.orig/src/ec_strings.c +++ ettercap-0.8.0/src/ec_strings.c @@ -173,13 +173,14 @@ /* * convert the escaped string into a binary one */ -int strescape(char *dst, char *src) +int strescape(char *dst, char *src, size_t len) { char *olddst = dst; + char *oldsrc = src; int c; int val; - while ((c = *src++) != '\0') { + while ((c = *src++) != '\0' && (size_t)(src - oldsrc) <= len) { if (c == '\\') { switch ((c = *src++)) { case '\0': @@ -224,9 +225,11 @@ if (c >= '0' && c <= '7') val = (val << 3) | (c - '0'); else - --src; + if (src > oldsrc) /* protect against buffer underflow */ + --src; } else - --src; + if (src > oldsrc) /* protect against buffer underflow */ + --src; *dst++ = (char) val; break; @@ -238,15 +241,17 @@ c = hextoint(*src++); if (c >= 0) val = (val << 4) + c; - else - --src; - } else - --src; + else if (src > oldsrc) /* protect against buffer underflow */ + --src; + } else if (src > oldsrc) /* protect against buffer underflow */ + --src; *dst++ = (char) val; break; } - } else if (c == 8 || c == 263) /* the backspace */ - dst--; + } else if (c == 8 || c == 263) { /* the backspace */ + if (dst > oldsrc) /* protect against buffer underflow */ + dst--; + } else *dst++ = (char) c; } Index: ettercap-0.8.0/src/ec_encryption.c =================================================================== --- ettercap-0.8.0.orig/src/ec_encryption.c +++ ettercap-0.8.0/src/ec_encryption.c @@ -228,7 +228,7 @@ if (type == 's') { /* escape the string and check its length */ - if (strescape((char *)tmp_wkey, p) != (int)tmp_wkey_len) + if (strescape((char *)tmp_wkey, p, strlen(tmp_wkey)+1) != (int)tmp_wkey_len) SEMIFATAL_ERROR("Specified WEP key length does not match the given string"); } else if (type == 'p') { /* create the key from the passphrase */ Index: ettercap-0.8.0/src/interfaces/curses/ec_curses_view_connections.c =================================================================== --- ettercap-0.8.0.orig/src/interfaces/curses/ec_curses_view_connections.c +++ ettercap-0.8.0/src/interfaces/curses/ec_curses_view_connections.c @@ -584,7 +584,7 @@ size_t len; /* escape the sequnces in the buffer */ - len = strescape((char*)injectbuf, (char*)injectbuf); + len = strescape((char*)injectbuf, (char*)injectbuf, strlen(injectbuf)+1); /* check where to inject */ if (wdg_c1->flags & WDG_OBJ_FOCUSED) { Index: ettercap-0.8.0/src/interfaces/gtk/ec_gtk_view_connections.c =================================================================== --- ettercap-0.8.0.orig/src/interfaces/gtk/ec_gtk_view_connections.c +++ ettercap-0.8.0/src/interfaces/gtk/ec_gtk_view_connections.c @@ -1239,7 +1239,7 @@ size_t len; /* escape the sequnces in the buffer */ - len = strescape(injectbuf, injectbuf); + len = strescape(injectbuf, injectbuf, strlen(injectbuf)+1); /* check where to inject */ if (side == 1 || side == 2) { Index: ettercap-0.8.0/utils/etterfilter/ef_encode.c =================================================================== --- ettercap-0.8.0.orig/utils/etterfilter/ef_encode.c +++ ettercap-0.8.0/utils/etterfilter/ef_encode.c @@ -117,7 +117,8 @@ fop->op.test.string = (u_char*)strdup(string + 1); /* escape it in the structure */ - fop->op.test.slen = strescape((char*)fop->op.test.string, (char*)fop->op.test.string); + fop->op.test.slen = strescape((char*)fop->op.test.string, + (char*)fop->op.test.string, strlen(fop->op.test.string)+1); return ESUCCESS; @@ -165,7 +166,8 @@ fop->opcode = FOP_FUNC; fop->op.func.op = FFUNC_SEARCH; fop->op.func.string = (u_char*)strdup(dec_args[1]); - fop->op.func.slen = strescape((char*)fop->op.func.string, (char*)fop->op.func.string); + fop->op.func.slen = strescape((char*)fop->op.func.string, + (char*)fop->op.func.string, strlen(fop->op.func.string)+1); ret = ESUCCESS; } } else @@ -182,7 +184,8 @@ fop->opcode = FOP_FUNC; fop->op.func.op = FFUNC_REGEX; fop->op.func.string = (u_char*)strdup(dec_args[1]); - fop->op.func.slen = strescape((char*)fop->op.func.string, (char*)fop->op.func.string); + fop->op.func.slen = strescape((char*)fop->op.func.string, + (char*)fop->op.func.string, strlen(fop->op.func.string)+1); ret = ESUCCESS; } @@ -250,9 +253,11 @@ /* replace always operate at DATA level */ fop->op.func.level = 5; fop->op.func.string = (u_char*)strdup(dec_args[0]); - fop->op.func.slen = strescape((char*)fop->op.func.string, (char*)fop->op.func.string); + fop->op.func.slen = strescape((char*)fop->op.func.string, + (char*)fop->op.func.string, strlen(fop->op.func.string)+1); fop->op.func.replace = (u_char*)strdup(dec_args[1]); - fop->op.func.rlen = strescape((char*)fop->op.func.replace, (char*)fop->op.func.replace); + fop->op.func.rlen = strescape((char*)fop->op.func.replace, + (char*)fop->op.func.replace, strlen(fop->op.func.replace)+1); ret = ESUCCESS; } else SCRIPT_ERROR("Wrong number of arguments for function \"%s\" ", name); @@ -295,7 +300,8 @@ if (nargs == 1) { fop->op.func.op = FFUNC_MSG; fop->op.func.string = (u_char*)strdup(dec_args[0]); - fop->op.func.slen = strescape((char*)fop->op.func.string, (char*)fop->op.func.string); + fop->op.func.slen = strescape((char*)fop->op.func.string, + (char*)fop->op.func.string, strlen(fop->op.func.string)+1); ret = ESUCCESS; } else SCRIPT_ERROR("Wrong number of arguments for function \"%s\" ", name); --- ettercap-0.8.0.orig/src/ec_strings.c +++ ettercap-0.8.0/src/ec_strings.c @@ -31,7 +31,7 @@ int match_pattern(const char *s, const char *pattern); int base64_decode(char *bufplain, const char *bufcoded); static int hextoint(int c); -int strescape(char *dst, char *src); +int strescape(char *dst, char *src, size_t len); int str_replace(char **text, const char *s, const char *d); size_t strlen_utf8(const char *s); char * ec_strtok(char *s, const char *delim, char **ptrptr); debian/shlibs.local0000664000000000000000000000005512437034501011467 0ustar libettercap 0 ettercap-common (>= 1:0.8.0-2) debian/changelog0000664000000000000000000003660313116542312011050 0ustar ettercap (1:0.8.0-11ubuntu0.3) trusty-security; urgency=medium * SECURITY UPDATE (LP: #1695722): * debian/patches/626dc56686f15f2dda13c48f78c2a666cb6d8506.patch: - upstream fix fox CVE-2017-6430 (Closes: #857035) (crash fix when a corrupted filter is used) * debian/patches/803.patch: - fix buffer overflow/underflow with bad filters (Closes: #861604). CVE-2017-8366 (Buffer overflow/underflow issue) - CVE-2017-6430 - CVE-2017-8366 -- Gianfranco Costamagna Sun, 04 Jun 2017 12:50:30 +0200 ettercap (1:0.8.0-11ubuntu0.1) trusty-proposed; urgency=medium * Fix a crash when scanning for hosts. (LP: #1382871) -- Gianfranco Costamagna Sat, 18 Oct 2014 23:09:24 +0200 ettercap (1:0.8.0-11) unstable; urgency=medium * Removing ethtool as b-d for non linux kernels. -- Gianfranco Costamagna Tue, 11 Mar 2014 09:52:02 +0100 ettercap (1:0.8.0-10) unstable; urgency=medium [ Gianfranco Costamagna ] * Fixed other failures on kfreebsd and HURD, due to missing function on not linux platforms [ Barak A. Pearlmutter ] * Prep for release -- Barak A. Pearlmutter Mon, 10 Mar 2014 08:25:34 +0000 ettercap (1:0.8.0-9) unstable; urgency=medium * Order matters, for kfreebsd stuff -- Gianfranco Costamagna Sun, 02 Mar 2014 08:10:37 +0100 ettercap (1:0.8.0-8) unstable; urgency=medium * Another mod for hurd and kfreebsd -- Gianfranco Costamagna Sat, 01 Mar 2014 13:46:57 +0100 ettercap (1:0.8.0-7) unstable; urgency=medium * Hopefully we can get rid of the BPF problem this time. -- Gianfranco Costamagna Fri, 28 Feb 2014 10:36:27 +0100 ettercap (1:0.8.0-6) unstable; urgency=medium * Fixing kfreebsd-* build failure. -- Gianfranco Costamagna Wed, 26 Feb 2014 12:48:14 +0100 ettercap (1:0.8.0-5) unstable; urgency=medium [ Gianfranco Costamagna ] * Fixed ettercap-pkexec path failure with previous upload * sed s/libtldl-dev/libltdl-dev/g -i debian/control to prevent build failures (Closes: #739975) [ Barak A. Pearlmutter ] * Add Gianfranco Costamagna as co-maintainer -- Barak A. Pearlmutter Tue, 25 Feb 2014 19:45:26 +0000 ettercap (1:0.8.0-4) unstable; urgency=medium * Move ettercap-pkexec w/ man page from ettercap-common to ettercap-graphical * sed s/B0/BZERO/g -i src/ec_encryption_ccmp.c to avoid powerpc build failure -- Barak A. Pearlmutter Tue, 25 Feb 2014 14:20:42 +0000 ettercap (1:0.8.0-3) unstable; urgency=medium * Install /usr/bin/ettercap not /usr/sbin/ for non-root log analysis * Disable LUA support -- Barak A. Pearlmutter Tue, 25 Feb 2014 12:08:14 +0000 ettercap (1:0.8.0-2) unstable; urgency=medium * Fiddle faddle with the packaging scripts * Enable lua support with appropriate build dependencies * Name the shared library libettercap.so.0 * Update the lintian overrides -- Barak A. Pearlmutter Mon, 24 Feb 2014 22:43:15 +0000 ettercap (1:0.8.0-1) unstable; urgency=low [ Gianfranco Costamagna ] * New upstream version * Added policykit-1 to ettercap-graphical * Added luajit to build-dep * Updated debian/rules clean target * Removed patches, addressed upstream * Added ethtool dependency, needed for disabling segmentation offload * Tweaked debian/watch file * Install libettercap.so in ettercap-common. * Added libettercap.so to clean target * Bumped standard version to 3.9.5, no changes required. [ Raphaël Hertzog ] * Drop Debian specific patches: - 0001-desktop.patch: upstream uses pkexec by default now, no need to use su-to-root, thus drop dep on menu and add dep on policykit-1 - 0002-centre-scalable-icon.patch: merged upstream * Fix CMakeLists.txt to not barf on Debian's CMAKE_BUILD_TYPE=RelWithDebInfo. * Tweak install files to let upstream install the desktop file, the policy kit rules, and the pkexec wrapper. * Add some lintian overrides to deal with the internal but public libettercap.so. [ Barak A. Pearlmutter ] * Migrated debian/rules clean target to debian/clean * Add "chrpath --delete xxx" to debian/rules as necessary. * Apparently Debian passes CMAKE_BUILD_TYPE=RelWithDebInfo; make it so! -- Barak A. Pearlmutter Mon, 24 Feb 2014 21:07:04 +0000 ettercap (1:0.7.6-1) unstable; urgency=low [ Gianfranco Costamagna ] * New upstream version * Dropped version dependency for curl (fixed in cmake) [ Barak A. Pearlmutter ] * Tweak debian/watch to point to official upstream only -- Barak A. Pearlmutter Wed, 27 Mar 2013 11:44:17 +0000 ettercap (1:0.7.5.3-2) unstable; urgency=low * tweak debian/rules to enable IPv6 with libnet 1.1.6 or greater -- Barak A. Pearlmutter Mon, 25 Feb 2013 22:34:29 +0000 ettercap (1:0.7.5.3-1) unstable; urgency=low * New upstream version -- Barak A. Pearlmutter Sat, 02 Feb 2013 18:33:19 +0000 ettercap (1:0.7.5.2-2) unstable; urgency=low * Merge ongoing upstream mods per upstream request - version number - changelog - options --certificate and --private-key -- Barak A. Pearlmutter Wed, 30 Jan 2013 15:53:55 +0000 ettercap (1:0.7.5.2-1) unstable; urgency=low * New upstream release -- Barak A. Pearlmutter Tue, 29 Jan 2013 16:01:52 +0000 ettercap (1:0.7.5.1-3) unstable; urgency=low * remove bogus but harmlessly dead code from patch for CVE-2013-0722 -- Barak A. Pearlmutter Thu, 17 Jan 2013 23:19:55 +0000 ettercap (1:0.7.5.1-2) unstable; urgency=low * merge upstream patch for CVE-2013-0722 a stack-based buffer overflow when parsing hosts list (closes: #697987) * merge upstream patch for clang compilation issue -- Barak A. Pearlmutter Mon, 14 Jan 2013 10:19:40 +0000 ettercap (1:0.7.5.1-1) unstable; urgency=low * update patches * new upstream release -- Barak A. Pearlmutter Fri, 04 Jan 2013 18:16:56 +0100 ettercap (1:0.7.5-5) unstable; urgency=low * add version dependency for curl library, per upstream reqs * postinst code swizzles doc dirs to symlinks (closes: #693487) -- Barak A. Pearlmutter Sat, 17 Nov 2012 01:07:34 +0000 ettercap (1:0.7.5-4) unstable; urgency=low * use proper debhelper documentation directory link option * add debugging symbols package ettercap-dbg -- Barak A. Pearlmutter Sun, 28 Oct 2012 22:04:20 +0000 ettercap (1:0.7.5-3) unstable; urgency=low * put back version in conflicts with ettercap (closes: #691478) -- Barak A. Pearlmutter Fri, 26 Oct 2012 12:45:37 +0100 ettercap (1:0.7.5-2) unstable; urgency=low * build dependency on ghostscript for ps2pdf, used by cmake scripts to convert man pages to pdf; not included in the Debian packages. -- Barak A. Pearlmutter Fri, 26 Oct 2012 08:44:51 +0100 ettercap (1:0.7.5-1) unstable; urgency=low * New upstream release from new upstream team - switch to cmake build system - various fiddly fixes (closes: #691465) * Modify packaging scripts for new cmake build system. * General packaging updates. * Depend on menu for su-to-root in menu file (closes: #670840) * Misc patches, including - gadu-gadu plugin, so avoid removing functionality - spelling and man page fixes - desktop file and scalable icon - post-release upstream patch avoiding sslstrip.so promiscuous linkage -- Barak A. Pearlmutter Fri, 26 Oct 2012 00:20:00 +0100 ettercap (1:0.7.4.2-1) unstable; urgency=low * New upstream release -- Barak A. Pearlmutter Sun, 13 Nov 2011 22:30:45 +0000 ettercap (1:0.7.4.1+git.17fac4c4a-1) unstable; urgency=low * Track upstream with snapshot release -- Barak A. Pearlmutter Wed, 09 Nov 2011 15:57:15 +0000 ettercap (1:0.7.4.1-1) unstable; urgency=low * New upstream release -- Barak A. Pearlmutter Fri, 02 Sep 2011 17:16:06 +0100 ettercap (1:0.7.4-3) unstable; urgency=low * Add build dependency on flex or other lex provider -- Barak A. Pearlmutter Sat, 13 Aug 2011 06:58:24 +0200 ettercap (1:0.7.4-2) unstable; urgency=low * Add build dependency on bison or other yacc provider * Expand description in executable packages -- Barak A. Pearlmutter Fri, 12 Aug 2011 22:25:44 +0200 ettercap (1:0.7.4-1) unstable; urgency=low * Add new maintainer * Merge NMUs and Ubuntu patches * New upstream release - remove superceded quilt patches - remove superceded Ubuntu patches - includes desktop and icon files - devleopment moved to github * Update debian packaging - Reorganised package names: ettercap-common holds everything except the actual ettercap executable. This comes in two varieties, which are in ettercap-text-only and ettercap-graphical. The latter has both the textual and graphical interfaces, and is thus a functional superset of the former. - bump to source format 3 - add watch file pointing to new upstream repo on github - dh 8 - simplify and shorten rules and related info - bump policy version - add homepage and vcs control fields - put long description on ettercap-common, stub descriptions elsewhere - silence most lintian issues, such as duplicated upsteam changelog - remove old /usr/share/ettercap symlink deletion in installation scripts -- Barak A. Pearlmutter Fri, 12 Aug 2011 15:28:59 +0200 ettercap (1:0.7.3-2.2) unstable; urgency=low * Non-maintainer upload. * 03_fix_ltmain_check.diff: New patch to fix builds with newer grep. (Closes: #634576) * debian/control: Build-Depends against libssl-dev instead of libssl0.9.8. (Closes: #621391) -- Tim Retout Fri, 29 Jul 2011 19:15:22 +0100 ettercap (1:0.7.3-2.1) unstable; urgency=low * Non-maintainer upload. * 01_pointers_and_ints_dont_mix.diff: Cast to u_char* rather than simply removing the cast. Updated patch by Robert Edmonds. (Closes: #521857) -- Tim Retout Thu, 07 Oct 2010 20:34:05 +0100 ettercap (1:0.7.3-2) unstable; urgency=low * Ettercap can see wifi traffics with new libpcap (Closes: #385746). * Ettercap now can build with --enable-debug too (Closes: #438185). * Package should not be orphaned (Closes: #543741). -- Murat Demirten Thu, 29 Sep 2009 17:20:41 +0200 ettercap (1:0.7.3-1.4) unstable; urgency=low * Non-maintainer upload. * Add forgotten build-dependency on autotools-dev, thanks KiBi! -- Andreas Henriksson Thu, 09 Jul 2009 12:21:41 +0200 ettercap (1:0.7.3-1.3) unstable; urgency=low * Non-maintainer upload. * debian/patches/series, debian/patches/01_pointers_and_ints_dont_mix.diff: added, patch by Timothy Redaelli fixes segfault. (Closes: #521857) * debian/control: add quilt build-depedency, use binary:Version instead of Source-Version. * debian/rules: use dh_quilt_{un,}patch to apply/unapply patches, use new config.{guess,sub}, drop deprecated DH_COMPAT. * debian/compat: added. * debian/ettercap-gtk.menu: use su-to-root. (Closes: #479812), replace Apps/Net with new section Applications/Network/Monitoring. * debian/NEWS.Debian: add space before "-- Murat.." to fix syntax error. -- Andreas Henriksson Thu, 09 Jul 2009 10:36:14 +0200 ettercap (1:0.7.3-1.2) unstable; urgency=low * Non-maintainer upload. * Removed debconf dependency since this program does not use debconf. (Closes: #331818) * Updated dependency on libssl to libssl0.9.8. (Closes: #333637) * Bumped compat to 5. * Bumped Standards-Version to 3.7.2, no changes required. -- Ana Beatriz Guerrero Lopez Sat, 4 Nov 2006 19:27:51 +0100 ettercap (1:0.7.3-1.1) unstable; urgency=low * Non-maintainer upload. * Remove the unneccesary Build-Depends on automake. (Closes: #376621) -- Eric Dorland Sat, 2 Sep 2006 18:52:51 -0400 ettercap (1:0.7.3-1) unstable; urgency=low * New upstream release (Closes: #270978 #156770 #312226 #205624) * It's forwarded current ettercap developers long time ago (Closes: #241913) -- Murat Demirten Mon, 06 Jun 2005 14:07:06 +0300 ettercap (1:0.7.1-1) unstable; urgency=low * New upstream release -- Murat Demirten Mon, 11 Oct 2004 20:24:00 +0300 ettercap (1:0.7.0-1) unstable; urgency=low * New upstream release * Package splitting notes now included in NEWS.Debian (Closes: #205172) * New version doesn't segfault on exit (Closes: #254675) -- Murat Demirten Wed, 07 Jul 2004 11:35:20 +0300 ettercap (1:0.6.b-2) unstable; urgency=low * Added autoconf and automake entry in Build-Depends field to build ettercap for other architectures. -- Murat Demirten Mon, 21 Jun 2003 19:57:18 +0200 ettercap (1:0.6.b-1) unstable; urgency=low * New upstream release * Package moved into main from non-us archive (See LICENSE.OPENSSL) * Ettercap split into three package (Closes: #197451) ettercap-common includes configuration files, documentation and plugins. ettercap-gtk compiled with gtk support and ettercap compiled with ncurses support (Closes: #195799) * Ettercap packages now install localized man pages (Closes: #181760) -- Murat Demirten Sun, 12 Jun 2003 14:07:27 +0200 ettercap (1:0.6.a-2) unstable; urgency=low * Fixed important packaging problem (Closes: #193704) -- Murat Demirten Sun, 18 May 2003 12:16:39 +0200 ettercap (1:0.6.a-1) unstable; urgency=low * New upstream release. * Ettercap-plugins package replaced by ettercap. * Ettercap properly reset its terminal when exit (Closes: #179465) * Removed duplicate changelog file (Closes: #176321) * Gtk option enabled (Closes: #185799) -- Murat Demirten Sun, 11 May 2003 19:27:46 +0200 ettercap (1:0.6.9-1) unstable; urgency=low * New upstream release. -- Murat Demirten Fri, 31 Jan 2003 00:48:25 +0200 ettercap (1:0.6.7-1) unstable; urgency=low * New upstream release. -- Murat Demirten Tue, 02 Jul 2002 21:53:38 +0200 ettercap (1:0.6.6.6-1) unstable; urgency=low * New upstream release. -- Murat Demirten Mon, 03 Jun 2002 17:43:20 +0200 ettercap (1:0.6.5-1) unstable; urgency=low * New upstream release. -- Murat Demirten Tue, 23 Apr 2002 12:01:39 +0200 ettercap (1:0.6.4-1) unstable; urgency=low * New upstream release. * Fixes long description line bug of ettercap. (Closes: #130953) * Fixes long description line bug of ettercap-plugins. (Closes: #130952) -- Murat Demirten Fri, 21 Feb 2002 22:36:17 +0200 ettercap (0.6.4.cvs20020101-1) unstable; urgency=low * Fixed packaging problems which prevents automatic rebuilding for ports other than mipsel. * Configuration files go to /etc/ettercap directory. * Better description field * CVS snapshot used which doesn't have some plugin config file problems. -- Murat Demirten Tue, 1 Jan 2002 18:11:41 +0200 ettercap (0.6.3.1-1) unstable; urgency=low * Initial Release (Closes: #112980) -- Murat Demirten Wed, 19 Dec 2001 13:08:46 +0200 debian/ettercap-graphical.postinst0000775000000000000000000000050612437034501014537 0ustar #! /bin/sh set -e # Replace documentation directory with symlink docdir="/usr/share/doc/${DPKG_MAINTSCRIPT_PACKAGE}" if [ -d ${docdir} -a ! -L $docdir ]; then if rmdir ${docdir} 2>/dev/null; then ln -sf /usr/share/doc/ettercap-common ${docdir} fi fi case "$1" in configure) ;; esac #DEBHELPER# debian/ettercap-common.install0000664000000000000000000000050212437034501013651 0ustar /etc /usr/lib/libettercap.so /usr/lib/libettercap.so.* /usr/lib/ettercap/*.so /usr/lib/ettercap /usr/bin/etterfilter /usr/bin/etterlog /usr/share/ettercap # The next line accidentally gets # /usr/share/man/ettercap-pkexec* # which belongs in ettercap-graphical. # This is worked around in debian/rules. /usr/share/man debian/ettercap-common.docs0000664000000000000000000000007212437034501013135 0ustar doc/* README* THANKS TODO.TESTING TODO debian/NEWS.Debian debian/NEWS.Debian0000664000000000000000000000066612437034501011057 0ustar ettercap (1:0.7.4-1) unstable; urgency=low Slightly reorganised packaging: ettercap-common holds everything except the actual ettercap executable. This comes in two varieties, which are in ettercap-text-only and ettercap-graphical. The latter has both the textual and graphical interfaces, and is thus a functional superset of the former. -- Barak A. Pearlmutter Thu, 11 Aug 2011 17:18:09 +0200 debian/clean0000664000000000000000000000002312437034501010167 0ustar ettercap-text-only debian/source/0000775000000000000000000000000012437527513010501 5ustar debian/source/format0000664000000000000000000000001412437034501011675 0ustar 3.0 (quilt) debian/rules0000775000000000000000000000362412437034501010254 0ustar #!/usr/bin/make -f %: dh $@ --parallel LIBNET_VER := $(shell dpkg --status libnet1-dev | awk '/^Version:/ {print $$2}') ENABLE_IPV6 := $(shell \ if dpkg --compare-versions $(LIBNET_VER) ge 1.1.6; \ then echo ON; \ else echo OFF; \ fi) #For some reasons ettercap FTBFS with -PIC enabled #/usr/bin/ld.bfd.real: CMakeFiles/lib_ettercap.dir/dissectors/ec_ssh.c.o: relocation R_X86_64_PC32 against symbol `ssh_conn_key' can not be used when making a shared object; recompile with -fPIC #export DEB_BUILD_MAINT_OPTIONS = hardening=+all override_dh_auto_configure: @echo LIBNET_VER = $(LIBNET_VER) @echo ENABLE_IPV6 = $(ENABLE_IPV6) @echo main configuration deferred until build, as it must be done twice ETTERCAP_OPTIONS= \ -DENABLE_IPV6=$(ENABLE_IPV6) \ -DBUNDLED_LIBS=OFF \ -DENABLE_LUA=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo override_dh_auto_build: @echo Build the text-only executable: dh_auto_configure -- $(ETTERCAP_OPTIONS) -DENABLE_GTK=OFF dh_auto_build mv obj*/src/ettercap ettercap-text-only @echo Build the graphics-enabled executable: dh_auto_configure -- $(ETTERCAP_OPTIONS) -DENABLE_GTK=ON dh_auto_build override_dh_install: dh_install --list-missing mkdir --parents debian/ettercap-text-only/usr/bin/ cp --preserve=mode ettercap-text-only debian/ettercap-text-only/usr/bin/ettercap @echo The ettercap-pkexec man page belongs in ettercap-graphical -rm --verbose debian/ettercap-common/usr/share/man/man*/ettercap-pkexec* @echo Upstream sets RPATH, which is against Debian policy: chrpath --list debian/ettercap-text-only/usr/bin/ettercap chrpath --delete debian/ettercap-text-only/usr/bin/ettercap chrpath --list debian/ettercap-graphical/usr/bin/ettercap chrpath --delete debian/ettercap-graphical/usr/bin/ettercap override_dh_installdocs: dh_installdocs -pettercap-common dh_installdocs -Nettercap-common --link-doc=ettercap-common override_dh_strip: dh_strip --dbg-package=ettercap-dbg debian/compat0000664000000000000000000000000212437034501010365 0ustar 9 debian/ettercap-text-only.postinst0000775000000000000000000000050612437034501014550 0ustar #! /bin/sh set -e # Replace documentation directory with symlink docdir="/usr/share/doc/${DPKG_MAINTSCRIPT_PACKAGE}" if [ -d ${docdir} -a ! -L $docdir ]; then if rmdir ${docdir} 2>/dev/null; then ln -sf /usr/share/doc/ettercap-common ${docdir} fi fi case "$1" in configure) ;; esac #DEBHELPER# debian/control0000664000000000000000000001052713116541424010601 0ustar Source: ettercap Section: net Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Barak A. Pearlmutter Uploaders: Murat Demirten , Gianfranco Costamagna Build-Depends: debhelper (>= 9), cmake, chrpath, bison | bison++ | byacc | byacc-j | yacc | btyacc, flex | lex, libgtk2.0-dev, libltdl-dev | libltdl3-dev, libncurses-dev | libncurses5-dev, libnet1-dev, libpcap-dev | libpcap0.8-dev, libpcre3-dev, libssl-dev, ghostscript, libcurl4-openssl-dev | libcurl-ssl-dev | libcurl-dev, libbsd-dev Standards-Version: 3.9.5 Homepage: http://ettercap.sourceforge.net Vcs-Git: git://github.com/barak/ettercap.git Vcs-Browser: http://github.com/barak/ettercap Package: ettercap-common Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ethtool [linux-any] Recommends: ettercap-graphical | ettercap-text-only Replaces: ettercap-plugins Conflicts: ettercap-plugins, ettercap (<= 1:0.7.3) Description: Multipurpose sniffer/interceptor/logger for switched LAN Ettercap supports active and passive dissection of many protocols (even encrypted ones) and includes many feature for network and host analysis. . Data injection in an established connection and filtering (substitute or drop a packet) on the fly is also possible, keeping the connection synchronized. . Many sniffing modes are implemented, for a powerful and complete sniffing suite. It is possible to sniff in four modes: IP Based, MAC Based, ARP Based (full-duplex) and PublicARP Based (half-duplex). . Ettercap also has the ability to detect a switched LAN, and to use OS fingerprints (active or passive) to find the geometry of the LAN. . This package contains the Common support files, configuration files, plugins, and documentation. You must also install either ettercap-graphical or ettercap-text-only for the actual GUI-enabled or text-only ettercap executable, respectively. Package: ettercap-text-only Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ettercap-common (= ${binary:Version}) Replaces: ettercap-gtk, ettercap-graphical, ettercap Conflicts: ettercap-gtk, ettercap-graphical, ettercap (<= 1:0.7.3) Provides: ettercap Description: Ettercap console-mode executable Ettercap supports active and passive dissection of many protocols (even encrypted ones) and includes many feature for network and host analysis. . Data injection in an established connection and filtering (substitute or drop a packet) on the fly is also possible, keeping the connection synchronized. . Many sniffing modes are implemented, for a powerful and complete sniffing suite. It is possible to sniff in four modes: IP Based, MAC Based, ARP Based (full-duplex) and PublicARP Based (half-duplex). . Ettercap also has the ability to detect a switched LAN, and to use OS fingerprints (active or passive) to find the geometry of the LAN. . This package contains the ettercap text-mode-only executable. Package: ettercap-graphical Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ettercap-common (= ${binary:Version}), policykit-1 Replaces: ettercap-gtk, ettercap-text-only, ettercap, ettercap-common Conflicts: ettercap-gtk, ettercap-text-only, ettercap (<= 1:0.7.3) Provides: ettercap Recommends: gksu Description: Ettercap GUI-enabled executable Ettercap supports active and passive dissection of many protocols (even encrypted ones) and includes many feature for network and host analysis. . Data injection in an established connection and filtering (substitute or drop a packet) on the fly is also possible, keeping the connection synchronized. . Many sniffing modes are implemented, for a powerful and complete sniffing suite. It is possible to sniff in four modes: IP Based, MAC Based, ARP Based (full-duplex) and PublicARP Based (half-duplex). . Ettercap also has the ability to detect a switched LAN, and to use OS fingerprints (active or passive) to find the geometry of the LAN. . This package contains the ettercap GUI-enabled executable. Package: ettercap-dbg Section: debug Priority: extra Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ettercap-common (= ${binary:Version}), ettercap-graphical (= ${binary:Version}) | ettercap-text-only (= ${binary:Version}) Description: Debug symbols for Ettercap. Ettercap runtime debug symbols. debian/ettercap-common.lintian-overrides0000664000000000000000000000037712437034501015653 0ustar # We install libettercap.so.0 which is for private use ettercap-common: postinst-must-call-ldconfig usr/lib/libettercap.so.0 ettercap-common: no-symbols-control-file usr/lib/libettercap.so.0 ettercap-common: package-name-doesnt-match-sonames libettercap0