summaryrefslogtreecommitdiffstats
path: root/spoof.sh
blob: 4645f527c9a02b1b9785fcede02805ac637826d7 (plain) (blame)
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
if [[ $UID != 0 ]]; then
	echo "You must be root."
	exit -1
fi
if [[ $# -ne 4 ]]; then
	echo "Usage: $0 ip netmask gateway mac."
	exit -1
fi

/etc/init.d/dhcpcd stop
/etc/init.d/wpa_supplicant stop

ifconfig wlan0 down
macchanger -m $4 wlan0
ifconfig wlan0 $1 netmask $2

ip route del default
ip route add default via $3

echo nameserver 8.8.8.8 > /etc/resolv.conf
echo nameserver 8.8.4.4 >> /etc/resolv.conf

ifconfig wlan0 up

/etc/init.d/wpa_supplicant start