iOS UIActivity Sharing

iOS UIActivity Sharing

Support HackTricks

UIActivity Sharing Simplified

Od iOS 6, aplikacje innych firm mogą udostępniać dane takie jak tekst, adresy URL lub obrazy za pomocą mechanizmów takich jak AirDrop, jak opisano w przewodniku Apple Inter-App Communication guide. Ta funkcja manifestuje się poprzez systemowy arkusz aktywności udostępniania, który pojawia się po interakcji z przyciskiem "Udostępnij".

Kompleksowa lista wszystkich wbudowanych opcji udostępniania jest dostępna w UIActivity.ActivityType. Programiści mogą zdecydować się na wykluczenie określonych opcji udostępniania, jeśli uznają je za nieodpowiednie dla swojej aplikacji.

Jak udostępniać dane

Należy zwrócić uwagę na:

  • Charakter danych, które są udostępniane.

  • Włączenie niestandardowych aktywności.

  • Wykluczenie niektórych typów aktywności.

Udostępnianie jest ułatwione poprzez utworzenie UIActivityViewController, do którego przekazywane są elementy przeznaczone do udostępnienia. Osiąga się to poprzez wywołanie:

$ rabin2 -zq Telegram\ X.app/Telegram\ X | grep -i activityItems
0x1000df034 45 44 initWithActivityItems:applicationActivities:

Developers should scrutinize the UIActivityViewController for the activities and custom activities it's initialized with, as well as any specified excludedActivityTypes.

Jak Otrzymać Dane

The following aspects are crucial when receiving data:

  • The declaration of custom document types.

  • The specification of document types the app can open.

  • The verification of the integrity of the received data.

Without access to the source code, one can still inspect the Info.plist for keys like UTExportedTypeDeclarations, UTImportedTypeDeclarations, and CFBundleDocumentTypes to understand the types of documents an app can handle and declare.

A succinct guide on these keys is available on Stackoverflow, highlighting the importance of defining and importing UTIs for system-wide recognition and associating document types with your app for integration in the "Open With" dialogue.

Dynamic Testing Approach

To test wysyłanie aktywności, one could:

  • Hook into the init(activityItems:applicationActivities:) method to capture the items and activities being shared.

  • Identify excluded activities by intercepting the excludedActivityTypes property.

For otrzymywanie elementów, it involves:

  • Sharing a file with the app from another source (e.g., AirDrop, email) that prompts the "Open with..." dialogue.

  • Hooking application:openURL:options: among other methods identified during static analysis to observe the app's response.

  • Employing malformed files or fuzzing techniques to evaluate the app's robustness.

References

Support HackTricks

Last updated