Giter Site home page Giter Site logo

me.jsonet.jshook's Introduction

JsHook

Xposed GitHub release Telegram Telegram

用js实现hook 支持java层和native层

README of English

关于

jshook是对应用程序注入rhino/frida,你只需要会js就可以快速实现hook,并且支持java层和native层。

rhino包含了xposed的api,主要用于java层的hook;frida注入后js可以完全访问内存,支持java层和native层。

兼容

  1. Xposed api 82
  2. Android 5 - 14

全新1.1版本

image image

me.jsonet.jshook's People

Contributors

etjson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

me.jsonet.jshook's Issues

日志显示异常

日志里面只显示了start hook XXXXXXXXX,没有显示hook后的console.log内容,在电脑上这段hook代码是正常的

非常有创意

表达感谢和钦佩之情,这样很多人都可以hook了。希望再多一些简易的教程,我再学习。

请教一个问题

无root模式下,jshook是通过复制对应so到目标私有目录,然后调用load加载,但为什么我用Lspatch手动编写模块复刻该行为加载frida官方的gadget的so,却会闪退,于是我load jshook复制的so却可以,jshook的so是修改过的吗还是我的步骤有点问题,向请教一下。

模块日志无法查看

Screenshot_2022-12-10-07-31-44-49_3433fe67667f0a4b1cd77e470afeb6d9
magisk有安装,请问还需要什么模块
在应用列表大部分应用显示“冻结”,也提示需要magisk模块

http模块报错

使用http模块案例,报错信息如下:JavaScript exception: JavaException: java.lang.ClassCastException: ʿʽˈˊˎʾˈ$ʻˎʻˆ cannot be cast to java.lang.Comparable

下载失败

框架显示未连接请提供下载入口或内置框架
在github最新的frida找到so文件导入后无法使用

1.0.20版本无效

新版本的无效,装任何脚本都无效,日志也没有,回退其他版本就没问题。

