Fetch Device IP Addresses/MAC address of devices connected to a LAN - iphone

Currently I am wondering how I would go about implementing a fetch request to a local wireless network (router) to obtain all devices currently connected to a currently connected LAN....
So I've done some research and apparently 'nmap' is a terminal/commandprompt command that returns connected devices to a local wireless network, with some parameters that need to be inputted into the nmap command.
I found an iPhone app that does what I'm trying to do... https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CDYQFjAA&url=https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Fip-network-scanner-lite%2Fid335517828%3Fmt%3D8&ei=qhHfUbDpJ4GkigKClIHYCg&usg=AFQjCNFMDPn5H8TbDw54-zYDYJ9iezRXpA&sig2=QN42a5w-MgClO5BvBUoDGw
It scanns for devices on a currently connected WiFi network and displays all devices connected to such network... I am attempting to do the same but am stuck on where to start...
Anyone have any ideas? I am trying to do this for iOS..

I'm thinking you could do a broadcast ping, ala:
$ ping -b 192.168.0.255
using the Apple sample code for ping.
But I have not tried it.

Related

Find "Network" IP adresses with SWIFT

I try to find the IP adresse of a Raspberry PI (LINUX) that is connected to the same Network as the iOS device my code is running on.
Is there some way to "find all" ip adress in the network the device is currently joined via SWIFT?
If you ping the broadcast address, unless devices are specifically configured not to replay, they will do so. How you do that with Swift is another question.
This question+answer will work if you know your IP address, you need to probe all the probable addresses of course.
How to check Internet is working or not in ios

SSH to RaspberryPi which is connected via iPhone Hotspot

I have a RaspberryPi which is configured to automatically connect to my iPhone's wifi hotspot. I need to take the RaspberryPi to various locations for testing, and I often need to leave it at a location for extended periods of time (without my iPhone hotspot there). The RaspberryPi needs an internet connection in order to complete the testing properly.
I am trying find a solution which would allow me to SSH (or connect some other way) into the RaspberryPi while it is connected to my iPhone's wifi hotspot. This would allow me to add a new wifi network/password when I move to a new location (I usually can't get the wifi network/password in advance). In other words, I would move into a new location, the RaspberryPi would be connected to my hotspot and would begin testing, and once I obtain the wireless network/password for that location, I want to connect to the RaspberryPi to add that information so it can connect to the location's wifi network instead of my hotspot.
I don't have a portable monitor for the RaspberryPi so I can't just hook it up to a screen and make the changes that way.
Does anyone have any suggestions? Thanks in advance.
On the phone running this hotspot, I am assuming you can install apps that permit you to SSH into the Pi, headless? I'm doing this regularly, my choice app is JuiceSSH.
Alternately, a laptop connected to the same phone hotspot running an SSH client such as Putty can connect to the Pi across the same AP, also headlessly. You can update your WPA_supplicant file and reboot the Pi, making sure to bring down your hotspot before it fires up again and joins the new AP. I'm also doing this regularly.
Given the time (4 months) that's passed, you've likely figured this out already...

Redirect telnet 23 to COM Port via WIFI

I bought an Bluetooth ELM327 to read codes out of my cars diagnostic ports
I connect to it via Bluetooth in windows and it makes a serial-over-bluetooth com port 4
which any application running on my windows will connect quite happily.
I then found a few apps for the iphone and android etc that connect to these ELM gadgets via WIFI and not Bluetooth (because for some reason you cannot pair to these devices of iphone)
Now obviously I can buy a WIFI enabled ELM327 - but it costs £130 and my Bluetooth one cost £15
So after reading about this a bit I found out that the WIFI enabled ones you connect up as ad-hoc network and the smartphone(iphone) app tenets in port 23 that relays normal serial commands.
So obviously in the WIFI enabled one there must be some processor that runs an nano-os with telnet and some rs-323 translators and not sure what else.
How, using Windows 7 will i be able to relay any incoming WIFI requests for Telnet port 23 to my COM 4 that is connected to my Bluetooth ELM327 ..
As this is surely all that is needed by the Smartphone app.
You dont have to connect using a Bluetooth library like suggested ... because you are already connected to the device and have COM4 exposed to you. SO all you have todo is use a telnet library and translate and handle the handshake then realy the infomation as serial data.
There's no feature built in to Windows (or any other platform I know of) for such a scenario.
It would be fairly straightforward however to write a program to listen on port 23 and open a bluetooth connection when connected to, and then forward the data received on each connection out onto the other.
For instance one could use my .NET library 32feet.NET (e.g. http://32feet.codeplex.com/wikipage?title=General%20Bluetooth%20Data%20Connections etc etc) along with TcpListener from the .NET framework class libraries.

Connecting to a local network through iOS-device debugging

I have an application that uses a local ip-adress to connect to a soap based web-service. It works perfectly fine to debug through the simulator, however, when trying to debug the project on an actual iPhone-device it cannot reach the local network's soap-service.
Has anyone run into this and know if this is actually possible or do we need WiFi to be able to debug to a non-local ip-address, or is even that possible?
You can not access your local ip address from 3G only on wifi. You access it from 3G you need an public ip on the server that you have the web service.
If you are connected to a common wifi network say eg office wifi or home network.
You can check the local ip of your computer for that network by ipconfig of ifconfig.
Use same ip on app. You will be able to access.
Cheers.

Capturing network traffic while the application is running on iPhone and connected to xcode

Is there any way I can capture network traffic (using application like Ethereal, on Mac ) while the application is running on iPhone and connected to xcode
Thanks
Connect you mac using an ethernet cable. Share your network connection on the mac over your AirPort. Attach the iPhone to your Mac's ad-hoc network.
Run Wireshark or HTTPScoop on your mac and you will be able to see all traffic from the iPhone.
I'm no aware of any way to do this for the WAN connection though. I'd be surprised if it is possible.
To capture packets from your iPhone using Wireshark, you have to first get your device id for the phone from iTunes. Plug in your iPhone via USB to your Mac...then open iTunes and click the iPhone icon in top navbar.
You can't copy the UUID, so you have to write it down manually. After you have the UUID, you'll need to mount the device.
Open a terminal and type: rvictl -s <device-id>
I created an alias in ~/.bash_aliases as alias mntios='rvictl -s <device-id>' -- as long as you have the same phone your device UUID won't change, even if you re-install the OS.
Once you have the device mounted startup wireshark. brew install wireshark (see: http://brew.sh)
One of the network adaptors should be rvi0 -- this is the network interface for your iPhone.
Now you can capture packets -- double click it to start capturing.
If you want to filter for specific urls you can type a filter like: http.request.full_uri contains <string-in-url> to filter requests.
On your computer, run an HTTP debugging proxy like Charles (Mac) or Fiddler2 (Windows). In the phone's wi-fi settings, turn on the HTTP proxy, entering your computer's IP address and the port number of the proxy. Make the sure the proxy is configured to allow connections from your phone. (It may allow localhost-only by default.)