무선 어댑터를 모니터 모드로 전환하기
이 단계에서는 네트워크 트래픽 캡처를 위해 무선 어댑터를 준비합니다. 기본적으로 무선 어댑터는 "관리 모드 (managed mode)"로 작동하며, 이는 자신에게 의도된 트래픽에만 주의를 기울인다는 것을 의미합니다. 공기 중에 있는 모든 Wi-Fi 트래픽을 캡처하려면 "모니터 모드 (monitor mode)"로 전환해야 합니다. 이를 위해 airmon-ng 도구를 사용할 것입니다.
먼저 무선 인터페이스의 이름을 확인해 보겠습니다. 터미널을 열고 iwconfig 명령을 실행합니다.
iwconfig
일반적으로 wlan0으로 명명된 인터페이스가 나열된 것을 볼 수 있습니다.
lo no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
이제 airmon-ng를 사용하여 wlan0 인터페이스에서 모니터 모드를 시작합니다. 이 명령은 캡처를 방해할 수 있는 일부 네트워크 프로세스를 종료할 수 있습니다.
sudo airmon-ng start wlan0
출력은 모니터 모드가 활성화되었음을 확인합니다. 일반적으로 모니터링을 위해 wlan0mon이라는 새 가상 인터페이스를 생성합니다.
Found 2 processes that could cause trouble.
Kill them using 'airmon-ng check kill' before bringing up the interface in monitor mode.
PID Name
591 wpa_supplicant
668 dhclient
PHY Interface Driver Chipset
phy0 wlan0 ath9k Atheros Communications Inc. AR9271 802.11n
(mac80211 monitor mode vif enabled for [phy0]wlan0 on [phy0]wlan0mon)
(mac80211 station mode vif disabled for [phy0]wlan0)
iwconfig를 다시 실행하여 새 인터페이스 wlan0mon이 모니터 모드에 있는지 확인할 수 있습니다.
iwconfig wlan0mon
출력에는 Mode:Monitor가 표시되어야 합니다.
wlan0mon IEEE 802.11 Mode:Monitor Frequency:2.457 GHz Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off