Can an iPhone app work as root?

I am thinking about the design of the iPhone application that I would like to create. One of the possible problems is that this application must run as root (in order to access certain network ports). In a typical UNIX application, I just run the setuid application, but I wonder if this is possible using the iPhone application.

I read this question on the Apple forum, which is discouraging:

http://discussions.apple.com/thread.jspa?threadID=1664575

I understand that Apple wants to limit what the program can do, but there are many good, legitimate reasons for the user to run the program with elevated privileges. I am not trying to create a hacker tool here.

I'm sure I can get around this on the iPhone with the iPhone, but this is not what I need. Is there a way to run the elevated app on an intact iPhone?

(By the way, there is no need to warn me about the NDA.)

+4
source share
3 answers

Section 3.3.4 of the iPhone SDK Agreement assumes that you should not work outside of your sandbox.

Given that Apple was somewhat arbitrary in which applications they allow , you should definitely check them before starting development.

Compared to 2.0.x, sandbox restrictions actually increased at 2.1 ; You can no longer read from another application sandbox. Thus, even if it is currently possible to increase the privileges of your application, it most likely will not be in a future release.

+5
source

The only options you have are

  • Run the application as root on iphone

  • Set the setuid bit of the application and the root of the owner.

I don’t see any of them being blessed by Apple.

I think it depends on what you want to do with privileges, if you are lucky that smaller privileges may be available, but afaik you need to select a port above 1024.

+2
source

It doesn’t matter if you can do this on your regular desktop computer. The iPhone is not an ordinary desktop computer.

Unlike a desktop computer, the only way to get an application on an iPhone without jailbreaking is to get it from the App Store. The only way to get into the App Store is to follow Apple’s rules, and Apple’s rules clearly state “no escalation of privileges,” “no sandbox escaping,” and “no access to network ports outside the existing APIs.”

What you want to do is impossible .

0
source

Source: https://habr.com/ru/post/1276680/


All Articles