Table of Contents

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

[device]
wifi.scan-rand-mac-address=no

[connection]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve
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).

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:


Adapter Setup (VM)

Attaching USB Device to VM in VirtualBox

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