-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwlan-cap
More file actions
executable file
·36 lines (34 loc) · 1.01 KB
/
wlan-cap
File metadata and controls
executable file
·36 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Script to easily set your wireless card in monitor mode and show the IEEE 802.11 frames that are flowing around you.
# Always exit on errors
set -e
# Undefined variables, we don't like you
# set -u
# ERR traps are inherited by shell functions, command substitutions and
# commands executed in a subshell environment.
set -E
if [[ "$1" == "start" ]]; then
service network-manager stop
# Unblock all wireless cards {{{
for count in `seq 2`; do
rfkill list |grep Wireless|while read rfkill_line;do
rfkill unblock ${rfkill_line:0:1}
done
done
rfkill list
# }}}
if [[ -z "`airmon-ng |grep mon0`" ]]; then
airmon-ng start wlan0
fi
airodump-ng --manufacturer --uptime mon0
if [[ $? != 0 ]]; then
airodump-ng --uptime mon0
fi
elif [[ "$1" == "stop" ]]; then
killall 'airodump-ng' || true
airmon-ng stop mon0
airmon-ng stop wlan0
service network-manager start
else
echo 'Please call script with "start" or "stop".'
fi