飘云 发表于 2015-9-18 14:08:55

独家发布--Xcode 被植入后门(XcodeGhost)的完美清除方法

近日,乌云爆出从第三方下载的Xcode版本存在被植入后门的风险,具体请看:http://drops.wooyun.org/news/8864

我拿到几个样本发现,被植入的包存在与:Xcode6.x - Xcode7正式版之间~~ 当然连Beta版本也没放过被上传到百度网盘、迅雷等

因此,友情提醒一下:请从Apple官方下载Xcode!!

好了,下面来讲讲清除方法:

1.将/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/Library 删除
此时编译会发现报错:

ld: file not found: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/Library/Frameworks/CoreServices.framework/CoreServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)


2.打开/Applications/Xcode.app/Contents//PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/Ld.xcspec

发现有这么一段:
                {
                        Name = "ALL_OTHER_LDFLAGS";
                        Type = StringList;
                        DefaultValue = "$(LD_FLAGS) $(SECTORDER_FLAGS) $(OTHER_LDFLAGS) $(OTHER_LDFLAGS_$(variant)) $(OTHER_LDFLAGS_$(arch)) $(OTHER_LDFLAGS_$(variant)_$(arch)) $(PRODUCT_SPECIFIC_LDFLAGS) -force_load $(PLATFORM_DEVELOPER_SDK_DIR)/Library/Frameworks/CoreServices.framework/CoreServices";
                        "CommandLinePrefixFlag" = "";
                },


替换为:
                {
                        Name = "ALL_OTHER_LDFLAGS";
                        Type = StringList;
                        DefaultValue = "$(LD_FLAGS) $(SECTORDER_FLAGS) $(OTHER_LDFLAGS) $(OTHER_LDFLAGS_$(variant)) $(OTHER_LDFLAGS_$(arch)) $(OTHER_LDFLAGS_$(variant)_$(arch)) $(PRODUCT_SPECIFIC_LDFLAGS)";
                        "CommandLinePrefixFlag" = "";
                },

3.改完重启Xcode再次编译,顺利通过!!


creantan 发表于 2015-9-18 14:13:22

沙发。。。。。。

tree_fly 发表于 2015-9-18 14:27:49

赞,话说隐藏的很…,还真不容易察觉。

howardlee 发表于 2015-9-18 14:37:35

从开发工具开始加入后门,真是机智

GGLHY 发表于 2015-9-18 14:45:28

哇~~~~
好厉害

GeekCat 发表于 2015-9-18 20:16:21

魔高一尺,道高一丈
膜拜~~~

Min〆 发表于 2015-9-19 13:38:37

老大这就弄好了。。

zz100179 发表于 2015-9-19 14:12:45

膜拜了,感谢分享

beijingren 发表于 2015-9-19 18:41:57

看不懂的东西,每次过来,都是为了膜拜老大的

beijingren 发表于 2015-9-19 18:42:05

看不懂的东西,每次过来,都是为了膜拜老大的
页: [1] 2
查看完整版本: 独家发布--Xcode 被植入后门(XcodeGhost)的完美清除方法