【サイバーセキュリティ】wifite2 2.5.8を使用し、Wi-fiをハッキングする実験

スポンサーリンク

サイバーセキュリティ(サイバー攻撃対策)を考える上で、Kali Linuxの「wifite2 2.5.8」を使用し、Wi-fiをハッキングする実験を行ってみます。

■PC環境

Windows 10 Pro

VirtualBox6.1

Kali Linux 2021.1(Debian (64-bit))

■wifite2を起動する

クリックすると、Kali Linuxが起動します。起動後、ログイン画面が表示されますのでユーザIDとパスワードを入力し「Log in」ボタンをクリックします。

クリックすると、Kali Linuxにログインすることができました。

ログイン後、上部メニューにあるKali Linuxのマークをクリックします。クリックするとプルダウンメニューが表示されますので、「06-Wireless Attacks」をクリックします。クリック後、「wifite」をクリックします。クリックすると「wifite」が起動します。

もしくは、上部メニューになる「ターミナルエミュレーター」をクリックし、ターミナルを起動し、「wifite」と入力すると、「wifite」が起動します。

今回は「ターミナルエミュレーター」を起動します。

$su

起動後、上部のコマンドを入力し、Enterキーを押します。スーパーユーザー(rootユーザー)の権限に切り替えます。

#wifite

Enterキーを押した後に、上部のコマンドを入力します。

wifite2 2.5.8 : a wireless auditor by derv82
maintained by kimocoder

https://github.com/kimocoder/wifite2

[!] Warning: Recommended app pyrit was not found. install a https://github.c om/JPaulMora/Pyrit/wiki
[!] Warning: Recommended app hcxdumptool was not found. install a apt instal, 1 hcxdumptool
[!] Warning: Recommended app hcxpcapngtool was not found. install a apt inst all hcxtools [!] Conflicting processes: NetworkManager (PID 434), [!] If you have problems: kill -9 PID or re-run wifite with --kill
ホーム
[+] Checking airmon-ng... [!] airmon-ng did not find any wireless interfaces [!] Make sure your wireless device is connected [!] See http://www.aircrack-ng.org/doku.php?id=airmon-ng for more info
[!] Error: airmon-ng did not find any wireless interfaces
[!] Full stack trace below
[!] [!]
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/wifite/_main__.py", line 97, in

上記のメッセージが表示されます。「Warning(警告)」や「Error(エラー)」が表示されますので、警告で表示されている問題を解決していきます。

まずはpyritをインストールします。

#curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py

pyritをインストールするために、Python2のpipを手動でインストールする必要がありますので、上記のコマンドを入力し、Enterキーを押します。

#python2 ./get-pip.py

Enterキーを押すと、pipのインストールが開始され、完了します。完了後、上記のコマンドを入力し、Enterキーを押します。

apt install libpython2-dev

Enterキーを押した後に、libpython2-devのパッケージをインストールしますので、上記のコマンドを入力し、Enterキーを押します。

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Ple ase upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 supp ort in pip can be found at https://pip.pypa.io/en/latest/development/releaseprocess/#python-2-support pip 21.0 will remove support for this functionality,(Python 2.7 は 2020 年 1 月 1 日にその寿命を迎えました。pip 21.0 は 2021 年 1 月に Python 2.7 のサポートを終了します。Python 2 supp ort in pip についての詳細は https://pip.pypa.io/en/latest/development/releaseprocess/#python-2-support pip 21.0 はこの機能のサポートを終了します。)

Enterキーを押すと、上記のメッセージの後にインストールが開始されます。今回は実験ですので、上記のメッセージは一旦無視します。

#python2 -m pip install cython scapy psycopg2-binary

しばらくするとインストールが完了します。その後、Python2の関連パッケージをインストールしますので、上記のコマンドを入力し、Enterキーを押します。

