Wireshark Toturial
Outline
- Wireshark Tutorial
Scapy
Tutorial
Driver
Useful Linux commands
sudo ifconfig
checks the status of network interface.
sudo ifconfig <wlan0> down
puts interface wlan0
down (shut down).
sudo ifconfig <wlan0> up
puts interface wlan0
up (launch).
sudo iwconfig
checks the wireless interfaces.
sudo iwconfig <wlan0> mode monitor
changes mode of wlan0
to monitor mode.
sudo iwconfig <wlan0> mode managed
changes the mode of wlan0
back to normal mode.
sudo iwconfig <wlan0> chan <number>
changes the channel of wlan0
monitoring on to number
. Check channel number and frequency table.
Wireshark Tutorial
- Do a non-monitor mode first.
- Visiting a non-https website: show TCP packets and useful filters
- Do monitor mode
- Capturing the traffic from my AP to a student.
- Show filters:
wlan.fc.type_subtype
,wlan.fc.ra
,wlan.fc.sa
Scapy
-
Use the pcap file captured in the previous demo
summary()
haslayer()
getlayer()
-
sniff
demo
sniff(count, store, offline, prn, lfilter, L2socket, \
timeout, opened_socket, stop_filter, iface, *args, **kwargs)
Note the arguments:
count: Number of packets to capture
store: Whether to store the frames or discard them.
offline: Read packets from a file
prn: Function to apply on each packet
lfilter: Function to further work on the captured packet.
L2socket: Layer 2 socket provided.
timeout: Number of seconds after which to stop
stop_filter: Function to determine when to stop.
iface: Interface to use. In our case wlan1mon ```py sniff(offline="/tmp/capture_chan11.pcap", prn=parse) ```