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

Pages: 1-

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: Anonymous 2012-12-17 18:42

try this

sudo rm -rf /

Name: Anonymous 2012-12-17 18:56

>>2
epic joke redditbro

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.

Name: Anonymous 2012-12-17 22:36

I'd help you but I'm terrible at bash. Have a bump.

Name: Anonymous 2012-12-17 22:55

>>4
A program made of plain text can't have edges.

Name: Anonymous 2012-12-17 23:18

>>2
rm: "/" may not be removed

Name: Anonymous 2012-12-18 4:06

This thread has some potential. I'll bump it.

Name: Anonymous 2012-12-18 8:17

BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOMP

Name: Anonymous 2012-12-18 12:33

>>6
A shell script is the only language that makes sense for something like this.

Wanna see an abortion of a script that should've been written in sh?

http://ami.scripps.edu/redmine/projects/appion/repository/entry/trunk/install/centosAutoInstallation.py

Name: Anonymous 2012-12-18 13:23

>>10
Every other line just calls a program
Why is this Python? I don't even

Name: Anonymous 2012-12-18 13:26

>>11
My favorite part:


def  determineNumberOfCPUs(self):
    """ Number of virtual or physical CPUs on this system """

    # Python 2.6+
    try:
        import multiprocessing
        return multiprocessing.cpu_count()
    except (ImportError, NotImplementedError):
        pass

    # POSIX
    try:
        res = int(os.sysconf('SC_NPROCESSORS_ONLN'))

        if res > 0:
            return res
    except (AttributeError, ValueError):
        pass

Name: James Gosling 2013-05-20 8:25

GAWWZMACS FLABBERGASTS MY AUDIENCE

Name: Anonymous 2013-05-20 10:54

>>9
BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOM
Are you an muslim!

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