The gMan nixWiki

Because the mind is made of Teflon...

User Tools

Site Tools


hack_wireless_setup

Wireless: Set-Up

Adapters: Built-in wireless adapters in retail computers will not perform for what you need. You need a wireless adapter that will support: Monitor Mode & Packet Injection (Explanation).

Change MAC

Network CLI: https://www.tecmint.com/ip-command-examples/

You may need to spoof your address to cover your tracks or to take over a MAC address of someone on the network. First, find your interface name (e.g., wlan0); use one of the following:

ifconfig
ip addr show
ip link show

1. Disable the interface first (two ways, old and new; use one):

ifconfig wlan0 down
ip link set wlan0 down

2A. [Option 1] Change the MAC address (hw ether: hardware ethernet address; (use any addr you want that starts with 00)):

ifconfig wlan0 hw ether 00:11:22:33:44:55
ip link set dev wlan0 address 00:11:22:33:44:55

2B. [Option 2] Use macchanger to do it for you:

macchanger --random wlan0

3. Enable the interface (two ways, old and new; pick one):

ifconfig wlan0 up
ip link set wlan0 up

4. Check it (pick one):

ifconfig
ip addr show
ip link show

5. PAY ATTENTION: your network manager might revert the MAC to original

  • If you used macchanger, you probably won't get this problem (although I haven't fully tested it).
  • Edit: /etc/NetworkManager/NetworkManager.conf and paste the following at the end of the file:
[device]
wifi.scan-rand-mac-address=no

[connection]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve
  • Then restart the NetworkManager:
service network-manager restart

Change Adapter Mode

Do an iwconfig to check out wlan0 (or whatever your interface name is): should be Mode: Managed (you need to change to Monitored in order to catch all network traffic).

  • Important: It is important that you use ifconfig (or ip) here and not ifup. (See explanation.)
  • In a nutshell:
    • An ifconfig up eth0 activates eth0 but does not setup IP addresses, etc.
    • An ifup eth0 sets up IP addresses and other options based on the interface's configuration in /etc/network/interfaces.

1. Disable the interface.

    ifconfig wlan0 down
    ip link set wlan0 down

2. Kill any process that would interfere with monitor mode (This will kill your network connection. Don't worry. You don't need it.):

airmon-ng check kill

3. Enable monitor mode [1].

iwconfig wlan0 mode monitor

4. Enable the interface.

    ifconfig wlan0 up
    ip link set wlan0 up

Run iwconfig and you should see Mode:Monitor (capture any packet in range).

[1] The mode sets the operating mode of the device:

  • ad hoc (network composed of only one cell and without access point)
  • managed (node connects to a network composed of many access points, with roaming)
  • master (the node is the synchronisation master or acts as an access point)
  • repeater (the node forwards packets between other wireless nodes)
  • secondary (the node acts as a backup master/repeater)
  • monitor (the node is not associated with any cell and passively monitor all packets on the frequency)
  • auto

Adapter Setup (VM)

Attaching USB Device to VM in VirtualBox

  • Start the following process WITHOUT the wireless adapter attached. Do NOT connect it yet.
  • Even after you have your adapter installed, recognized and functioning, ALWAYS start Kali with the adapter UNCONNECTED.
  • For some reason, Kali VM does not play nicely when booted with the adapter attached. Boot. Attach. Play.

VirtualBox (Host) Setup:

  1. In Linux you need to add the current user to the virtualbox group:
    • As root: adduser [username: echo $USER] vboxuser
    • Then you need to logout (of X, of current session) and log back in.
  2. Open VirtualBox and click on the machine you want to select it.
  3. Go to Settings… USB… Make sure USB is enabled (checkbox is checked).
  4. Pick the USB version used by your adapter (1.1, 2.0, or 3.0; mine was 3.0).
  5. Click on the icon to the right of the Filter box with the plus sign (+).
    • If you have devices already connected to that version of USB, they will show up in the menu.
  6. Now connect the adapter and do #4 again (plus sign).
    • You should see a new entry in the pop-up menu.
    • It will be listed according to the chipset, not the brand name of the adapter.
    • This will be the same chipset you see with lsusb in the host Linux O/S.
  7. Click on the adapater (chipset) entry to select it.
  8. Click on OK to accept the addition and close the USB menu window.
  9. Before starting the VM, physically disconnect the wireless adapter.
  10. Start the VM and let it fully load THEN connect your USB wireless adapter (you should see the adapters visual feedback light up).
    • Check to make sure the adapter connection is recognized.
    • Go to the VM menu (all the way on the top): Devices… USB…
    • You should see your adapter/chipset entry selected with a check mark.

Virtual Machine (Guest) Setup:

  1. In a term window in your Linux VM, do lsusb. You should see your chipset.
  2. Check to see if the adapter was recognized by the O/S. Use one or more of the following:
    • ifconfig or iwconfig or ip a
  3. If you do not see a wireless adapter (wlan0, etc.), then you need to install the drivers.
  4. Search for the chipset name (e.g., RTL8812AU or realtek, etc.)
    • apt-cache search RTL8812AU or apt-cache search realtek, etc.
  5. Install your chipset's driver package.
    • My example: apt install realtek-rtl88xxau-dkms
  6. After a successful installation of the package, power down the VM.
  7. Remove the USB adapter (if connected), power up the VM, update and upgrade to make sure it works.
    • apt update and then apt full-upgrade
  8. For some reason, some folks needed to do a key addition to get the upgrade to work (mine worked fine without it). Also, :
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 7D8D0BF6
systemctl restart network-manager
  1. Connect your USB wireless adapter. Check in Devices… USB… to make sure it's there. Check lsusb in terminal.
  2. Check to see if the adapter was recognized by the O/S (mine worked, got a wlan0):
    • ifconfig or iwconfig or ip a

hack_wireless_setup.txt · Last modified: 2020/05/31 17:44 by gman