su权限,root权限,Rootkit/Hook/Binder(Linux,Android)

> 免Root实现Android静默安装(非无障碍)- https://mp.weixin.qq.com/s/IN9ooXWqgeHhOIbaOWYmAw
免Root实现Android静默安装- https://github.com/gtf35/app_process-shell-use
最早利用app_process进程实现无 root 权限使用的开源应用(虽然已经闭源,仍然尊重并感谢 liudongmiao)Brevent -https://github.com/brevent/Brevent

 Android system log viewer on Android phone without root. - https://github.com/Zane96/Fairy
 利用app_process进程实现无 root 权限使用的优秀开源应用Android上app_process启动java进程 -https://blog.csdn.net/u010651541/article/details/53163542
 使用 app_process 来调用高权限 API -https://haruue.moe/blog/2017/08/30/call-privileged-api-with-app-process/

> AndroidRootkit一般分为应用级Rootkit和内核级Rootkit,Linux Rootkit

1. AndroidRootkit一般分为应用级Rootkit和内核级Rootkit,Linux Rootkit
  在android上捣鼓了一下linux的内核rootkit。一个完整的内核rootkit大致可分为3个部分,分别为一:自身隐藏,二:信息收集,三:系统攻击。
 安卓Rootkit开发技术要点- http://laokaddk.blog.51cto.com/368606/1153466/
 两个linux内核rootkit--之一:enyelkm- http://blog.csdn.net/dog250/article/details/5303687

2.Hook Native/Hook Java,用户API Hook/内核API Hook??
3.Binder,OpenBinder(IPC)??
4. root权限:临时Root和永久Root
  root的本质就是往 /system/bin/ 下放一个su文件,不检查调用者权限的su文件。普通程序可以调用该su来运行root权限的命令。
  android superuser白名单。Root的过程其实就是把su文件放到/system/bin/ Superuser.apk 放到system/app下面,还需要设置/system/bin/su可以让任意用户可运行,有set uid和set gid的权限。即要在android机器上运行命令:adb shell chmod 4755 /system/bin/su。而通常,厂商是不会允许我们随便这么去做的,我们就需要利用操作系统的各种漏洞,来完成这个过程。
  Superuser(root)- https://github.com/koush/Superuser  
  Superuser(root)- http://superuser.googlecode.com/svn/trunk

  简述静默安装的原理,如何在无需root权限的情况下实现静默安装?
  伪装成系统应用,这就要给app打上系统应用的签名,但是这些签名在小米等手机上是没用的。通过把应用放在system/app的目录下也可以实现。

-- 在5.1.+后获取运行中进程呢
无法卸载app(DevicePolicManager)- https://github.com/BolexLiu/SuPerApp
Example code for "How-To SU" - https://github.com/Chainfire/libsuperuser
/**
     * 判断当前手机是否有ROOT权限
     * @return
     */
    public static boolean isRoot(){
        boolean bool = false;
 
        try{
            if ((!new File("/system/bin/su").exists()) && (!new File("/system/xbin/su").exists())){
                bool = false;
            } else {
                bool = true;
            }
        } catch (Exception e) {
       
        } 
        return bool;
    }

/**
     * 应用程序运行命令获取 Root权限,设备必须已破解(获得ROOT权限)
     * @param command 命令:String apkRoot="chmod 777 "+getPackageCodePath(); RootCommand(apkRoot);
     * @return 应用程序是/否获取Root权限
     */
    public static boolean RootCommand(String command)
    {
        Process process = null;
        DataOutputStream os = null;
        try
        {
            process = Runtime.getRuntime().exec("su");
            os = new DataOutputStream(process.getOutputStream());
           
            os.writeBytes(command + "\n");
            os.flush();
            
            os.writeBytes("exit\n");
            os.flush();
            process.waitFor();
        } catch (Exception e)
        {
            Log.d("*** DEBUG ***", "ROOT REE" + e.getMessage());
            return false;
        } finally
        {
            try
            {
                if (os != null)
                {
                    os.close();
                }
                process.destroy();
            } catch (Exception e) {
            }
        }
        Log.d("*** DEBUG ***", "Root SUC ");
        return true;
    } 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值