Advertisement
LocutusOfBorg

ettercap patch

Nov 22nd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.99 KB | None | 0 0
  1. Description: <short summary of the patch>
  2. Reviewed-By: <name and email of someone who approved the patch>
  3. Last-Update: <YYYY-MM-DD>
  4.  
  5. --- ettercap-0.8.0.orig/CMakeLists.txt
  6. +++ ettercap-0.8.0/CMakeLists.txt
  7. @@ -19,7 +19,7 @@ option(LIBRARY_BUILD "Build for libetter
  8. option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
  9.  
  10.  
  11. -SET(VALID_BUILD_TYPES Debug Release)
  12. +SET(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
  13.  
  14. if(NOT CMAKE_BUILD_TYPE)
  15. # Default to using "Release" as our build type.
  16. --- ettercap-0.8.0.orig/cmake/Modules/EttercapLibCheck.cmake
  17. +++ ettercap-0.8.0/cmake/Modules/EttercapLibCheck.cmake
  18. @@ -1,6 +1,7 @@
  19. ## The easy part
  20.  
  21. set(EC_LIBS)
  22. +set(EC_LIBETTERCAP_LIBS)
  23. set(EC_INCLUDE)
  24.  
  25. set(EF_LIBS)
  26. @@ -41,6 +42,7 @@ if(ENABLE_GTK)
  27. find_library(FOUND_GTHREAD gthread-2.0)
  28. if(FOUND_GTHREAD)
  29. set(EC_LIBS ${EC_LIBS} ${FOUND_GTHREAD})
  30. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${FOUND_GTHREAD})
  31. endif(FOUND_GTHREAD)
  32. else(OS_DARWIN)
  33. set(EC_LIBS ${EC_LIBS} gthread-2.0)
  34. @@ -51,6 +53,7 @@ if(ENABLE_SSL)
  35. find_package(OpenSSL REQUIRED)
  36. set(HAVE_OPENSSL 1)
  37. set(EC_LIBS ${EC_LIBS} ${OPENSSL_LIBRARIES})
  38. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${OPENSSL_LIBRARIES})
  39. set(EC_INCLUDE ${EC_INCLUDE} ${OPENSSL_INCLUDE_DIR})
  40. else(ENABLE_SSL)
  41. set(HAVE_OPENSSL 0)
  42. @@ -58,6 +61,7 @@ endif(ENABLE_SSL)
  43.  
  44. find_package(ZLIB REQUIRED)
  45. set(EC_LIBS ${EC_LIBS} ${ZLIB_LIBRARIES})
  46. +set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${ZLIB_LIBRARIES})
  47. set(EC_INCLUDE ${EC_INCLUDE} ${ZLIB_INCLUDE_DIRS})
  48. set(EL_LIBS ${EL_LIBS} ${ZLIB_LIBRARIES})
  49.  
  50. @@ -65,6 +69,7 @@ set(CMAKE_THREAD_PREFER_PTHREAD 1)
  51. find_package(Threads REQUIRED)
  52. if(CMAKE_USE_PTHREADS_INIT)
  53. set(EC_LIBS ${EC_LIBS} ${CMAKE_THREAD_LIBS_INIT})
  54. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${CMAKE_THREAD_LIBS_INIT})
  55. set(EF_LIBS ${EF_LIBS} ${CMAKE_THREAD_LIBS_INIT})
  56. set(EL_LIBS ${EL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
  57. else(CMAKE_USE_PTHREADS_INIT)
  58. @@ -84,6 +89,8 @@ if(NOT HAVE_UTF8)
  59. if(HAVE_ICONV)
  60. set(HAVE_UTF8 1)
  61. set(EC_LIBS ${EC_LIBS} ${HAVE_ICONV})
  62. +# Not needed the next one?
  63. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_ICONV})
  64. set(EL_LIBS ${EL_LIBS} ${HAVE_ICONV})
  65. endif(HAVE_ICONV)
  66. endif(NOT HAVE_UTF8)
  67. @@ -104,6 +111,7 @@ if(ENABLE_PLUGINS)
  68. if(HAVE_DL)
  69. set(HAVE_PLUGINS 1)
  70. set(EC_LIBS ${EC_LIBS} ${HAVE_DL})
  71. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_DL})
  72. endif(HAVE_DL)
  73. endif(HAVE_DLOPEN)
  74. endif(ENABLE_PLUGINS)
  75. @@ -151,6 +159,7 @@ CHECK_FUNCTION_EXISTS(strndup HAVE_STRND
  76. find_library(HAVE_PCAP pcap)
  77. if(HAVE_PCAP)
  78. set(EC_LIBS ${EC_LIBS} ${HAVE_PCAP})
  79. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_PCAP})
  80. else(HAVE_PCAP)
  81. message(FATAL_ERROR "libpcap not found!")
  82. endif(HAVE_PCAP)
  83. @@ -190,12 +199,13 @@ endif(NOT LIBNET_FOUND)
  84.  
  85. include_directories(${LIBNET_INCLUDE_DIR})
  86. set(EC_LIBS ${EC_LIBS} ${LIBNET_LIBRARY})
  87. -
  88. +set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${LIBNET_LIBRARY})
  89. # end LIBNET
  90.  
  91. find_library(HAVE_RESOLV resolv)
  92. if(HAVE_RESOLV)
  93. set(EC_LIBS ${EC_LIBS} ${HAVE_RESOLV})
  94. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_RESOLV})
  95. set(HAVE_DN_EXPAND 1 CACHE PATH "Found dn_expand")
  96. endif(HAVE_RESOLV)
  97.  
  98. @@ -204,5 +214,6 @@ if(PCRE_LIBRARY)
  99. set(HAVE_PCRE 1)
  100. include_directories(${PCRE_INCLUDE_DIR})
  101. set(EC_LIBS ${EC_LIBS} ${PCRE_LIBRARY})
  102. + set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${PCRE_LIBRARY})
  103. set(EF_LIBS ${EF_LIBS} ${PCRE_LIBRARY})
  104. endif(PCRE_LIBRARY)
  105. --- ettercap-0.8.0.orig/tests/CMakeLists.txt
  106. +++ ettercap-0.8.0/tests/CMakeLists.txt
  107. @@ -8,7 +8,7 @@ add_custom_target(test_verbose COMMAND $
  108. macro(_t NAME)
  109. add_executable(test_${NAME} test_${NAME}.c)
  110. add_dependencies(test_${NAME} bundled_check)
  111. - target_link_libraries(test_${NAME} lib_ettercap ${CHECK_LIBRARY})
  112. + target_link_libraries(test_${NAME} lib_ettercap ec_interfaces ${CHECK_LIBRARY})
  113. add_test(test_${NAME} ${CMAKE_CURRENT_BINARY_DIR}/test_${NAME})
  114. endmacro(_t NAME)
  115.  
  116. --- ettercap-0.8.0.orig/tests/check/CMakeLists.txt
  117. +++ ettercap-0.8.0/tests/check/CMakeLists.txt
  118. @@ -34,6 +34,8 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug
  119. SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
  120. ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
  121. SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
  122. +ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
  123. + SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
  124. ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
  125.  
  126. SET(EXPORT_PREFIX ${CHECK_PREFIX})
  127. --- ettercap-0.8.0.orig/src/CMakeLists.txt
  128. +++ ettercap-0.8.0/src/CMakeLists.txt
  129. @@ -115,9 +115,6 @@ set(EC_SRC
  130. protocols/ec_wifi_radiotap.c
  131. )
  132.  
  133. -if (NOT LIBRARY_BUILD)
  134. - set(EC_SRC ${EC_SRC} ec_interfaces.c)
  135. -endif(NOT LIBRARY_BUILD)
  136.  
  137. if(ENABLE_IPV6)
  138. set(EC_SRC ${EC_SRC} protocols/ec_icmp6.c protocols/ec_ip6.c mitm/ec_ip6nd_poison.c)
  139. @@ -173,10 +170,8 @@ endif(NOT LIBRARY_BUILD)
  140.  
  141. add_library(lib_ettercap SHARED ${EC_SRC})
  142. add_dependencies(lib_ettercap libnet)
  143. +target_link_libraries(lib_ettercap ${EC_LIBETTERCAP_LIBS})
  144.  
  145. -if (NOT LIBRARY_BUILD)
  146. - add_executable(ettercap ec_main.c)
  147. -endif(NOT LIBRARY_BUILD)
  148.  
  149. # Only compile lua stuff if lua is enabled!
  150. IF(ENABLE_LUA)
  151. @@ -194,11 +189,11 @@ IF(ENABLE_LUA)
  152. endif()
  153. endif(ENABLE_LUA)
  154.  
  155. -if(NOT LIBRARY_BUILD)
  156. - target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS})
  157. -else(NOT LIBRARY_BUILD)
  158. - target_link_libraries(lib_ettercap ${EC_LIBS})
  159. -endif(NOT LIBRARY_BUILD)
  160. +#if(NOT LIBRARY_BUILD)
  161. + #target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS})
  162. +#else(NOT LIBRARY_BUILD)
  163. + #target_link_libraries(lib_ettercap ${EC_LIBS})
  164. +#endif(NOT LIBRARY_BUILD)
  165.  
  166. set_target_properties(lib_ettercap PROPERTIES
  167. ENABLE_EXPORTS On
  168. @@ -208,7 +203,8 @@ set_target_properties(lib_ettercap PROPE
  169. )
  170.  
  171. if (NOT LIBRARY_BUILD)
  172. - target_link_libraries(ettercap lib_ettercap)
  173. + add_executable(ettercap ec_interfaces.c ec_main.c)
  174. + target_link_libraries(ettercap ec_interfaces lib_ettercap)
  175. set_target_properties(ettercap PROPERTIES
  176. INSTALL_RPATH ${INSTALL_LIBDIR}
  177. )
  178. --- ettercap-0.8.0.orig/src/ec_encryption.c
  179. +++ ettercap-0.8.0/src/ec_encryption.c
  180. @@ -205,14 +205,14 @@ int set_wep_key(char *string)
  181.  
  182. /* sanity check */
  183. if (bit <= 0)
  184. - SEMIFATAL_ERROR("Unsupported WEP key lenght");
  185. + SEMIFATAL_ERROR("Unsupported WEP key length");
  186.  
  187. /* the len of the secret part of the RC4 seed */
  188. tmp_wkey_len = bit / 8 - WEP_IV_LEN;
  189.  
  190. /* sanity check */
  191. if (bit != 64 && bit != 128)
  192. - SEMIFATAL_ERROR("Unsupported WEP key lenght");
  193. + SEMIFATAL_ERROR("Unsupported WEP key length");
  194.  
  195. /* get the type of the key */
  196. p = ec_strtok(NULL, ":", &tok);
  197. @@ -227,7 +227,7 @@ int set_wep_key(char *string)
  198. SEMIFATAL_ERROR("Invalid parsing of the WEP key");
  199.  
  200. if (type == 's') {
  201. - /* escape the string and check its lenght */
  202. + /* escape the string and check its length */
  203. if (strescape((char *)tmp_wkey, p) != (int)tmp_wkey_len)
  204. SEMIFATAL_ERROR("Specified WEP key length does not match the given string");
  205. } else if (type == 'p') {
  206. --- ettercap-0.8.0.orig/src/lua/share/core/ettercap_ffi.lua
  207. +++ ettercap-0.8.0/src/lua/share/core/ettercap_ffi.lua
  208. @@ -135,17 +135,17 @@ struct packet_object {
  209. */
  210. size_t disp_len;
  211. u_char * disp_data;
  212. - /* for modified packet this is the delta for the lenght */
  213. + /* for modified packet this is the delta for the length */
  214. int delta;
  215. size_t inject_len; /* len of the injection */
  216. u_char *inject; /* the fuffer used for injection */
  217.  
  218. } DATA;
  219.  
  220. - size_t fwd_len; /* lenght of the packet to be forwarded */
  221. + size_t fwd_len; /* length of the packet to be forwarded */
  222. u_char * fwd_packet; /* the pointer to the buffer to be forwarded */
  223.  
  224. - size_t len; /* total lenght of the packet */
  225. + size_t len; /* total length of the packet */
  226. u_char * packet; /* the buffer containing the real packet */
  227.  
  228. /* Trace current session for injector chain */
  229. --- ettercap-0.8.0.orig/src/interfaces/CMakeLists.txt
  230. +++ ettercap-0.8.0/src/interfaces/CMakeLists.txt
  231. @@ -71,6 +71,13 @@ if(ENABLE_GTK)
  232. endif(ENABLE_GTK)
  233.  
  234.  
  235. -add_library(ec_interfaces STATIC ${EC_TEXT_SRC} ${EC_DAEMON_SRC} ${EC_WDG_SRC} ${EC_CURSES_SRC} ${EC_GTK_SRC})
  236. +add_library(ec_interfaces STATIC ../ec_interfaces.c ${EC_TEXT_SRC} ${EC_DAEMON_SRC} ${EC_WDG_SRC} ${EC_CURSES_SRC} ${EC_GTK_SRC})
  237. SET_TARGET_PROPERTIES(ec_interfaces PROPERTIES COMPILE_FLAGS -fPIC)
  238. target_link_libraries(ec_interfaces ${EC_LIBS})
  239. +set_target_properties(ec_interfaces PROPERTIES
  240. + ENABLE_EXPORTS On
  241. + LINK_INTERFACE_LIBRARIES ""
  242. + # INSTALL_RPATH ${INSTALL_LIBDIR}
  243. + OUTPUT_NAME ec_interfaces
  244. + )
  245. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement