Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 44

Thread: connecting wirelessly via shell

  1. #31

    Default

    Quote Originally Posted by kid protocol View Post
    Thank you, Thank you, and Thank you again it worked perfectly. I honestly learned something new from this experience, but I had another question. How would I find the correct settings if I wasn't connected to the network all ready from my mac?
    If you only needed the "general network settings" and not the wireless info, once you had successfully associate to the AP, then you could send of a dhcp "test" and capture the resulting response (DHCP ACK) using wireshark. The DHCP ACK packet would normally contain info such as netmask, router, and dns server.

    Code:
    dhcpcd -T <wireless intfc>
    wireshark -i <wireless intfc> -k -f "udp port 68" -H -S -l (lower case L) &

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

    Default

    Quote Originally Posted by kid protocol View Post
    Thank you, Thank you, and Thank you again it worked perfectly.
    Glad to hear. Now we just need to figure out why DHCP won't work

    How would I find the correct settings if I wasn't connected to the network all ready from my mac?
    Depends if you wait for the release of my "Internet Prober" program (I've got it finished, I'm just working on the documentation now, so it'll be out in the next few days).

    For now though, here's what you do.
    1) First of all, open up Wireshark and see what IP addresses there are on the network. If you see the likes of "192.168.1.7", then you can be pretty sure the network is "192.168.1.0/24".

    2) Next do a netdiscover to get a list of all the hosts:

    Code:
    netdiscover -i wlan0 -r 192.168.1.0/24"


    3) Give yourself a unique IP address:

    Code:
    ifconfig wlan0 192.168.1.123 netmask 255.255.255.0
    4) Try adding 192.168.1.1 as your gateway, or maybe 192.168.1.254 (The first and the last are the most commonly used IP's for gateways).

    Hopefully it will be that easy. Sometimes though, it's more complicated, which lead me to actually write a program to do the work for me. My Internet Prober program works by doing the following:

    1) Send ARP requests to the entire network to get a list of hosts (similar to netdiscover)
    2) Next, send a public IP packet to the MAC address of every host, and hope that you get a reply from one of them. The one that replies will flash on screen as the default gateway.

    And as for DNS server, well that's easy, use a public one: 208.67.222.222
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  3. #33
    Junior Member
    Join Date
    Dec 2008
    Posts
    72

    Default

    Quote Originally Posted by Virchanza View Post
    Glad to hear. Now we just need to figure out why DHCP won't work

    Depends if you wait for the release of my "Internet Prober" program (I've got it finished, I'm just working on the documentation now, so it'll be out in the next few days).

    For now though, here's what you do.
    1) First of all, open up Wireshark and see what IP addresses there are on the network. If you see the likes of "192.168.1.7", then you can be pretty sure the network is "192.168.1.0/24".

    2) Next do a netdiscover to get a list of all the hosts:

    Code:
    netdiscover -i wlan0 -r 192.168.1.0/24"


    3) Give yourself a unique IP address:

    Code:
    ifconfig wlan0 192.168.1.123 netmask 255.255.255.0
    4) Try adding 192.168.1.1 as your gateway, or maybe 192.168.1.254 (The first and the last are the most commonly used IP's for gateways).

    Hopefully it will be that easy. Sometimes though, it's more complicated, which lead me to actually write a program to do the work for me. My Internet Prober program works by doing the following:

    1) Send ARP requests to the entire network to get a list of hosts (similar to netdiscover)
    2) Next, send a public IP packet to the MAC address of every host, and hope that you get a reply from one of them. The one that replies will flash on screen as the default gateway.

    And as for DNS server, well that's easy, use a public one: 208.67.222.222

    Thank you for the info, and your patience. Be sure to let me know when your internet prober is complete sounds like it's going to be a useful tool. Can't wait to try it!!!

  4. #34
    Very good friend of the forum killadaninja's Avatar
    Join Date
    Oct 2007
    Location
    London, United Kingdom.
    Posts
    526

    Default

    Quote Originally Posted by kid protocol View Post
    Ok I will do that then post the results, and I hope I didn't send any mixed messages, but yes on the mac side I connects to the internet with my airport card, but with backtrack 3 I was trying to connect with my linsky wusb54gc rt73 chip set based card. I have noticed that backtrack 3 does pick up my airport card, but it gives me the chip set as ath0 if I'm correct, but ath0 does come up when I do airmon-ng, but under mac it's en1.
    Quote Originally Posted by kid protocol View Post
    Thank you, Thank you, and Thank you again it worked perfectly. I honestly learned something new from this experience, but I had another question. How would I find the correct settings if I wasn't connected to the network all ready from my mac?
    Protocol, them instructions were just connectivity test, If after you tried them you internet was working properly, then it was working properly before them anyway congrats.
    Sometimes I try to fit a 16-character string into an 8–byte space, on purpose.

  5. #35
    Junior Member
    Join Date
    Dec 2008
    Posts
    72

    Default

    Quote Originally Posted by Virchanza View Post
    Glad to hear. Now we just need to figure out why DHCP won't work

    Depends if you wait for the release of my "Internet Prober" program (I've got it finished, I'm just working on the documentation now, so it'll be out in the next few days).

    For now though, here's what you do.
    1) First of all, open up Wireshark and see what IP addresses there are on the network. If you see the likes of "192.168.1.7", then you can be pretty sure the network is "192.168.1.0/24".

    2) Next do a netdiscover to get a list of all the hosts:

    Code:
    netdiscover -i wlan0 -r 192.168.1.0/24"


    3) Give yourself a unique IP address:

    Code:
    ifconfig wlan0 192.168.1.123 netmask 255.255.255.0
    4) Try adding 192.168.1.1 as your gateway, or maybe 192.168.1.254 (The first and the last are the most commonly used IP's for gateways).

    Hopefully it will be that easy. Sometimes though, it's more complicated, which lead me to actually write a program to do the work for me. My Internet Prober program works by doing the following:

    1) Send ARP requests to the entire network to get a list of hosts (similar to netdiscover)
    2) Next, send a public IP packet to the MAC address of every host, and hope that you get a reply from one of them. The one that replies will flash on screen as the default gateway.

    And as for DNS server, well that's easy, use a public one: 208.67.222.222

    I might be going off on a limb, but I think I see. Is it running a check to see if that's the ip address, or more like to see if the ip is in that range? When I did "netdiscover -i wlan0 -r 192.168.1.0/24" I got a list of macs with assigned ip addresses including mine that was all in that range (the last number was different from each other), but what if I'm not associated with the ap how would I find the right connection set up, or is associating with the ap is just knowing the essid, and key? (I think I'm confusing my self).

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

    Default

    Quote Originally Posted by kid protocol View Post
    I might be going off on a limb, but I think I see. Is it running a check to see if that's the ip address, or more like to see if the ip is in that range?
    Let's take a random IP address: 10.10.10.54

    An IP address contains 32 bits. An IP address is made up of two parts: The network bits and the host bits. Looking at the above IP address, you don't know which bits are for the network and which are for the host; it's possible that the network is "10.*", but then again it's possible that the network is "10.10.10.*". You use a thing called the "subnet mask" or simply "netmask" to figure out which bits identify the network and which bits identify the host.

    So let's say the IP address is 10.10.10.54 and the netmask is 24. A handy way of writing this is 10.10.10.54/24. This means that there are 24 network bits, which means there's 8 bits left for the host. You will commonly see a netmask written out as "255.255.255.0". The reason you will see 255 is because the binary equivalent is 11111111 (i.e. 8 bits, all of them set to 1).

    If I want to tell you the address of a network, then I might say: 10.10.10.0/24. Notice that I've set the host bits to zero. If the host bits are all zero, then you know you're dealing with a network address (as opposed to the address of an actual host on the network).

    So let's say you know that the network is 10.10.10.0/24. This means that the hosts will be:
    10.10.10.1
    10.10.10.2
    10.10.10.3
    ....
    10.10.10.252
    10.10.10.253
    10.10.10.254
    (10.10.10.255 is not a valid IP address for a host, it's used for "broadcast" messages)

    What netdiscover does is it sends out an ARP request for every valid IP address on the network you specify. So if you specify 192.168.1.0/24, then it will send 254 ARP requests. However if you specify a bigger network such as 192.168.0.0/16, then it will send 65534 ARP requests. When it receives ARP replies, it shows the IP addresses on screen along with the MAC address they belong to.

    When I did "netdiscover -i wlan0 -r 192.168.1.0/24" I got a list of macs with assigned ip addresses including mine that was all in that range (the last number was different from each other), but what if I'm not associated with the ap how would I find the right connection set up
    To be associated with an AP means that you can send Ethernet frames. If you aren't associated, then any frames you send will be rejected.


    Or is associating with the ap is just knowing the essid, and key? (I think I'm confusing my self).
    Yes that's pretty much it, unless they're some fancy stuff in place like MAC filtering. When you do "iwconfig wlan0 essid MyNet key MyKey", Linux goes to the trouble of authenticating and associating with the access point for you.

    Wired connections are different, all you have to do is plug the Ethernet cable into your computer. Once you've plugged the cable in, you can send and receive frames til the cows come how. However, with wireless, you have to associate to the AP, otherwise the frames you send will be rejected.

    Note, however, that you can receive frames without being associated to an AP (however you will need the key if you want to decrypt the frames).
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  7. #37
    Junior Member
    Join Date
    Dec 2008
    Posts
    72

    Default

    Quote Originally Posted by Virchanza View Post
    Let's take a random IP address: 10.10.10.54

    An IP address contains 32 bits. An IP address is made up of two parts: The network bits and the host bits. Looking at the above IP address, you don't know which bits are for the network and which are for the host; it's possible that the network is "10.*", but then again it's possible that the network is "10.10.10.*". You use a thing called the "subnet mask" or simply "netmask" to figure out which bits identify the network and which bits identify the host.

    So let's say the IP address is 10.10.10.54 and the netmask is 24. A handy way of writing this is 10.10.10.54/24. This means that there are 24 network bits, which means there's 8 bits left for the host. You will commonly see a netmask written out as "255.255.255.0". The reason you will see 255 is because the binary equivalent is 11111111 (i.e. 8 bits, all of them set to 1).

    If I want to tell you the address of a network, then I might say: 10.10.10.0/24. Notice that I've set the host bits to zero. If the host bits are all zero, then you know you're dealing with a network address (as opposed to the address of an actual host on the network).

    So let's say you know that the network is 10.10.10.0/24. This means that the hosts will be:
    10.10.10.1
    10.10.10.2
    10.10.10.3
    ....
    10.10.10.252
    10.10.10.253
    10.10.10.254
    (10.10.10.255 is not a valid IP address for a host, it's used for "broadcast" messages)

    What netdiscover does is it sends out an ARP request for every valid IP address on the network you specify. So if you specify 192.168.1.0/24, then it will send 254 ARP requests. However if you specify a bigger network such as 192.168.0.0/16, then it will send 65534 ARP requests. When it receives ARP replies, it shows the IP addresses on screen along with the MAC address they belong to.

    To be associated with an AP means that you can send Ethernet frames. If you aren't associated, then any frames you send will be rejected.


    Yes that's pretty much it, unless they're some fancy stuff in place like MAC filtering. When you do "iwconfig wlan0 essid MyNet key MyKey", Linux goes to the trouble of authenticating and associating with the access point for you.

    Wired connections are different, all you have to do is plug the Ethernet cable into your computer. Once you've plugged the cable in, you can send and receive frames til the cows come how. However, with wireless, you have to associate to the AP, otherwise the frames you send will be rejected.

    Note, however, that you can receive frames without being associated to an AP (however you will need the key if you want to decrypt the frames).

    Ok I think I got it. So long as I enter the essid and the key to the network to associate with the AP I could use netdiscover to find host with the network IP address.

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

    Default

    Quote Originally Posted by kid protocol View Post
    Ok I think I got it. So long as I enter the essid and the key to the network to associate with the AP I could use netdiscover to find host with the network IP address.
    Yep that's it.

    Most of the networks you connect to will have private IP addresses. The private networks addresses are as follows:

    10.0.0.0/8
    169.254.0.0/16
    172.16.0.0/12
    192.168.0.0/16

    So if a network is dead silent without a single frame, then these are the IP ranges to scan. As far as I know, if you run netdiscover without specifying a network address, it scans these private ranges (and it takes a while).

    The most common network I've encountered is 192.168.1.0/24, followed by 192.168.0.0/24.

    So it's a simple as:
    Code:
    iwconfig wlan0 MyLegallyOwnedAccessPoint key MyLegallyAcquiredKey
    netdiscover -i wlan0 -r 192.168.1.0/24
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  9. #39
    Junior Member
    Join Date
    Dec 2008
    Posts
    72

    Default

    Quote Originally Posted by Virchanza View Post
    Yep that's it.

    Most of the networks you connect to will have private IP addresses. The private networks addresses are as follows:

    10.0.0.0/8
    169.254.0.0/16
    172.16.0.0/12
    192.168.0.0/16

    So if a network is dead silent without a single frame, then these are the IP ranges to scan. As far as I know, if you run netdiscover without specifying a network address, it scans these private ranges (and it takes a while).

    The most common network I've encountered is 192.168.1.0/24, followed by 192.168.0.0/24.

    So it's a simple as:
    Code:
    iwconfig wlan0 MyLegallyOwnedAccessPoint key MyLegallyAcquiredKey
    netdiscover -i wlan0 -r 192.168.1.0/24

    Thank you, all of my questions has been answered. I don't think I could have done it with out all of your advice especially virchanza. See you in another thread!

  10. #40
    Junior Member
    Join Date
    Dec 2008
    Posts
    72

    Default

    I didn't want to come back, but it seems like my problem persist. After I thought I had solved the problem I disconnected the device, and tried to reconnect to my network doing the steps I took to connect the first time it fails every time. I don't know what I'm doing wrong or not doing, but I am lost, and in need of help.

    Here's the command:
    iwconfig rausbo essid (name of network) key (my key)
    ifconfig rausb0 192.168.1.6 netmask 255.255.255.0
    route add default gateway 192.168.1.1
    echo nameserver 192.168.1.1 > /etc/resolv.conf

    After this I'll open Fire fox, and Fire fox will attempt to look up a web page for about a minute then respond with server can't be found. I can't ping any .com's it comes back as "unknown host". I've done test to see if I could receive frames, and once I did. Please help!!!

Page 4 of 5 FirstFirst ... 2345 LastLast

Posting Permissions

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