Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

wifi interface script

Name: Anonymous 2012-12-17 16:49

Hey /prog/,
I'm working on a script to set up all my interfaces for monitor mode and set some aliases. How should I divide up the script to set up the interfaces, then the aliases?


#!/bin/sh

for monitor in `iwconfig 2>/dev/null | grep mon | cut -f1 -d' '`
do
  num=`echo $monitor | tr -d [:alpha:]`
  airmon-ng stop wlan$num
  airmon-ng stop $monitor
done

for interface in `iwconfig 2>/dev/null | grep wlan | cut -f1 -d' '`
do
  num=`echo $interface | tr -d [:alpha:]`
 
  #airmon-ng stop $interface
  ifconfig $interface down
 
 
  mac=`macchanger -A $interface | grep Faked | cut -f5 -d' '`

  alias r$num="reaver -vvam $mac -i mon$num -b"
 
  ifconfig $interface up
  airmon-ng start $interface
done

alias > /tmp/alias.sh

rm /tmp/alias.txt
OIFS="$IFS"
IFS=$'\n'
for line in `cat /tmp/alias.sh`
do
  echo alias "$line" >> /tmp/alias.txt
done
IFS="$OIFS"

#r=`source /tmp/alias.txt`
#export r
#. /tmp/alias.txt

Name: OP 2012-12-17 19:07

I know it's a little rough around the edges (shitty loop syntax, very specific grepping) but it saves me a shitton of time.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List