missing ; before statement (JsEngine#178)

试了几个脚本注入各种应用都打印这个错误,请问这个怎么解决呢?
完整log:
[2022-10-19 16:43:05]: app: com.mimikko.mimikkoui start hook is rhino
[2022-10-19 16:43:05]: app: com.mimikko.mimikkoui get js frida简单脚本例子.js,rhino简单脚本例子.js
[2022-10-19 16:43:05]: app: com.mimikko.mimikkoui rhino run
[2022-10-19 16:43:05]: app: com.mimikko.mimikkoui rhino eroor: missing ; before statement (JsEngine#178)

调用系统 API 不成功

这个问题可能不属于 jshook 问题。
我有个想法是在打开 ykDroid 的时候如果没开 NFC 就自动打开 NFC,代码如下:

common.hookMethod('net.pp3345.ykdroid.ChallengeResponseActivity','onCreate',['android.os.Bundle'], function(param){
    }, function(param){
    var ctx = common.getcontext()
    var mgr = (android.nfc.NfcManager)(common.callMethod(ctx, 'getSystemService', ['nfc']))
    var adapter = common.callMethod(mgr, 'getDefaultAdapter', [])
    //var adapter = common.callStaticMethod('android.nfc.NfcAdapter', 'getDefaultAdapter', [common.getcontext()])
    var enabled = common.callMethod(adapter, 'isEnabled', [])
    
    if(enabled === java.lang.Boolean.valueOf('true')) {
        common.log('enabled')
    } else {
        common.log('disabled')
        //common.callMethod(adapter, 'enable', [])
        var obj = common.callMethod(adapter, 'getClass', [])
        var method = common.callMethod(obj, 'getDeclaredMethod', ['enable'])
        common.callMethod(method, 'invoke', [adapter])
    }
});

日志在打印 disabled 之后,出现的是 ...eroor:null,总是不成功,请问该如何做?

兼容问题

为啥我小米安卓10系统 用自己原生frida 没问题 用你这个提示CPU 啥的不支持 推荐使用rhino

改进

手机大部分是arm64,似乎不行呢

Installation Issue of JShook Magisk Module

I am facing an issue while trying to install JShook Magisk Module on my Android device. After installation, zygisk stopped or conflicted, causing zygisk to fail to run.

Screenshot_20230416-005425_Magisk
Screenshot_20230416-005420_Magisk

crypto中加解密相关api的使用疑问

  • encrypt函数无法与decrypt函数自洽,如下代码将会报错。
const encrypt = crypto.encrypt("abcdefghijklmnop", "123", CRYPTO_AES, "AES/CBC/PKCS5Padding");
console.log(`encrypt = ${encrypt}`);

const decrypt = crypto.decrypt("abcdefghijklmnop", encrypt, CRYPTO_AES, "AES/CBC/PKCS5Padding");
console.log(`decrypt = ${decrypt}`);
encrypt = UtfTTy9RVgrhwzxMrAauQg==
JavaScript exception: JavaException: java.lang.NullPointerException: decryptAES(EncodeUtils.b…(), transformation, null) must not be null
  • encryptBytes函数无法与decryptBytes函数自洽,如下代码将会报错。
const encryptBytes = crypto.encryptBytes([0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70], [0x31,0x32,0x33], CRYPTO_AES, "AES/CBC/PKCS5Padding");
console.log(`encryptBytes = ${encryptBytes}`);

const decryptBytes = crypto.decryptBytes([0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70], encryptBytes, CRYPTO_AES, "AES/CBC/PKCS5Padding");
console.log(`decryptBytes = ${decryptBytes}`);
encryptBytes = [B@56effe6
JavaScript exception: JavaException: java.lang.NullPointerException: {
                Encryp…tion, null)
            } must not be null

在aes和des加密时,如果使用CBC或其他需要iv的操作,为什么不需要传入iv,jshook提供的这个方法默认iv是什么,是否应当提供一个iv传参?


rc4EncryptBytes函数无法与rc4DecryptBytes函数自洽,如下代码无法还原数据。且测试二次加密/二次解密无法实现RC4的对合性。是否是函数实现存在问题?

const rc4EncryptBytes = crypto.rc4EncryptBytes([0x61,0x62,0x63,0x64,0x65,0x66], [0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38]);
console.log(`rc4EncryptBytes = ${rc4EncryptBytes.map(v => v)}`);

const rc4DecryptBytes = crypto.rc4DecryptBytes([0x61,0x62,0x63,0x64,0x65,0x66], rc4EncryptBytes);
console.log(`rc4DecryptBytes = ${rc4DecryptBytes.map(v => v)}`);

const rc4EncryptBytesAgain = crypto.rc4EncryptBytes([0x61,0x62,0x63,0x64,0x65,0x66], rc4EncryptBytes); // RC4有对合性,理论上可以通过二次加密还原内容
console.log(`rc4EncryptBytesAgain = ${rc4EncryptBytesAgain.map(v => v)}`);

const rc4DecryptBytesAgain = crypto.rc4DecryptBytes([0x61,0x62,0x63,0x64,0x65,0x66], rc4DecryptBytes); // RC4有对合性,理论上可以通过二次解密还原内容
console.log(`rc4DecryptBytesAgain = ${rc4DecryptBytesAgain.map(v => v)}`);
rc4EncryptBytes = 50,32,-17,-115,31,50
rc4DecryptBytes = 34,-46,-6,44,33,-124
rc4EncryptBytesAgain = 60,-97,119,-70,94,-5
JavaScript exception: JavaException: java.lang.IllegalArgumentException: key must be between 1 and 256 bytes

hook返回特殊类型怎样接收数据

例如:
common.hookAllMethods('java.security.KeyStore', 'getCertificateChain', function (param) {
common.toast(param.getResult());
});
这里返回类型为Certificate[]类型怎样接收这个数据?
多次实验发现param.getResult() -->null
但实际debug发现不为null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.