Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the user agent string for iOS / MacOS iMessage?

I'm parsing s3 logs to identify requests made from iMessage previews (on Mac OS Sierra & iOS 10).

There are few common types of UA strings, but I can't tell which are from the browser vs. imessage. I'm hoping it's a unique UA from Safari:

  1. `AppleCoreMedia/1.0.0.14B100 (iPhone; U; CPU OS 10_1_1 like Mac OS X; en_us)

^ Gotta be iOS Safari, right?

2.MobileSMS/1.0 CFNetwork/808.1.4 Darwin/16.1.0`

^ I think MobileSMS means imessage (hopefully)

  1. Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.1.32 (KHTML, like Gecko) Mobile/14B100 Twitter for iPhone

^ Twitter via webkit webview?

  1. Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/54.0.2840.91 Mobile/14B100 Safari/602.1

^ more iOS Chrome (i see you CriOS)

  1. Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B100 Safari/602.1

^ more iOS Chrome?

  1. Twitter/5002568 CFNetwork/760.6.3 Darwin/15.6.0 (x86_64)

^ Twitter

like image 333
nealrs Avatar asked Jan 06 '17 05:01

nealrs


People also ask

What is Iphone user agent string?

The User-Agent (UA) string is contained in the HTTP headers and is intended to identify devices requesting online content. The User-Agent string tells the server what the visiting device is (among many other things) and this information can be used to determine what content to return.

How do I find user agent on Mac?

With the preferences open, click on the “Advanced” tab. At the very bottom, you want to check the box next to “Show Develop menu in the menu bar” and then exit out of the preferences. Now Safari will have a new menu devoted solely to development tools. The “User Agent” menu is at the top.

Is there an iMessage web client?

You'd think Apple would have an online browser-based service for iMessage, so checking in no matter where we are is easy. But alas, there currently is no service for getting iMessages online! The conventional thought is that Apple wants to keep its services limited to its own iDevices and Mac computers.


2 Answers

I've just faced the same issue while trying to re-route the iMessage crawler to a non-angular page which will generate the correct meta tags for it and found this question in the process. Figured I'd write an answer since I've now found it. Apple's documentation says nothing but mention the ...(Applebot/x.x) User-Agent which is not the correct one. I've found nothing on the internet so I logged traffic to just one file on a public server and shared the link via iMessage. In the log file I received:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0

When I've modified my RegEx to fit this User-Agent, the iMessage crawler was finally re-routed to the correct location.

So there it is, it's probably subject to change without notice since it does not exist in any official Apple documentation as far as I can tell but I hope this still helps someone :)

like image 197
SimpleAnecdote Avatar answered Oct 14 '22 16:10

SimpleAnecdote


Use this regex to identify requests from IMsg crawlers.

(Twitterbot(.*)facebookexternalhit)|(facebookexternalhit(.*)Twitterbot)

I have tested it and it works perfectly.

like image 25
Shwetabh Shekhar Avatar answered Oct 14 '22 14:10

Shwetabh Shekhar