"No Internet Connection" for iOS Apps Being Proxied Through OWASP ZAP - ios

Sort of a newb to OWASP ZAP/proxying apps through it, so I'm tagging OWASP in this post, but hoping someone knows how to circumvent this issue here.
On Windows 10, OWASP ZAP 2.11.1, I've generated a new certificate and installed/trusted it to my iPhone 13 Pro Max. I've setup the proxy to run over port 8081 in OWASP, and turned on the routing on the phone. I'm seeing the traffic in OWASP which is cool, however the apps aren't actually "working". For example, if I load the Instagram app, I see the traffic/sites showing up in the left pane for Instagram, but on the phone, it doesn't refresh the feed and says there's no internet connection. Some other apps just hang on the first loading screen of the app, even though I'm seeing the traffic in OWASP.
My theory here is that the traffic isn't being routed BACK to the phone, but merely being intercepted before sending it out. Am I correct in assuming this? Or what else could be happening here as I'd like the apps to work properly while I'm proxying through ZAP.
Thanks!
UPDATE
After some digging, I'm thinking this is likely a result of "pinning", which I think can be (relatively easily) circumvented with Frida for Android apps, but maybe not so much with iOS apps. Any insights into that would be greatly appreciated!

I was getting the "no internet" message after following the steps above posted by Simon Bennets (https://www.zaproxy.org/faq/can-zap-be-used-to-test-mobile-apps/). Had to do extra step to trust manually installed certificate profiles as shown here: https://support.apple.com/en-us/HT204477.

Related

Burpsuite proxy troubleshoot issue

I am working on mobile pentests currently. At first, using my home network I was able to intercept traffic on burpsuite for both iOS and Android versions of “Test App”. Then the next day, I still am able to intercept traffic but the behaviour of this “Test App” for both iOS and Android seem like it has certificate pinning as I was just stuck on the pre-auth page and getting errors when trying to log in. Without proxy though I am still able to login OK and proceed with the app normally so I don’t think my home network got blacklisted? (For context, the binaries does not have any certificate pinning).
But when I tried to change my network to my mobile hotspot, I could intercept the traffic and app behaves normally again.
Anyone encountered the same previously? Any ideas on what could be causing this? Thanks
This does seem odd. I would wager one of three things is happening here:
You accidentally left "Intercept" on in Burp Suite Proxy. This holds the response in Burp Suite until you click Forward, which would cause behavior very similar to what you are describing here. I have done this more times than I am willing to admit.
There was a temporary outage in the application's API. Not unheard of, especially if this is an unreleased app.
There is some sort of issue on your home network, but this is unlikely. Maybe two devices have the same static IP address?
It's hard to say exactly what the issue might be based on the information you provided, but hopefully this was helpful, or at least gives you a place to start!

Are Universal Links cached in iOS? Do they work offline?

I tested Universal Links in iOS by turning on Airplane mode and saw that the correct application was opened (instead of a website)
This indicates some level of "caching" the apple-app-site-association.
I want to determine the extent to which this is cached, so I can determine
What UX edge cases are there (e.g. Offline for x days)
What security considerations are there (e.g. MITM / SSLStrip + .well-known/URL)
etc.
Ideally I would like to have details if additional logic is employed (conditional caching if HTTPS employed, DNSSec, etc)
The exact behavior here is (intentionally?) unclear from Apple. Here is my personal experience, gleaned partly from official documentation and partly from helping thousands of apps implement Universal Links at Branch.io.
The apple-app-site-association file is cached once when the app is first installed.
If this initial scrape fails, in almost all situations it will not be reattempted. The only exception to this is if the initial return is a 5xx error, in which case a limited number of retries may occur. This is not well-documented, and is not covered in Universal Links documentation at all. You can find a mention in the Shared Web Credentials docs.
The file is not checked at all when a Universal Link is opened. This is why you are able to get Universal Links behavior in airplane mode.
The file does not expire. Once it is cached, it sticks permanently for as long as the app is installed.
The file will be re-checked when installing an app update.
The file must be accessible via a valid SSL connection at either https://example.com/apple-app-site-association or https://example.com/.well-known/apple-app-site-association. If there are redirects of any kind, this will fail.
It is theoretically possible to MITM the request if you are able to install a new SSL certificate directly on the device in question. Charles Proxy for example uses this approach for debugging. I have never seen or heard of this being exploited, and the damage would be quite limited because the domain still has to be specified inside the app itself.
I found a way to get around the caching issue. The cache is bound to the domain name, so for every time you want iOS to request apple-app-site-association you can create a new subdomain, and configure iOS to use that subdomain as the universal link for your app.
Extremely hacky, but it is the only workaround that worked for me.

Need URL for Appstore connectivity and Xcode developer account connectivity

In my office, proxy and URL restriction is there so am not able to update the app/softwares through Appstore application and also not able to add the Team, signing certificate in Xcode. I raised the complaint to IT admin and inorder to enable the access they are asking for the URL's.. I searched but no luck .. Can you please share if you know the URL details.
Once try below this urls
appldnld.apple.com
mesu.apple.com
These are for updates and downloads of ios so i think that it should be same for mac also for appstore downloads or updates!!
And yes you can analyze network traffic as #
meaning-matters mentioned in his answer!
Reference : How to Stop iOS Software Update Notifications Reminders
Best to run a network traffic analyser on your computer and make a list of attempted accesses.
Even better, do the same from home (or wherever you have access), and list the actual URLs.
Or (in the mean time) ask/urge IT if they can open HTTPS (and HTTP) access *.apple.com/* and *.itunesconnect.com/* and see how far you get.
Good luck, this is a very annoying situation I've in too a few times.

Intercept iOS Device internet traffic with profile

I want to create an a parental-control app very similar to Onavo, other than I'm not compressing any data, I'm just storing the URL being requested and letting it go on its way.
Basically, I just want to install a profile that will tell my app anytime an internet request is made on the device (assuming my app is running in the background). This is an even simpler version than what Onavo does (intercept internet actions and reroutes them), so I know it's possible I just can't seem to find any documentation for it...
Can anyone point me in the right direciton? Google is failing me.
I'm an intermediate iOS developer. Thanks!

Air for iOS avoiding Man in the Middle attacks

In Air for iOS, I'm trying to find a way to mark when a possible Man in the Middle attack has occurred.
By default, anytime you try to connect to an SSL site that has an invalid certificate, you get the error:
"A secure connection with this site cannot be verified. Would you
still like to proceed?
The certificate you are viewing does not match the name of the site
you are trying to view."
I don't want to display this prompt, just disable network functions after that.
I started off trying to use a network monitor, but it gives the prompt as does running a separate URL request to test the connection.
I finally came across the "SecureSocketMonitor" which seems to do what I need it to do when running through the Flash environment, but once I compile into an Air for iOS application, it doesn't seem to function at all.
Does anyone know how I can detect an invalid SSL certificate without displaying that prompt?

Resources