Results 1 to 6 of 6

Thread: Create Internet Connection Sharing

Hybrid View

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    30

    Default Create Internet Connection Sharing

    ok this is the case

    1. I have a Wifi Pineapple v2 that is running static on 192.168.1.1 ( Jasager, La Fonera 2100)
    2. I have a laptop HP Pavilion ZE2000 running Backtrack 4

    The Pineapple is connected to my laptop via the WAN to LAN port with a Cat5 cable

    Wifi pineapple (from HAK5) is running on Openwrt and Karma

    1. The laptop is configured with Broadcom b43xx drivers that work great with Aircrack-ng and all other BT4 features, injection and such.

    I can easy connect to my Netgear AP at home so that I know is working just fine.

    Then I do

    ifconfig eth0 192.168.1.22 up

    ok, now I can ping 192.168.1.1 with positiv result, log into the wifi pineapple though browser 192.168.1.1 and get the openwrt interface.

    Here is the problem

    The wifi pineapple should be working as a "man in the middle" capturing clients as they send out probes asking "is my home network around" - Wifi pineapple should then answer "yes i am" and then connect the client to Internett allowing me to capture data as the man in the middle..

    Now, what happens is that when eth0 is connected and wicd shows wired is connected, all clients connected to the Wifi pineapple does not get an internet connection, not all that strange as there is no internet connection running on the laptop.

    When I do then connect via wicd with wlan0 to my Netgear (access point with internet) the pineapple gets disconnected somehow..

    What I need to know, how do I go about setting my Backtrack up so that I can use wlan0 in order to get online, and then have the eth0 connected wifi pineapple to use that internet connection..

    As far as I know, the Backtrack laptop should then be a dhcp server handing out ip to all clients that connect via the pineapple?

    Do I need either a dhcp server, a bridged solution or a vhub running to get a ICS for both eth0 and wlan0???


    Hope anyone can answer and solve this issue for me..

  2. #2
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default Re: Create Internet Connection Sharing

    Quote Originally Posted by exeption View Post
    The Pineapple is connected to my laptop via the WAN to LAN port with a Cat5 cable

    Then I do

    ifconfig eth0 192.168.1.22 up

    ok, now I can ping 192.168.1.1 with positiv result, log into the wifi pineapple though browser 192.168.1.1 and get the openwrt interface.
    OK so the wired connection between your laptop and the router is working perfectly.

    The wifi pineapple should be working as a "man in the middle" capturing clients as they send out probes asking "is my home network around" - Wifi pineapple should then answer "yes i am" and then connect the client to Internett allowing me to capture data as the man in the middle..
    Sounds cool, never heard of that before. So if a client laptop says "I'm looking for ChocoNet" then your access point will say "Yeah that's me, I'm ChocoNet, come connect to me". Is that right?

    Now, what happens is that when eth0 is connected and wicd shows wired is connected, all clients connected to the Wifi pineapple does not get an internet connection, not all that strange as there is no internet connection running on the laptop.
    Just my own preference, but I always disable network managers when I'm playing around with stuff like this. For instance, on my Ubuntu machine, I do:

    Code:
    service network-manager stop
    I'm not sure how you disable the network manager on BT4.

    When I do then connect via wicd with wlan0 to my Netgear (access point with internet) the pineapple gets disconnected somehow..

    What I need to know, how do I go about setting my Backtrack up so that I can use wlan0 in order to get online, and then have the eth0 connected wifi pineapple to use that internet connection..
    Sounds like you want eth0 on your laptop to act as a router that forwards IP packets on to wlan0? Maybe like this:

    Code:
    echo 1 > /proc/sys/net/ipv4/ip_forward
    ifconfig eth0 192.168.1.22 netmask 255.255.255.0
    iptables -t nat -A POSTROUTING -o wlan0 -s 10.10.10.0/24 -j MASQUERADE
    You need to change the part in Red to reflect the network address of the wlan0 network. (There might be a handier way of doing this but this is the only method I know).

    That's how I do Internet Connection Sharing when I have an extra wifi card and I want to share internet with a friend.

    As far as I know, the Backtrack laptop should then be a dhcp server handing out ip to all clients that connect via the pineapple?
    If I understand correctly, then all you would need to do is tell the Pineapple to forward all traffic to 192.168.1.22 (you could do this by editing its Routing Table).

    Do I need either a dhcp server, a bridged solution or a vhub running to get a ICS for both eth0 and wlan0???
    If you Pineapple has a DHCP server then there's no need to have one running on your laptop.

  3. #3
    Junior Member
    Join Date
    Apr 2010
    Posts
    30

    Default Re: Create Internet Connection Sharing

    OK so the wired connection between your laptop and the router is working perfectly.
    Yes I would imagine that

    Here is ifconfig eth0

    eth0 Link encap:Ethernet HWaddr 00:c0:9f:b5:4f:fa
    inet6 addr: fe80::2c0:9fff:feb5:4ffa/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:97 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:12205 (12.2 KB) TX bytes:468 (468.0 B)
    Interrupt:18 Base address:0xa000

    As you can see the link encap is running, scope is set to link ( Dont ask how I managed this LOL

    Sounds cool, never heard of that before. So if a client laptop says "I'm looking for ChocoNet" then your access point will say "Yeah that's me, I'm ChocoNet, come connect to me". Is that right?
    Exactly, take a look at this page and see airport man in the middle attack using Jasager
    Hak5 – Technolust since 2005

    If I understand correctly, then all you would need to do is tell the Pineapple to forward all traffic to 192.168.1.22 (you could do this by editing its Routing Table).
    How to I do that?

    If you Pineapple has a DHCP server then there's no need to have one running on your laptop.
    It has, but it is put now as Static and wan port is acting as LAN to LAN
    static ip is 192.168.1.1 and host 255.255.255.0

    The common statement on the Jasager support forum is to have the pineapple set to static, mine is therefora default.

  4. #4
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default Re: Create Internet Connection Sharing

    Quote Originally Posted by exeption View Post
    How to I do that?
    Recently I wanted to share an Internet connection between my own laptop and a friend's laptop.

    I connected my laptop to my friend's laptop using an Ethernet cable, and the network interface I used for this connection on my own laptop was eth0.

    My main wireless card on my own laptop, wlan0, was used to connect to the Internet. Its setup was pretty simple:

    Code:
    iwconfig wlan0 essid MyNet key off
    dhclient wlan0
    Next I had to set up my eth0 connection on my own laptop. I gave it a static address:

    Code:
    ifconfig eth0 10.10.10.1 netmask 255.255.255.0
    Then I went to my friend's laptop and I set his eth0 connection:

    Code:
    ifconfig eth0 10.10.10.2 netmask 255.255.255.0
    Then I made sure that we could ping each other. So from my own laptop, I did:

    Code:
    ping 10.10.10.2
    And from my friend's laptop, I did:

    Code:
    ping 10.10.10.1
    That worked fine. Next I wanted to set up Internet connection sharing on my own laptop:

    Code:
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o wlan0 -s 10.10.10.0/24 -j MASQUERADE
    Then on my friend's computer, I set 10.10.10.1 as the default gateway as follows:

    Code:
    route add default gateway 10.10.10.1
    Again, on my friend's computer, I also set the DNS server:

    Code:
    echo nameserver 4.2.2.1 > /etc/resolv.conf
    And that was it. I opened a web browser on my friend's computer, and he was able to surf the net and do whatever he wanted.

    Here's a quick guide for using the command line to set your internet connection:

    Linux Internet Connection - Virjacode

  5. #5
    Just burned his ISO
    Join Date
    Jan 2010
    Location
    finally home :) working in town
    Posts
    11

    Default Re: Create Internet Connection Sharing

    Hey that's cool that someone actually makes these Sounds like a good 'out of my garage' money maker.

    Maybe firestarter can give you luck with the internet connection sharing bit. The firestarter setup is easy and there is a lot of docs for it.

    Be aware that running firestarter on backtrack sometimes gets in the way some BT4 tools (well more like an inconvenience).

    Good Luck!

  6. #6
    Just burned his ISO
    Join Date
    Aug 2008
    Posts
    3

    Cool Re: Create Internet Connection Sharing

    WOW its work
    thank you Virchanza

    my lab is:
    =======
    laptop xp os & VMware BT3 (wlan0 + eth0)
    my-router (without internet) ip 192.168.0.1 (2 port lan + wifi)
    myNeighbor-router (with internet) ip 192.168.1.1 (after i cracked wep key ;P)
    =======

    after i connect from BT3 by wlan0 (dhcp) to N-router (any ip)
    i bridge eth0 (192.168.0.101) to my local connection (192.168.0.100) on XP
    and i change default gateway to 192.168.0.101 (on loc. con.)
    and i do all the commands in BT3
    => ifconfig eth0 192.168.0.101 netmask 255.255.255.0
    => echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.0.0/24 -j MASQUERADE

    and then i connect my iphone to my router WIFI (no internet) with this config:
    static ip = 192.168.0.102
    default gateway = 192.168.0.100 <=== loc. con. not BT3 eth0 ip
    and the important thing is DNS name = 192.168.1.1 <=== my N-router

    and its work fine with my all device (laptop + iphone + dreambox) WOW

    thank you again my teacher Virchanza

    and sorry about my lang.

Similar Threads

  1. Sharing Internet throught ethernet prot
    By TrustNoOne in forum Beginners Forum
    Replies: 1
    Last Post: 03-09-2010, 07:32 PM
  2. Cant create internet connection!!!
    By TiR@n In$iDe in forum OLD BackTrack 4 General Support
    Replies: 6
    Last Post: 07-29-2009, 12:42 PM
  3. wireless Internet Sharing on laptop
    By aurora79 in forum OLD Newbie Area
    Replies: 4
    Last Post: 03-30-2009, 09:18 PM
  4. Internet sharing from wifi to nic
    By luckyblur in forum OLD Newbie Area
    Replies: 0
    Last Post: 10-13-2008, 09:01 PM
  5. Help with internet connection sharing
    By devilsson2010 in forum OLD BackTrack 3 Final
    Replies: 0
    Last Post: 08-24-2008, 08:24 PM

Posting Permissions

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