Jump to content

Recommended Posts

Posted

I have a MarkIII and now after Shmoocon a MarkIV but I notice the same mistakes and problems in both the paper documentation and the scripts on the site. Any chance we can get this fixed? Or at least use this thread to document the work-arounds?

I'll reply with each of the issues I'm seeing to keep them separate.

Posted

I'll reply with each of the issues I'm seeing to keep them separate.

First problem - in the paper documentation the definition of the $gateway variable doesn't work for at least a couple reasons.

this is what it looks like:

$gateway='netstat -nr |ask `BEGIN {while ($3!=0.0.0.0") getline; print $2}'

I think I got the use of single quote vs. backtick right but it's hard to tell, either way there are a number of unclosed quotes, the "ask" isn't my typo, it's in the document and even when I fix most of those it still doesn't quite work.

The same line is fixed in the wp3.sh script:

netstat -nr | awk `BEGIN {while ($3!=0.0.0.0”) getline; print $2}

It would be nice to fix the paper. :)

thanks.

Posted

I'll reply with each of the issues I'm seeing to keep them separate.

The default wp3.sh script seems to fail on my Ubuntu 11.10 system, having gone through and edited it, below is a version that works. The main difference being the fixing the equality tests, using double quotes instead of single quotes and the addition of double quotes around the IPs being matched for later. I've had the same errors before on other debian systems. If I don't use the fixed version and try to use the default values I get this:

./wp3.sh

Input Pineapple Netmask [or ENTER for 255.255.255.0]:

./wp3.sh: 8: [[: not found

cat wp3_fixed.sh

#!/bin/sh

#define variables

echo -n "Input Pineapple Netmask [or ENTER for 255.255.255.0]: "

read pineapplenetmask

if [ "$pineapplenetmask" = "" ]; then

pineapplenetmask="255.255.255.0" #Default netmask for /24 network

fi

echo -n "Input Pineapple Network [or ENTER for 172.16.42.0/24]: "

read pineapplenet

if [ "$pineapplenet" = "" ]; then

pineapplenet="172.16.42.0/24" # Pineapple network. Default is 172.16.42.0/24

fi

echo -n "Input Interface between PC and Pineapple [or ENTER for eth0]: "

read pineapplelan

if [ "$pineapplelan" = "" ]; then

pineapplelan="eth0" # Interface of ethernet cable directly connected to Pineapple

fi

echo -n "Input Interface between PC and Internet [or ENTER for wlan0]: "

read pineapplewan

if [ "$pineapplewan" = "" ]; then

pineapplewan="wlan0" #i.e. wlan0 for wifi, ppp0 for 3g modem/dialup, eth0 for lan

fi

temppineapplegw=`netstat -nr | awk 'BEGIN {while ($3!="0.0.0.0") getline; print $2}'` #Usually correct by default

echo -n "Input Internet Gateway [or ENTER for $temppineapplegw]: "

read pineapplegw

if [ "$pineapplegw" = "" ]; then

pineapplegw=`netstat -nr | awk 'BEGIN {while ($3!="0.0.0.0") getline; print $2}'` #Usually correct by default

fi

echo -n "Input IP Address of Host PC [or ENTER for 172.16.42.42]: "

read pineapplehostip

if [ "$pineapplehostip" = "" ]; then

pineapplehostip="172.16.42.42" #IP Address of host computer

fi

echo -n "Input IP Address of Pineapple [or ENTER for 172.16.42.1]: "

read pineappleip

if [ "$pineappleip" = "" ]; then

pineappleip="172.16.42.1" #Thanks Douglas Adams

fi

#Display settings

echo Pineapple connected to: $pineapplelan

echo Internet connection from: $pineapplewan

echo Internet connection gateway: $pineapplegw

echo Host Computer IP: $pineapplehostip

echo Pineapple IP: $pineappleip

echo Network: $pineapplenet

echo Netmask: $pineapplenetmask

#Bring up Ethernet Interface directly connected to Pineapple

ifconfig $pineapplelan $pineapplehostip netmask $pineapplenetmask up

# Enable IP Forwarding

echo '1' > /proc/sys/net/ipv4/ip_forward

echo -n "IP Forwarding enabled. /proc/sys/net/ipv4/ip_forward set to "

cat /proc/sys/net/ipv4/ip_forward

#clear chains and rules

iptables -X

iptables -F

echo iptables chains and rules cleared

#setup IP forwarding

iptables -A FORWARD -i $pineapplewan -o $pineapplelan -s $pineapplenet -m state --state NEW -j ACCEPT

iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A POSTROUTING -t nat -j MASQUERADE

echo IP Forwarding Enabled

#remove default route

route del default

echo Default route removed

#add default gateway

route add default gw $pineapplegw $pineapplewan

echo Pineapple Default Gateway Configured

#instructions

#echo All set. Now on the Pineapple issue: route add default gw $pineapplehostip br-lan

ping -c3 $pineappleip

if [ $? -eq 0 ]; then

echo "ICS configuration successful."

#echo "Issuing on Pineapple: route add default gw $pineapplehostip br-lan"

#echo " ssh root@$pineappleip 'route add default gw '$pineapplehostip' br-lan'"

#echo "Enter Pineapple password if prompted"

#ssh root@$pineappleip 'route add default gw '$pineapplehostip' br-lan'

fi

echo ""

echo "Browse to http://$pineappleip/pineapple -- Happy Hacking!"

echo ""

Posted

I'm not sure what you mean by "paper" or where this stuff is coming from. Is this stuff on the wiki itself or elsewhere?

When you buy one either in person or get one shipped to you, there is a small flyer that comes with. It is a print-out of the quickstart instructions except it isn't as up to date as this one:

http://wifipineapple.com/doku.php?id=quick_start_guide

It appears to be the PDF you find when you search for it:

http://hak5.org/wp-content/uploads/2011/11/wifi-pineapple-mark-3-quick-start-guide-2.pdf

Posted

The paper refers to the actual MK3 Quick Start Guide print-out. I see the problems with it and I'll refine the documentation when the MK4 becomes available.

The problem with the mk3.sh in Ubuntu is that it begins with #!/bin/sh instead of #!/bin/bash. I'll update the version on wifipineapple.com as this fix works in both Ubuntu and BT5.

If you picked up a mk4 at Shmoocon expect hot fixes and updates on the wiki and forums soon.

Posted

The paper refers to the actual MK3 Quick Start Guide print-out. I see the problems with it and I'll refine the documentation when the MK4 becomes available.

The problem with the mk3.sh in Ubuntu is that it begins with #!/bin/sh instead of #!/bin/bash. I'll update the version on wifipineapple.com as this fix works in both Ubuntu and BT5.

If you picked up a mk4 at Shmoocon expect hot fixes and updates on the wiki and forums soon.

Thanks for the info. I knew it was something simple to fix the wp3.sh but I couldn't remember. Just booted up my laptop to check it out.

Posted

I'll reply with each of the issues I'm seeing to keep them separate.

another small one; it's worth noting for ubuntu and anything that's not backtrack (e.g. running as root) you need to run wp3.sh with sudo.

It is a really minor thing but worth fixing.

Posted

The paper refers to the actual MK3 Quick Start Guide print-out. I see the problems with it and I'll refine the documentation when the MK4 becomes available.

The problem with the mk3.sh in Ubuntu is that it begins with #!/bin/sh instead of #!/bin/bash. I'll update the version on wifipineapple.com as this fix works in both Ubuntu and BT5.

If you picked up a mk4 at Shmoocon expect hot fixes and updates on the wiki and forums soon.

Thanks! They're wonderful devices.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...