{"id":181936,"date":"2013-06-11T14:31:03","date_gmt":"2013-06-11T10:31:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=181936"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=181936","title":{"rendered":"<span class=\"post_title\">\u041d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430 iOS<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/78a\/f1b\/d06\/78af1bd0635a8804eb6d7c24bfd833bd.jpg\" align=\"right\"\/><\/p>\n<p>  \u041f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043d\u0430 Positive Hack Days \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0430 configd \u043d\u0430 MACH-\u0443\u0440\u043e\u0432\u043d\u0435 \u0432 iOS 6. \u041a\u0430\u043a \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0432 iOS \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Wi-Fi. \u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, Public API \u043d\u0435 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 SSID, BSSID \u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. \u0410 \u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f? \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430? \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Private API \u0438 Jailbreak.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0431\u0443\u0434\u0443 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u043d\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 iOS 5.*. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Darwin\/Reference\/ManPages\/man3\/asl.3.html\">Apple System Log facility<\/a>: \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u041e\u0421 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0442\u0438. \u0412 \u043d\u0438\u0445 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0410 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u043c\u044b \u0438\u0445 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"objectivec\">        aslmsg asl, message;         aslresponse searchResult;         int i;         const char *key, *val;         NSMutableArray *result_dicts = [NSMutableArray array];                  asl = asl_new(ASL_TYPE_QUERY);         if (!asl)         {             DDLogCError(@&quot;Failed creating ASL query&quot;);         }         asl_set_query(asl, &quot;Sender&quot;, &quot;kernel&quot;, ASL_QUERY_OP_EQUAL);         asl_set_query(asl, &quot;Message&quot;, &quot;AppleBCMWLAN Joined BSS:&quot;, ASL_QUERY_OP_PREFIX|ASL_QUERY_OP_EQUAL);         searchResult = asl_search(NULL, asl);         while (NULL != (message = aslresponse_next(searchResult)))         {             NSMutableDictionary *tmpDict = [NSMutableDictionary dictionary];                          for (i = 0; (NULL != (key = asl_key(message, i))); i++)             {                 NSString *keyString = [NSString stringWithUTF8String:(char *)key];                                  val = asl_get(message, key);                                  NSString *string = [NSString stringWithUTF8String:val];                 [tmpDict setObject:string forKey:keyString];             }             [result_dicts addObject:tmpDict];         }         aslresponse_free(searchResult);         asl_free(asl);  <\/code><\/pre>\n<p>  \u041d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0443 Apple, \u0443\u0437\u043d\u0430\u0432 \u043e\u0431 \u044d\u0442\u043e\u043c, \u043e\u043d\u0438 \u0437\u0430\u043a\u0440\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c \u0432 ASL. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443: \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 Mac OS \u0438 iOS?<\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"https:\/\/developer.apple.com\/library\/mac\/#documentation\/Darwin\/Reference\/ManPages\/man8\/scutil.8.html\">scutil<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c. \u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 iPhone \u0441 iOS 6 \u0438 Jailbreak \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043d\u0430 \u043d\u0435\u043c. \u0414\u043b\u044f \u043c\u043d\u044f \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u043c\u0435\u043a\u043e\u043c, \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u043d\u044b\u0439 \u043d\u0438\u0442\u044c\u044e, \u0438 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c, \u043a\u0430\u043a \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u00ab\u0434\u043e\u0442\u044f\u043d\u0443\u0442\u044c\u0441\u044f\u00bb \u0434\u043e SystemConfiguration \u043d\u0430 iOS.<\/p>\n<p>  \u041f\u0443\u0442\u044c \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0440\u043e\u0441\u0442 \u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u0435\u043d \u0434\u043e \u0431\u0435\u0437\u0443\u043c\u0438\u044f \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/developer.apple.com\/library\/mac\/#documentation\/Networking\/Reference\/SysConfig\/_index.html\">SystemConfiguration.framework<\/a>. \u0421 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430 Mac OS \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c <a href=\"http:\/\/developer.apple.com\/library\/mac\/#documentation\/CoreFoundation\/Reference\/CFPropertyListRef\/Reference\/reference.html\">property list<\/a> \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445.<\/p>\n<p>  \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b\u044b \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 iOS, \u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0433\u0440\u0443\u0441\u0442\u043d\u043e: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e.<\/p>\n<pre><code class=\"objectivec\">CFPropertyListRef SCDynamicStoreCopyValue\t\t\t( \t\t\t\t\tSCDynamicStoreRef\t\tstore, \t\t\t\t\tCFStringRef\t\t\tkey \t\t\t\t\t)\t\t\t\t__OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d.<\/p>\n<pre><code class=\"objectivec\">    void *handle = dlopen(&quot;\/System\/Library\/Frameworks\/SystemConfiguration.framework\/SystemConfiguration&quot;, RTLD_LAZY);     CFArrayRef (*_SCDynamicStoreCopyKeyList)(int store, CFStringRef pattern) = dlsym(handle, &quot;SCDynamicStoreCopyKeyList&quot;);          NSLog(@&quot;Lib handle: %u&quot;, handle);              NSString *key = @&quot;State:\/Network\/Global\/DNS&quot;;          CFArrayRef testarrray =  _SCDynamicStoreCopyKeyList(0, CFSTR(&quot;State:\/Network\/Interface\/en0\/AirPort&quot;));     NSLog(@&quot;Tested array res: %@&quot;, testarrray); <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f. \u0417\u043d\u0430\u0447\u0438\u0442, \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a, \u043a\u0440\u043e\u043c\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u0435\u0442\u0430 Apple, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0432 AppStore. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e?<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043d\u0430\u0439\u0442\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0434\u0435\u043c\u043e\u043d\u0430 <a href=\"http:\/\/www.opensource.apple.com\/source\/configd\/\">configd<\/a>. \u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0442\u0430\u0435\u0448\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"http:\/\/www.opensource.apple.com\/source\/configd\/configd-84\/SystemConfiguration.fproj\/SCDGet.c\">SCDynamicStoreCopyValue<\/a>.<\/p>\n<pre><code class=\"objectivec\">#include &quot;config.h&quot;\t\t\/* MiG generated file *\/  ...          \/* send the key & fetch the associated data from the server *\/ \tstatus = configget(storePrivate-&gt;server, \t\t\t   myKeyRef, \t\t\t   myKeyLen, \t\t\t   &xmlDataRef, \t\t\t   (int *)&xmlDataLen, \t\t\t   &newInstance, \t\t\t   (int *)&sc_status); <\/code><\/pre>\n<p>  \u041e\u043a\u0435\u0439. \u0418\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/developer.apple.com\/library\/mac\/#documentation\/Darwin\/Conceptual\/KernelProgramming\/Mach\/Mach.html\">MACH Interface Generator<\/a> \u0444\u0430\u0439\u043b\u0443. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u0435\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 MIG, \u043b\u0435\u0436\u0430\u0449\u0435\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/www.opensource.apple.com\/source\/configd\/configd-84\/SystemConfiguration.fproj\/config.defs\">\u043d\u0435\u043f\u043e\u0434\u0430\u043b\u0435\u043a\u0443<\/a>.<\/p>\n<pre><code class=\"objectivec\">routine configget\t(\tserver\t\t: mach_port_t; \t\t\t\tkey\t\t: xmlData; \t\t\t out\tdata\t\t: xmlDataOut, dealloc; \t\t\t out\tnewInstance\t: int; \t\t\t out\tstatus\t\t: int); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438 \u2014 \u043f\u0443\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u043f\u0443\u0442\u044c \u0434\u0436\u0435\u0434\u0430\u044f. \u0412\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"http:\/\/developer.apple.com\/library\/Mac\/documentation\/Darwin\/Reference\/ManPages\/man1\/mig.1.html\">mig<\/a> \u043d\u0430 \u0444\u0430\u0439\u043b config.defs \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434\u044b \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438 \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u043e\u043c \ud83d\ude42 \u0414\u0436\u0435\u0434\u0430\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432 \u0438\u0442\u043e\u0433\u0435 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Dmitry_Sklyarov\">\u0414\u0438\u043c\u0430 \u0421\u043a\u043b\u044f\u0440\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0433 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a MACH-\u043f\u043e\u0440\u0442\u0443 configd. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/p>\n<pre><code class=\"objectivec\">#define kMachPortConfigd &quot;com.apple.SystemConfiguration.configd&quot;  -(NSDictionary *)getSCdata:(NSString *)key {       if(SYSTEM_VERSION_LESS_THAN(@&quot;6.0&quot;))     {         \/\/ It does not work on iOS 5.*         return nil;     }          struct send_body {mach_msg_header_t header; int count; UInt8 *addr; CFIndex size0; int flags; NDR_record_t ndr; CFIndex size; int retB; int rcB; int f24; int f28;};      mach_port_t bootstrapport = MACH_PORT_NULL;     mach_port_t configport = MACH_PORT_NULL;     mach_msg_header_t *msg;     mach_msg_return_t msg_return;     struct send_body send_msg;     \/\/ Make request     CFDataRef  extRepr;     extRepr = CFStringCreateExternalRepresentation(NULL, (__bridge CFStringRef)(key), kCFStringEncodingUTF8, 0);          \/\/ Connect to Mach MIG port of configd     task_get_bootstrap_port(mach_task_self(), &bootstrapport);     bootstrap_look_up2(bootstrapport, kMachPortConfigd, &configport, 0, 8LL);     \/\/ Make request          send_msg.count = 1;     send_msg.addr = (UInt8*)CFDataGetBytePtr(extRepr);     send_msg.size0 = CFDataGetLength(extRepr);     send_msg.size = CFDataGetLength(extRepr);     send_msg.flags = 0x1000100u;     send_msg.ndr = NDR_record;           \/\/ Make message header          msg = &(send_msg.header);     msg-&gt;msgh_bits = 0x80001513u;     msg-&gt;msgh_remote_port = configport;     msg-&gt;msgh_local_port = mig_get_reply_port();     msg-&gt;msgh_id = 20010;     \/\/ Request server     msg_return = mach_msg(msg, 3, 0x34u, 0x44u, msg-&gt;msgh_local_port, 0, 0);     if(msg_return)     {         if (msg_return - 0x10000002u &gt;= 2 && msg_return != 0x10000010 )         {             mig_dealloc_reply_port(msg-&gt;msgh_local_port);         }         else         {             mig_put_reply_port(msg-&gt;msgh_local_port);         }     }     else if ( msg-&gt;msgh_id != 71 && msg-&gt;msgh_id == 20110 && msg-&gt;msgh_bits &lt;= -1 )     {         if ((send_msg.flags & 0xFF000000) == 0x1000000)         {             CFDataRef deserializedData = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, send_msg.addr,send_msg.size0, kCFAllocatorNull);             CFPropertyListRef proplist = CFPropertyListCreateWithData(kCFAllocatorDefault, deserializedData, kCFPropertyListImmutable, NULL, NULL);             mig_dealloc_reply_port(msg-&gt;msgh_local_port);             mach_port_deallocate(mach_task_self(), bootstrapport);             mach_port_deallocate(mach_task_self(), configport);             mach_msg_destroy(msg);             NSDictionary *property_list = (__bridge NSDictionary*)proplist;             if(proplist)                 CFRelease(proplist);             CFRelease(deserializedData);             CFRelease(extRepr);             return property_list;         }     }     mig_dealloc_reply_port(msg-&gt;msgh_local_port);     mach_port_deallocate(mach_task_self(), bootstrapport);     mach_port_deallocate(mach_task_self(), configport);     mach_msg_destroy(msg);     CFRelease(extRepr);     return nil; } <\/code><\/pre>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443 @\u00abSetup:\/Network\/Interface\/en0\/AirPort\u00bb.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0447\u0430\u0441\u0442\u044c SystemConfiguration.framework \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u044f \u043a Jailbreak \u0438\u043b\u0438 \u043d\u0435\u0437\u0430\u043a\u043e\u043d\u043d\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0427\u0442\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e, \u0432 iOS 6 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 100 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f MACH-\u043f\u043e\u0440\u0442\u043e\u0432 \u0441 \u0441\u0430\u043c\u044b\u043c\u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u0433\u0430\u0442\u0443\u044e \u043f\u043e\u0447\u0432\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u043e\u043a\u0430 \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 AppStore, \u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>   \u2014 <a href=\"https:\/\/developer.apple.com\/library\/mac\/#documentation\/Darwin\/Conceptual\/KernelProgramming\/About\/About.html\">MACH Kernel programming guide<\/a><\/p>\n<p>   \u2014 <a href=\"http:\/\/www.it-docs.net\/ddata\/781.pdf\">iOS Hackers handbook<\/a><\/p>\n<p>   \u2014 <a href=\"http:\/\/osxbook.com\">Mac OS X internals<\/a>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/pt\/blog\/181936\/\"> http:\/\/habrahabr.ru\/company\/pt\/blog\/181936\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/78a\/f1b\/d06\/78af1bd0635a8804eb6d7c24bfd833bd.jpg\" align=\"right\"\/><\/p>\n<p>  \u041f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043d\u0430 Positive Hack Days \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0430 configd \u043d\u0430 MACH-\u0443\u0440\u043e\u0432\u043d\u0435 \u0432 iOS 6. \u041a\u0430\u043a \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0432 iOS \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Wi-Fi. \u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, Public API \u043d\u0435 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 SSID, BSSID \u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. \u0410 \u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f? \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430? \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Private API \u0438 Jailbreak.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-181936","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/181936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181936"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/181936\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}