ERROR: Command errored out with exit status 1:
command: /usr/bin/python2-C'import sys, setuptools, tokenize; sys.argv TO = ""'/tmp/pip-install-F2 FMpZ/scapy/setup.py"."; file= /tmp/pi p-install-F2 FMpZ/ scapy/setup.py ; f=getattr(tokenize,
T open'!", open
open DC file icode=f.read .replace( " \r\n'" "" "" '"" :f.close(:exe c(compile(code, _file_. '"'"'exec'''"))' egg_info --egg-base /tmp/pip-pipegg-info-tkpwqc
cwd: /tmp/pip-install-F2 FMPZ/scapy/ Complete output (14 lines):
/usr/lib/python2.7/distutils/dist.py:267: Userwarning: Unknown distributi on option: 'entry_points'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distributi on option: 'extras_require'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: Userwarning: Unknown distributi on option: 'python_requires'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distributi on option: 'zip_safe'
warnings.warn(msg) usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help
error: invalid command 'egg_info'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Enterキーを押すと、上記のエラーメッセージが表示されますので、この問題を解決します。

#pip install --upgrade pip setuptools

解決するために、上記のコマンドを入力し、Enterキーを押します。古いsetuptoolsがアップグレードされます。

#python2 -m pip install cython scapy psycopg2-binary

アップグレード後、再度上記のコマンドを入力し、Enterキーを押します。Enterキーを押すと、インストールが開始され完了します。

#git clone https://github.com/JPaulMora/Pyrit.git
#cd Pyrit
#python2 setup.py build

完了後、上記のコマンドを入力し、Enterキーを押します。

#sudo python2 setup.py install

Enterキーを押した後に、上記のコマンドを入力し、Enterキーを押します。

Writing /usr/local/lib/python2.7/dist-packages/pyrit-0.5.1.egg-info

Enterキーを押すと、上記のメッセージなどが表示されます。これでモジュールのインストールは完了となり、「wifite」を起動した時に表示される「Warning: Recommended app pyrit was not found. install a https://github.c om/JPaulMora/Pyrit/wiki」というメッセージは消えます。

#apt install hcxdumptool

#apt install hcxtools

次に上記のコマンドを入力し、Enterキーを押します。これで「wifite」を起動した時に表示される「Warning: Recommended app hcxdumptool was not found. install a apt instal, 1 hcxdumptool」と「Warning: Recommended app hcxpcapngtool was not found. install a apt inst all hcxtools」のメッセージは消えます。

#wifite

ここで再度、上記のコマンドを入力しEnterキーを押し、wifiteを起動します。

[!] Conflicting processes: NetworkManager (PID 434) 
[!] If you have problems: kill -9 PID or re-run wifite with --kill
- OX
[+] Checking airmon-ng [!] airmon-ng did not find any wireless interfaces [!] Make sure your wireless device is connected [!] See http://www.aircrack-ng.org/doku.php?id=airmon-ng for more info
[!] Error: airmon-ng did not find any wireless interfaces
[!] Full stack trace below
Traceback (most recent call last): [!] File "/usr/lib/python3/dist-packages/wifite/_main__.py", line 97, in entry_point [!]
wifite.start() [!] File "/usr/lib/python3/dist-packages/wifite/_main__.py", line 51, in start [!]
Configuration.get_monitor_mode_interface [!] File "/usr/lib/python3/dist-packages/wifite/config.py", line 167, in get_monitor_mode_interface
cls.interface = Airmon.asko [!] File "/usr/lib/python3/dist-packages/wifite/tools/airmon.py", line 31 3, in ask [!] raise Exception('airmon-ng did not find any wireless interfaces') [!] Exception: airmon-ng did not find any wireless interfaces
[!] Exiting

起動すると「Error: airmon-ng did not find any wireless interfaces(airmon-ngで無線インターフェースが見つからない)」というエラーメッセージが表示されます。

このエラーを解決するには今回は「VirtualBox6.1」で「Kali Linux」を動かしていますので、ホストOS(Windows10)の接続し認識済のWi-fi(無線インターフェース)を発見することができませんので、ゲストOS(Kali Linux)にWi-fi(無線インターフェース)を認識させる必要があります。

ゲストOS(Kali Linux)にWi-fi(無線インターフェース)を認識させるためには、起動中のVirtualBoxのウインドウ上部になる「デバイス」をクリックします。クリックするとプルダウンメニューが表示されますので、「USB」をクリックします。クリックすると、ホストOS(Windows10)に接続され認識済のWi-fiが表示されますので、こちらをクリックします。

#wifite

クリックすると、ゲストOS(Kali Linux)上でWi-fi(無線インターフェース)が見つかりますので、再度、上記のコマンドを入力しEnterキーを押し、wifiteを起動します。なお、ゲストOS(Kali Linux)上でWi-fi(無線インターフェース)が見つかりますが、ホストOS(Windows10)上ではWi-fi(無線インターフェース)の認識が行われなくなり、インターネット接続ができない状態となります。

起動すると、「Interface」で「wlan0」が見つかります。しかし「[+] enabling monitor mode on wlano(wlanoでモニターモードを有効にする) ... failed(失敗)」と表示されます。

また「Error: Cannot find any interfaces in monitor mode(モニターモードのインターフェイスが見つかりません)」というエラーが発見されました。このエラーを解決するために方法などを調べてみる。

調べた結果、解決するには「モニターモード/インジェクションの機能が付いたWifiアダプター」を用意(購入)する必要があるということがわかりました。実験時には、「モニターモード/インジェクションの機能が付いたWifiアダプター」は用意しておらず、もしかしたらいつか購入するして実験を行う。