Skip to content

Instantly share code, notes, and snippets.

@intrd
Last active March 3, 2017 06:04
Show Gist options
  • Save intrd/0db7cca148b6a957b339c209b7a8108c to your computer and use it in GitHub Desktop.
Save intrd/0db7cca148b6a957b339c209b7a8108c to your computer and use it in GitHub Desktop.
Wpa_supplicant - Script to macchange, start a wpa connection, flush/isolate route and set dns servers
#!/bin/bash
## Script to chance mac, start a wpa connection, flush route and set dns servers
# @author intrd - http://dann.com.br/
# @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/
#kill network services
#sudo airmon-ng check kill
#macchanger
sudo ifconfig wlan0 down
sudo macchanger --mac=00:81:be:11:5a:11 wlan0
sudo ifconfig wlan0 up
#wifi
sudo wpa_supplicant -B -i wlan0 -c /home/intrd/scripts/wifi_k.conf
#routes
sudo ip route flush table main
#sudo ip route flush 192.168.1.0/24
sudo route add 192.168.1.1 gw 192.168.1.20 wlan0
sudo route add default gw 192.168.1.1 wlan0 #routelocalgw
#nameservers
sudo sh -c "echo nameserver 8.8.8.8 > /etc/resolv.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment