Miscellaneous - jhu-information-security-institute/NwSec GitHub Wiki

BrosTrend AC1L USB3.0 adapter setup for Linux

  • Install the Realtek RTL8812 drivers
    • $ sudo sh -c 'wget deb.trendtechcn.com/installer.sh -O /tmp/installer.sh && sh /tmp/installer.sh'
  • Alternately, if you have already built the drivers, just install it directly with $ sudo dpkg -i rtl88x2bu-dkms.deb

General wifi setup

  • Adapter should be visible as wlan0 when running $ sudo iwconfig
  • Switch wlan0 to monitor (or back to managed) mode using $ sudo iwconfig wlan0 mode monitor (or $ sudo iwconfig wlan0 mode managed)
  • Enable wlan0 (or disable) using $ sudo ifconfig wlan0 up (or $ sudo ifconfig wlan0 down)
  • Scan wifi networks using $ sudo iwlist wlan0 scan
  • Connect to a network using:
    • $ sudo iwconfig wlan0 essid NETWORK_NAME key s:WIRELESS_KEY
    • Request an ip address using $ sudo dhclient wlan0

Simple USB-ethernet adapter setup for local network and bridging

  1. $ apt-get install bridge-utils
  2. edit /etc/network/interfaces
    • This example has eth0 setup with NAT on the host (host network connection (ethernet or wifi) is connected to a network with DHCP server), and two USB to ethernet adapters connected to the VM
    • This code bridges eth0 to eth2 (so any connections on eth2 will be configured by DHCP and statically sets up eth1 to connect to 192.168.1.0/24 network addresses (e.g., for attaching to apu4 router directly)
    
     # This file describes the network interfaces available on your system
     # and how to activate them. For more information, see interfaces(5).
    
     source /etc/network/interfaces.d/*
    
     auto lo br0
    
     # The loopback network interface
     auto lo br0
     iface lo inet loopback
    
     # Bridging eth0 with eth2
     iface eth0 inet manual
    
     # Using eth1 for static connection to 192.168.1.0/24
     allow-hotplug eth1
     iface eth1 inet static
     hwaddress ether BA:BE:BA:BE:BA:BE
     address 192.168.1.2
     netmask 255.255.255.0
    
     # Bridging eth2 with eth0
     allow-hotplug eth2
     iface eth2 inet manual
     hwaddress ether DE:CA:FB:AD:BE:EF
     
     # Declare the bridge
     iface br0 inet dhcp
     bridge_ports eth0 eth2	
    
     
  3. show current routes # ip route show
  4. add the route for eth1 to the local LAN # ip route add 192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.2 metric 100
  5. restart the networking service # systemctl restart networking
⚠️ **GitHub.com Fallback** ⚠️