RealPath:
WebPath:
2016/11/19 17:51 (JST) 更新
BackTrack >>

無線LANその1

Contents

OPEN/WEP WLAN (DHCP) への繋ぎ方

http://wirelessdefence.org/Contents/LinuxWirelessCommands.htm

# iwconfig wlan0 mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)
# iwconfig wlan0 essid "[ESSID]" (Specify ESSID for the WLAN)
# dhclient wlan0 (to receive an IP address, netmask, DNS server and default gateway from the Access Point)
# ping www.bbc.co.uk  (if you receive a reply you have access)

OPEN/WEP (手動IP設定) への繋ぎ方

http://wirelessdefence.org/Contents/LinuxWirelessCommands.htm

# iwconfig wlan0 mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)
# iwconfig wlan0 essid "[ESSID]"
# ifconfig wlan0 [IP address] netmask [subnetmask]
# route add default gw [IP of default gateway] (Configure your default gateway; usually the IP of the Access Point)
# echo nameserver [IP address of DNS server]  >>  /etc/resolve.conf (Configure your DNS server)
# ping www.bbc.co.uk (if you receive a reply you have access)

モード変更

# iwconfig [interface] mode master (set the card to act as an access point mode)
# iwconfig [interface] mode managed (set card to client mode on a network with an access point)
# iwconfig [interface] mode ad-hoc (set card to peer to peer networking or no access point mode)
# iwconfig [interface] mode monitor (set card to RFMON mode our favourite)

ESSID変更

# iwconfig [interface] essid any (with some cards you may  disable the  ESSID  checking)
# iwconfig [interface] essid “your ssid_here” (configure ESSID for network)

WEPキー変更

# iwconfig [interface] key 1111-1111-1111-1111 (set 128 bit WEP key)
# iwconfig [interface] key 11111111 (set 64 bit WEP key)
# iwconfig [interface] key s:mykey (set key as an ASCII string)
# iwconfig [interface] key off (disable WEP key)
# iwconfig [interface] key open (sets open mode, no authentication is used and card may accept non-encrypted sessions)

チャンネル変更

# iwconfig [interface] channel [channel no.] (set a channel 1-14)
# iwconfig [interface] channel auto (automatic channel selection)

その他

# iwconfig [interface] freq 2.422G (channels can also be specified in GHz)
# iwconfig [interface] ap 11:11:11:11:11:11 (Force card to register AP address)
# iwconfig [interface] rate 11M (card will use the rate specified)
# iwconfig [interface] rate auto (select automatic rate)
# iwconfig [interface] rate auto 5.5M (card will use the rate specified and any rate below as required)

ifconfig

http://wirelessdefence.org/Contents/LinuxWirelessCommands.htm

起動と停止

# ifconfig [interface] up (bring up specified interface)
# ifconfig [interface] down (take down specified interface)

IPアドレス設定

# ifconfig [interface] [IP address] netmask [subnet-mask] (manually set IP and subnet-mask details)

MACアドレス変更

# ifdown wlan0
# ifconfig wlan0 hw ether [MAC] (Change the wireless cards MAC address, specify in format 11:11:11:11:11:11)
# ifup wlan0

iwpriv

# iwpriv [interface] hostapd 1 (used to set card mode to hostapd e.g. for void11)
# iwpriv [interface] monitor [A] [B]
[A]
    0 = disable monitor mode
    1 = enable monitor mode with Prism2 header
    2 = enable monitor mode with no Prism2
[B]
    Channel to monitor (1-14)

iwlist

# iwlist [interface] scan (Give the list of Access Points and Ad-Hoc cells in range (ESSID, Quality, Frequency, Mode etc.) Note: In tests only worked with Atheros cards).
# iwlist [interface] channel (Give the list of available frequencies in the device and the number of channels).
# iwlist [interface] rate (List the bit-rates supported by the device).
# iwlist [interface] key (List the encryption key sizes supported and display all the encryption keys available in the device).
# iwlist [interface] power (List the various Power Management attributes and modes of the device).
# iwlist [interface] txpower (List the various Transmit Power available on the device).
# iwlist [interface] retry (List the transmit retry limits and retry lifetime on the device).
# iwlist [interface] ap (Give the list of Access Points in range, and optionally the quality of link to them.  Deprecated in favour of scan)
# iwlist [interface] peers (Give the list of Peers associated/registered with this card).
# iwlist [interface] event (List the wireless events supported by this card).

「iwlist [interface] scan」をするとネットワークが復帰する???

wlanconfig

# wlanconfig athx destroy (Destroy VAP, athx)
# wlanconfig athx create wlandev wifi0 wlanmode sta (Create a managed mode VAP, athx)
# wlanconfig athx create wlandev wifi0 wlanmode ap (Create an Access Point VAP, athx)
# wlanconfig athx create wlandev wifi0 wlanmode adhoc (Create an Ad-Hoc VAP, athx)
# wlanconfig athx create wlandev wifi0 wlanmode monitor (Create a Monitor mode VAP, athx)

Changing modes

# ifconfig athx down (Take the VAP down)
# wlanconfig athx destroy (Destroy the VAP, athx)
# wlanconfig athx create wlandev wifi0 wlanmode [sta|adhoc|ap|monitor] (Create a new sta, adhoc, ap or monitor VAP)

Scan for Access Points (requires both steps):

# modprobe wlan_scan_sta (To insert the scanning module)
# wlanconfig athx list scan (To list the APs)