-
-
[原创] Compile Ettercap for MacOS / iOS
-
发表于: 2017-7-20 21:48 3643
-
編譯工具 cmake
依賴: openssl libnet
####################################
### 原始碼下載與補丁
####################################
# Dowbnalod
wget https://github.com/Ettercap/ettercap/archive/v0.8.2.tar.gz wget https://github.com/Ettercap/ettercap/commit/4ad7f85dc01202e363659aa473c99470b3f4e1f4.patch?full_index=1 tar zxvf v0.8.2.tar.gz
# Patch
mv ettercap-0.8.2 a patch -p0 -i 4ad7f85dc01202e363659aa473c99470b3f4e1f4.patch?full_index=1 mv a ettercap-0.8.2
####################################
## MacOS x86_64
####################################
cd ettercap-0.8.2
mkdir build cd build
cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG \ -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_FIND_FRAMEWORK=LAST \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -Wno-dev \ -DBUNDLED_LIBS=OFF \ -DINSTALL_SYSCONFDIR=/usr/local/etc \ -DENABLE_CURSES=ON \ -DENABLE_PLUGINS=ON \ -DENABLE_IPV6=ON \ -DENABLE_PDF_DOCS=OFF \ -DENABLE_GTK=OFF \ -DINSTALL_DESKTOP=OFF \ -DENABLE_LUA=OFF
make make install DESTDIR=ettercap-0.8.2
####################################
### iOS armv7
####################################
將依賴下載複製到SDK
wget https://github.com/kalifans/Darwin/raw/deb/ettercap-sdk-libs.tar.xz tar Jxvf ettercap-sdk-libs.tar.xz IOSSDKROOT=$(xcrun --sdk iphoneos6.1 --show-sdk-path) cp -r ettercap-sdk-libs/usr $IOSSDKROOT/
cd ettercap-0.8.2
DEVROOT=$(xcrun --sdk iphoneos --show-sdk-platform-path) IOSSDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) export SDKROOT=$IOSSDKROOT export CC="$(xcrun -f cc) -arch armv7" export LD=$DEVROOT/usr/bin/ld export AR=$DEVROOT/usr/bin/ar export AS=$DEVROOT/usr/bin/as export NM=$DEVROOT/usr/bin/nm export RANLIB=$DEVROOT/usr/bin/ranlib export CFLAGS="-I$SDKROOT/usr/include/ -arch armv7" export LDFLAGS="-L$SDKROOT/usr/lib/ -arch armv7" export CPPFLAGS=$CFLAGS export CXXFLAGS=$CFLAGS
cat << EOF > CMAKE_IPHONEOS_TOOLCHAIN.cmake INCLUDE(CMakeForceCompiler) SET (CMAKE_CROSSCOMPILING TRUE) SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "arm") SET (CURL_LIBRARY "${SDKROOT}/usr/lib/libcurl.dylib") SET (CURSES_CURSES_LIBRARY "${SDKROOT}/usr/lib/libcurses.dylib") SET (CURSES_FORM_LIBRARY "${SDKROOT}/usr/lib/libform.dylib") SET (CURSES_NCURSES_LIBRARY "${SDKROOT}/usr/lib/libncurses.dylib") SET (FOUND_MENU "${SDKROOT}/usr/lib/libmenu.dylib") SET (FOUND_PANEL "${SDKROOT}/usr/lib/libpanel.dylib") SET (HAVE_ICONV "${SDKROOT}/usr/lib/libiconv.dylib") SET (HAVE_PCAP "${SDKROOT}/usr/lib/libpcap.dylib") SET (HAVE_RESOLV "${SDKROOT}/usr/lib/libresolv.dylib") SET (LIBNET_LIBRARY "${SDKROOT}/usr/lib/libnet.dylib") SET (PCRE_LIBRARY "${SDKROOT}/usr/lib/libpcre.dylib") SET (ZLIB_LIBRARY_RELEASE "${SDKROOT}/usr/lib/libz.dylib") SET (OPENSSL_CRYPTO_LIBRARY "${SDKROOT}/usr/local/openssl/1.0.2/lib/libcrypto.dylib") SET (OPENSSL_SSL_LIBRARY "${SDKROOT}/usr/local/openssl/1.0.2/lib/libssl.dylib") SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "${DEVROOT}") SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) EOF
mkdir -p build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../CMAKE_IPHONEOS_TOOLCHAIN.cmake \ -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG \ -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_FIND_FRAMEWORK=LAST \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -Wno-dev \ -DBUNDLED_LIBS=OFF \ -DINSTALL_SYSCONFDIR=/usr/local/etc \ -DENABLE_CURSES=ON \ -DENABLE_PLUGINS=ON \ -DENABLE_IPV6=ON \ -DENABLE_PDF_DOCS=OFF \ -DENABLE_GTK=OFF \ -DINSTALL_DESKTOP=OFF \ -DENABLE_LUA=OFF
make make install DESTDIR=ettercap-0.8.2
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
他的文章
看原图
赞赏
雪币:
留言: