Sniff local network iOS game host - ios

I am having a little issue right here.
I want to sniff an iOS game that makes an ad-hoc connection to another iOS device using the local network to get multiplayer, but I am unable to sniff these packets, I've tried with Wireshark but no luck (I think I am doing it wrong).
What can I do to intercept the connection between these two devices?

If it's on a WPA network, I think you need to do the sniffing on the AP. Alternatively, put all three devices on an ad-hoc WEP network.
There's also peer-to-peer bluetooth. I'd avoid that by turning it off, instead of trying to sniff a bluetooth key exchange.

Related

What's the best way to exchange data between devices locally?

I want to send data from 4-7 iPads to a MacBook and back for an application I plan on making that uses all devices and I want to avoid using a server for exchanging data. Also I would like to avoid connecting the devices over a local wifi network, as I would like my application to work regardless of wifi availability.
Is there a way of doing this using Bluetooth or a wired solution? Or maybe something else?
I think your best way is using apple Multipeer Connectivity, you can connect up to 7 nearby devices via Bluetooth, Wifi, or creat a local Wifi: https://developer.apple.com/reference/multipeerconnectivity

Is it possible to utilize carrier data and WiFi connections simultaneously within an App?

The theory in question is that I have a device that emits its own WiFi network. In order to communicate with this device, you must be connected to that WiFi network, but as it does not provide internet, your connection options are blocked.
What would be ideal, is to connect to this device, collect data from it, and transmit/push this data to a server located online via whatever means.
This question has been asked before, but the responses and questions I found were a few years old, and the OS has been updated a few iterations since then.
Is it possible, via Swift or Objective C within a mobile iOS app to utilize the connection of WiFi, but use carrier data to transmit that collected data?
I would use the BlueTooth API for this. However, there are two restrictions: 1) you cannot connect to a BlueTooth device in a captive network, and 2) you will not be able to connect to Android devices via BlueTooth.

Are Wi-Fi Direct and Wi-Fi P2P the same?

Maybe this is a stupid question but..
Are Wi-Fi Direct and Wi-Fi P2P the same thing?
And I mean, the EXACTLY same thing?
I'm getting really confused with this two.
Wifi Direct is a technology for peer to peer connections and is very different from wifi. Wi-Fi Direct, initially called Wi-Fi P2P, is a Wi-Fi standard enabling devices to easily connect with each other without requiring a wireless access point.It is usable for everything from internet browsing to file transfer
Wifi Direct is not same as wifi . On Jelly Bean and above, when you try to use the WifiP2pManager API, WiFi-Direct is automatically enabled (as long as WiFi is on). Wifi can be switched on by calling:
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); wifiManager.setWifiEnabled(true);
For ICS refer to this Can I turn on WiFi-Direct from code? on Android API-14 (ICS)
This is the main reason to get confused between the two.

Is GSM data sending between 2 phones impossible?

Please tell me in detail why it is impossible to send the data between two phones over GSM? I can find almost no information about this problem.
There are 2 points here.
Firstly, GSM is a mobile voice telephony system - plain GSM doesn't do data connections.
GPRS and EDGE are add-ons to the GSM network that allow data to be sent.
There are other kinds of wireless phone networks that also use a SIM and allow data to be sent (UMTS, LTE).
Secondly, when you establish a data connection with a mobile phone and a phone network, you are establishing an IP connection between your phone/modem and a gateway server in the operator's network. The gateway server allows you access to the internet (together with the DNS server etc, obviously).
This is similar to a computer plugging in a LAN cable and connecting to their ISP. But you can also connect 2 computers with a crossover cable, and configure them to have an IP connection directly. So what you are asking is, why can't I do the same with 2 GSM phones? what is the equivalent of a wireless crossover cable?
The reason is because GSM has no protocol to connect phones to each other. It only defines a protocol for phones to connect to a network base station.
To transfer data between 2 phones, therefore, you need a different protocol, one which will work between 2 peers. Bluetooth is a common such protocol, but it only works over short distances.
If you want to connect 2 distant phones, you can do this via a third party, like a website, to which data can be uploaded into the cloud by the first phone and downloaded by the second phone.
Or, you could establish a connection at the IP level via the internet, e.g. if one mobile device was a web server (the last sentence is only theorising).
See also this related question
EDIT: 3GPP Release 12 includes direct Device to Device communications. At the time of writing, it's still very new, and not yet commercially available, so the answer above still holds. D2D is designed for emergency services, eg if the network is damaged by a disaster, they can still communicate directly. But 3GPP suggests that it will be commercially available as well. From 3GPP news
There are also commercial benefits of D2D, with new applications building on the physical proximity of users being trialed by operators.
2nd EDIT: Apple has created a feature called Multipeer Connectivity Framework, which uses a mixture of WiFi networks, peer-to-peer WiFi and Bluetooth to enable short distance connectivity between iPhones when there is no GSM network.
NFC is another peer-to-peer technology for communicating between 2 devices, that is supported by some phones. More information here.

Connect iPhone to local server for testing on XCode? -- without using WiFi

So I have an ejabberd (XMPP) server setup on my MacBook. Connects fine with Simulator, only intermittently on the device. The two times it hasn't connected were at cafes that had sign-on gateways for their Wi-Fi. I know nothing when it comes to networks, but I'm guessing this is a Firewall thing?
I'm supposing I can't get around the firewall without an elaborate workaround.
I've found that turning off Wi-Fi on both devices and turning on tethering so that both devices are communicating via data works. However, I'd rather not do this as my data plan is limited and I'd like to be freely internet-connected while I work.
Is there a way to setup XCode to have the phone use the USB connection to access the server on the MacBook? Or maybe some other way I'm not imagining?
Bluetooth doesn't work.
I don't believe that the problem is with some kind of firewall on the network…
Try using the local IP address instead of the hostname, It will change from network to network. To get it, you can open the network utility
In this case it would be [xmppStream setHostName:#"172.16.1.2"];

Resources