Raw sockets permission IPhone? - iphone

I'm discovering capability of Iphone network programing. I have already working ICMP ECHO REQUEST / REPLAY using SOCK_DGRAM. And I would like to do more stuffs. For example port scan in NMap. Yes, I can use TCP connect(). But I wanna try to send TCP SYN.
My question is, can use raw sockets ? Because Iphone doesn't have root permission. And Unix Os need permission to use raw socket. But I found somewhere, that I can use SOCK_RAW and build own IP Header. Allows this Apple ?
Thanks for any reply.

You can't do that inside the SDK. If you are building a jailbreak app you can do this without any problem, probably you will need some headers, including the UDP header and possibly some BPF if you want to sniff packets (like tcpdump, which you can find a iPhone version on Saurik's repository) that are not present on the SDK. You can just copy them from Mac OS X (/usr/include) and put them on /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/ for example.

Related

Raw sockets on NaCl?

Right now I'm trying to migrate a code written in C to a application for Chrome browser.
I'm new in programming on the NaCl for Chrome Apps and I don't get really good if with the native client I can use the raw sockets. I need to use the raw sockets because I must create modified packets such as UDP with TTL very low.
So in general my question is, Can I use raw sockets (C style) with the NaCl? If the answer is yes, If you could provide some extra information, It would be great.
You can use TCP and UDP sockets, via the nacl_io library. Look at the nacl_io demo in the Native Client SDK. It can be found in the subdirectory examples/demo/nacl_io_demo.
Please note that these sockets APIs are only allowed when running as a Chrome App, not on the open web.

Is it possible to make a good voice call application with OpenSIPs server?

I am building a free voice call application on Android. I used OpenSIPs open source to make a SIP server and successfully make a call to another phone in WIFI network. However, I couldn't make a call when the phone uses cellular network like 3G/4G. I found out that I should make a STUN and TURN server to find exact SIP address.
Someone told me that it is hard to find SIP address if the user uses 3G or 4G network. So, he said I should use SBC to redirect voice data if I want to make good connections. He said I should make redirect servers to have good quality of service.
Is it possible to make a good voice call service with OpenSIPs server? If it is true, is there voice call services who used OpenSIPs open source? I've searched all documents, but couldn't find the answer.
Thank you.
I decided to make a SIP server using FreeSwitch Open Source. It was much better than OpenSIPs. I didn't have worry about NAT problem on FreeSwitch. It is also very easy to install a SIP server on Linux. Check out the website. http://freeswitch.org/

how to show iphone apps sniffing HTTP Requests?

i have iphone 3 with OS4 (not jailbreaked) and i want to inspect some apps http request urls , i tried fiddler but its not worked , anyone has idea? is the device must be jail breaked? i got ubuntu / windows so i can use one of them , if anyone knows how to do it please answer
If the device is using WiFi and you have a Wireless Network card that can enter promiscuous mode then you can use WireShark to sniff the raw packets. Use Follow TCP Stream to reconstruct the HTTP requests. More information can be found at http://www.wireshark.org
Another option is to force your device to use an HTTP Proxy and then inspect that traffic. There is a guide to doing this here: http://blog.jerodsanto.net/2009/06/sniff-your-iphones-network-traffic/
There is also a similar question here that should be helpful: iPhone and WireShark

How do you communicate to a Modbus device within an iPhone application?

I would like to be able to develop an iPhone application that can communicate with Modbus devices, but I'm not sure how to proceed. Has anyone had experience with this or are there existing libraries out there for this purpose?
You will need first to know how to make a simple TCP client on your iPhone, and a simple TCP server on your computer that your iPhone client will talk to via WiFi. Make sure PING command works and firewall does not block your server port before any client/server experiments, and make sure that server port for experimenting is greater then 1024 and not already used. Then take a look at MODBUS TCP specification from official site, get familiar with function codes you are interested in, and study C code found here. Then make a simple MODBUS TCP client that can send a request to MODBUS TCP server and interprete an answer. The best way is to start reading single register value, then progress in time and add more functions.
I do exactly all above points, my iOS Modbus lib works fine, application is now up on AppStore, PLCLink read and set any modBus data into my Wago home automation.
Installation guide : http://pautex.fr/plclink

Sending information over sockets to an iPhone MobileSubstrate extension hooked into MobileMail/MobileSafari/MobileMaps

I am trying to use MobileSubstrate to have a socket listening on a port on various UIKit applications. However, when my extension hooks into MobileSafari, MobileMail or MobileMaps, it is unable to successfully create the socket. I found this page on the iPhone Dev Wiki which clarifies the issue: http://iphonedevwiki.net/index.php/Seatbelt .
Is there any way around this for the built in applications to be able to listen on a socket (or open one at all?) If not, what's another good (and easy) way to do interprocess communication on iOS?
Personally for inter-device communication, i use CFMessagePorts which are a lot like mach ports.
http://developer.apple.com/mac/library/documentation/CoreFoundation/Reference/CFMessagePortRef/Reference/reference.html
If all you need is notifications - no data, then i'd suggest looking at the Darwin Notification Center (based off of CFNotificationCenter)