Sunday, July 19, 2020

Connecting Kali Linux to WiFi Network




My old and battered Dell Optiplex 745 desktop has seen better days. But I just can't part with it. Not when it is still alive.

I have installed Kali Linux on the Optiplex. It is nice to see it breathe again. I have decided to learn this Linux distribution a bit. Who knows, it may come in handy some day. 

Since this machine has no wireless adapter, I am going to plug in a USB one. Let's see what /var/log/messages says about it.


usb 1-3: new high-speed USB device number 2 using ehci-pci
usb 1-3: New USB device found, idVendor=0bda, idProduct=8176, bcdDevice= 2.00
usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-3: Manufacturer: Realtek
usb 1-3: SerialNumber: 00e04c000001
mtp-probe: bus: 1, device: 2 was not an MTP device
mtp-probe: checking bus 1, device 2: "/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3"
kernel: [  861.048033] rtl8192cu: Chip version 0x10
kernel: [  861.124660] rtl8192cu: Board Type 0
kernel: [  861.124892] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
kernel: [  861.124964] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
kernel: [  861.180081] usbcore: registered new interface driver rtl8192cu
kernel: [  861.190722] usb 1-3: firmware: direct-loading firmware rtlwifi/rtl8192cufw_TMSC.bin
mtp-probe: checking bus 1, device 2: "/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3"
mtp-probe: bus: 1, device: 2 was not an MTP device
kernel: [  861.253312] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
kernel: [  861.255516] rtl8192cu: MAC auto ON okay!
kernel: [  861.298164] rtl8192cu: Tx queue select: 0x05
kernel: [  861.815663] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
kernel: [  861.840767] rtl8192cu: MAC auto ON okay!
kernel: [  861.873790] rtl8192cu: Tx queue select: 0x05
kernel: [  862.397726] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
kernel: [  862.685255] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

The system recognizes Realtek USB WiFi adapter. 

Now would be the time to try to make it work. Let's start with looking at what network adapters Kali can see:



The WiFi adapter shows as 'wlan0' and is currently disconnected. 

Now onto the WiFi Access Points discovery (I know my AP name but I want to have some fun on this Sunday morning). The following command will discover all APs in the neighborhood.


pi@hack: $ iwlist wlan0 scan

A nice and short output to display all APs in the neighborhood is produced by 'nmcli dev wifi list'.



SSIDs have been hidden here. I don't want to disclose my and my neighbor's APs.

Now, let's hook up the wlan0 interface to my home network. As of now, the interface looks like this in ifconfig output:


pi@hack: $ /sbin/ifconfig wlan0
wlan0: flags=4099  mtu 1500
        ether d6:a5:6b:d9:b6:15  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The command that is going to connect to my WiFi access point goes like this:


pi@hack: $ sudo nmcli device wifi connect SSID-Of-My-AP password My-Password

Now, I can see that the adapter is working:


pi@hack: $ sudo ifconfig wlan0
wlan0: flags=4163  mtu 1500
        inet 192.168.0.28  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fd34:b1bb:c269:0:31b2:adf2:7740:ea48  prefixlen 64  scopeid 0x0
        inet6 fe80::7c9e:84a4:2c7b:4104  prefixlen 64  scopeid 0x20
        ether e8:4e:06:0d:d6:98  txqueuelen 1000  (Ethernet)
        RX packets 36  bytes 8072 (7.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 3110 (3.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pi@hack: $

I am off to a good start to explore how WiFi can be hacked.

Cisco Is Easy - Main

  Cisco Basics (CCNA level)  Lessons: Watch Video Tutorials on Youtube 01 - Connecting to Cisco Console Port with MINICOM 02 - Navigatin...