如何在 M1 Macbook 中安装 aircrack-ng?

如何在 M1 Macbook 中安装 aircrack-ng?

最近我开始学习道德黑客课程。由于 Parallels 存在一些问题,我决定在 MacOS 上安装课程中建议的必要工具,而不是使用 Kali Linux。但是,我无法通过 brew 或给定的方法安装 aircrack-ng这里

尝试时brew install aircrack-ng我收到以下错误消息:

Error: aircrack-ng: no bottle available!
You can try to install from source with:
  brew install --build-from-source aircrack-ng
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

brew install --build-from-source aircrack-ng尝试上述消息中提到的命令后,得到:

Last 15 lines from /Users/dexter/Library/Logs/Homebrew/aircrack-ng/02.make:
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./include/aircrack-ng/osdep -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6 -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6/include -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6/include -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6/lib -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6/lib -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6/lib/radiotap -I/private/tmp/aircrack-ng-20210825-45669-371zkp/aircrack-ng-1.6/lib/radiotap -Wno-unused-command-line-argument -D_FORTIFY_SOURCE=2 -Wall -Wno-unused-command-line-argument -O3 -std=gnu99 -fno-strict-aliasing -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-array-bounds -c lib/osdep/darwin.c  -fno-common -DPIC -o lib/osdep/.libs/libaircrack_osdep_la-darwin.o
fatal error: too many errors emitted, stopping now [-ferror-limit=]

aircrack-ng.org 中提到的替代方法也会出现同样的错误。

有没有什么解决方法可以让它工作?

更新

我曾尝试使用罗塞塔 2 号运行基于 Intel 的 CommandLine 应用程序,如本文所述文章

同样,brew install aircrack-ng 在“make install”步骤中失败。使用 --verbose 标志时,会打印以下错误:

In file included from src/aircrack-ng/linecount.cpp:58:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/algorithm:643:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:674:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/iterator:423:
./version:1:1: error: expected unqualified-id
1.6.0
^
In file included from src/aircrack-ng/linecount.cpp:58:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/algorithm:643:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/memory:674:
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/iterator:562:13: error: unknown type name 'ptrdiff_t'
    typedef ptrdiff_t difference_type;
            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/iterator:623:56: error: unknown type name 'ptrdiff_t'
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/iterator:989:66: error: unknown type name 'ptrdiff_t'
          class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
                                                                 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/iterator:989:54: error: template parameter missing a default argument
          class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
                                                     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/iterator:989:27: note: previous default template argument defined here
          class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
                          ^
apple-m1

答案1

Aircrack-ng 最新版本为 1.6,发布日期为 2020 年 1 月,但主分支已于 7 个月前提交了针对 MAC M1 的修复。使用主分支可以在 mac m1 中构建 aircrack-ng。

git clone https://github.com/aircrack-ng/aircrack-ng.git

cd aircrack-ng

autoreconf -vif

env CPPFLAGS="-Wno-deprecated-declarations" ./configure --with-experimental

make

make check

sudo make install

对我有用。

https://github.com/aircrack-ng/aircrack-ng

答案2

文档中写道 aircrack-ns 支持 osX,您是否安装了先决条件?在第一个代码片段中,您尝试通过 brew 安装 aircrack-ng,不要这样做,因为它可能在 brew 本身上不可用,但可以从源代码进行编译和安装。

根据文档安装这些:

  • 自动配置
  • 自动制作
  • 库工具
  • openssl
  • 工具
  • pkg 配置

  • 通过 brew。然后使用这些命令:
    wget https://download.aircrack-ng.org/aircrack-ng-1.6.tar.gz
    tar -zxvf aircrack-ng-1.6.tar.gz
    cd aircrack-ng-1.6
    autoreconf -i
    ./configure --with-experimental
    make
    make install
    ldconfig
    

    相关内容