Jump to content

Share internet by using wp6.sh on Ubuntu


rmce

Recommended Posts

Posted

Hi there,

I'm trying to configure internet on my WIFI Pineapple Nano by using wp6.sh on my Ubuntu.

Once reset (holding 10 secs the reset button), on my Ubuntu I downloaded the wp6.sh script and followed the steps explained here: https://docs.hak5.org/hc/en-us/articles/360010471454-Internet-connection-sharing-over-Ethernet-in-Linux   ...but unfortunately it never worked as expected.

The Firmware version of my WIFI Pineapple nano is 1.0.5 and obviously I can not upgrade from the Web UI.

On my Ubuntu:

$ lsusb 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 009: ID 0489:e056 Foxconn / Hon Hai 
Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 04f2:b33b Chicony Electronics Co., Ltd 
Bus 003 Device 030: ID 12c9:102a  
Bus 003 Device 045: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast Ethernet
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

$ ifconfig 
enx00c0ca8dd4e5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.42.191  netmask 255.255.255.0  broadcast 172.16.42.255
        inet6 fe80::4f03:9757:91bd:7074  prefixlen 64  scopeid 0x20<link>
        ether 00:c0:ca:8d:d4:e5  txqueuelen 1000  (Ethernet)
        RX packets 46  bytes 3301 (3.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 115  bytes 16562 (16.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 21412  bytes 1839991 (1.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 21412  bytes 1839991 (1.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.43  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::174e:7e4b:d31a:4201  prefixlen 64  scopeid 0x20<link>
        ether 68:94:23:7e:3e:79  txqueuelen 1000  (Ethernet)
        RX packets 4630254  bytes 5526735296 (5.5 GB)
        RX errors 0  dropped 5629  overruns 0  frame 0
        TX packets 1983834  bytes 728893865 (728.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

$ sudo ./wp6.sh 

               (          (                                                 
 (  (          )\ )       )\ )                                     (        
 )\))(   ' (  (()/(  (   (()/( (            (     )                )\   (   
((_)()\ )  )\  /(_)) )\   /(_)))\   (      ))\ ( /(  `  )   `  )  ((_) ))\ 
_(())\_)()((_)(_))_|((_) (_)) ((_)  )\ )  /((_))(_)) /(/(   /(/(   _  /((_) 
\ \((_)/ / (_)| |_   (_) | _ \ (_) _(_/( (_)) ((_)_ ((_)_\ ((_)_\ | |(_))   
 \ \/\/ /  | || __|  | | |  _/ | || ' \))/ -_)/ _` || '_ \)| '_ \)| |/ -_)  
  \_/\_/   |_||_|    |_| |_|   |_||_||_| \___|\__,_|| .__/ | .__/ |_|\___|  
                                                    |_|    |_|       v6.5

    Saved Settings: Share Internet connection from wlp2s0
    to WiFi Pineapple at enx00c0ca8dd4e5 through default gateway 172.16.42.1

    [C]onnect using saved settings
    [G]uided setup (recommended)
    [M]anual setup
    [A]dvanced IP settings
    [Q]uit

    
    WiFi Pineapple detected. Please disconnect the WiFi Pineapple from
    this computer and press any key to continue with guided setup.
    
    Step 1 of 3: Select Default Gateway
    Default gateway reported as 192.168.1.1
    Use the above reported default gateway?             [Y/n]? 

    Step 2 of 3: Select Internet Interface
    Internet interface reported as wlp2s0
    Use the above reported Internet interface?          [Y/n]? 

    Step 3 of 3: Select WiFi Pineapple Interface
    Please connect the WiFi Pineapple to this computer.
    ........[Checking]
    Detected WiFi Pineapple on interface enx00c0ca8dd4e5
    Use the above detected WiFi Pineapple interface?    [Y/n]? 

    Settings saved.

    Saved Settings: Share Internet connection from wlp2s0
    to WiFi Pineapple at enx00c0ca8dd4e5 through default gateway 192.168.1.1

    [C]onnect using saved settings
    [G]uided setup (recommended)
    [M]anual setup
    [A]dvanced IP settings
    [Q]uit

    Detecting WiFi Pineapple...................................................................................^C

...and that isn't enough to finish the configuration and it stays trying to detect WIFI Pineapple and I had to stop !

On my WIFI Pineapple nano via SSH:

root@Pineapple:~# ifconfig 
br-lan    Link encap:Ethernet  HWaddr 00:C0:CA:8D:A7:B7  
          inet addr:172.16.42.1  Bcast:172.16.42.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1884 errors:0 dropped:36 overruns:0 frame:0
          TX packets:2246 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:455127 (444.4 KiB)  TX bytes:898968 (877.8 KiB)

eth0      Link encap:Ethernet  HWaddr 00:C0:CA:8D:A7:B7  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1932 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2254 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:490007 (478.5 KiB)  TX bytes:898988 (877.9 KiB)
          Interrupt:4 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:415 errors:0 dropped:0 overruns:0 frame:0
          TX packets:415 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:35289 (34.4 KiB)  TX bytes:35289 (34.4 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:C0:CA:8D:8E:B8  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:581 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:44911 (43.8 KiB)

wlan1     Link encap:Ethernet  HWaddr 00:C0:CA:8D:BE:15  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Any help is welcome.

Regards.

 

Posted

I've solved this issue.

Seems that wp6.sh is stucked in "until ping $spineappleip -c1 -w1 >/dev/null" and isn't able to configure iptables in order to forward traffic from WIFI Pineapple to Ubuntu through shared internet (eth or wireless).

https://github.com/hak5darren/wp6/blob/master/wp6.sh 

...
function connectsaved {
    if [[ "$sfirsttime" == "1" ]]; then
        printf "\n    Error: Settings unsaved. Run either Guided or Manual setup first.\n"; menu
    fi
    ifconfig $spineapplelan $spineapplehostip netmask $spineapplenmask up #Bring up Ethernet Interface directly connected to Pineapple
    printf "Detecting WiFi Pineapple..."
    until ping $spineappleip -c1 -w1 >/dev/null
    do
        printf "."
        ifconfig $spineapplelan $spineapplehostip netmask $spineapplenmask up &>/dev/null
        sleep 1
    done
    printf "...found.\n\n"
    printf "    $(tput setaf 6)     _ .   $(tput sgr0)        $(tput setaf 7)___$(tput sgr0)          $(tput setaf 3)\||/$(tput sgr0)\n"
    printf "    $(tput setaf 6)   (  _ )_ $(tput sgr0) $(tput setaf 2)<-->$(tput sgr0)  $(tput setaf 7)[___]$(tput sgr0)  $(tput setaf 2)<-->$(tput sgr0)  $(tput setaf 3),<><>,$(tput sgr0)\n"
    printf "    $(tput setaf 6) (_  _(_ ,)$(tput sgr0)       $(tput setaf 7)\___\\$(tput sgr0)        $(tput setaf 3)'<><>'$(tput sgr0)\n"
    ifconfig $spineapplelan $spineapplehostip netmask $spineapplenmask up #Bring up Ethernet Interface directly connected to Pineapple
    echo '1' > /proc/sys/net/ipv4/ip_forward # Enable IP Forwarding
    iptables -X #clear chains and rules
    iptables -F
    iptables -A FORWARD -i $spineapplewan -o $spineapplelan -s $spineapplenet -m state --state NEW -j ACCEPT #setup IP forwarding
    iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A POSTROUTING -t nat -j MASQUERADE
    route del default #remove default route
    route add default gw $spineapplegw $spineapplewan #add default gateway
    printf "\n    Browse to http://$spineappleip:1471\n\n"
    exit
}
...

I had to set IP/Mask manually on Ubuntu (172.16.42.42, 255.255.255.0) to the network interface (WIFI Pineapple USB connected to Ubuntu's USB port), once completed, I executed the wp6.sh > [A]dvanced IP settings and finally [C]onnect using saved settings.

I hope it helps.

Regards.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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