Giter Club home page Giter Club logo

droidsslunpinning's Issues

SSLContext

博客var SSLContext_init = SSLContext.init.overload中的sslcontext是
Hookvar SSLContext = Java.use("javax.net.ssl.SSLContext");吗??

怎么使用frida来hook nativ函数的jstring返回值

#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO, "hooktest", __VA_ARGS__)
int getInt(int i)
{
    return i+99;
}

extern "C"   JNIEXPORT jstring   JNICALL Java_mi_ndk4frida_MainActivity_stringFromJNI(
        JNIEnv *env,
        jobject /* this */) {
    LOGI("[+] %d\n", getInt(2));
    return env->NewStringUTF("Hello from C++");
}

上面是示例代码,连接是这个https://xz.aliyun.com/t/2336,网上google了很多,hook native函数,都是修改返回值为int 这样的类型。那么怎么去hook NICALL Java_mi_ndk4frida_MainActivity_stringFromJNI函数修改返回值呢,其实就是修改 return env->NewStringUTF("Hello from C++"); 的值呢。

hook后 app 请求会失败

message: {'type': 'send', 'payload': 'HttpsURLConnection.setDefaultHostnameVerifier invoked'} data: None
Error: Implementation for setDefaultHostnameVerifier expected return value compatible with void
    at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:621)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/class-factory.js:598)
message: {'type': 'send', 'payload': 'Overriding SSLContext.init() with the custom TrustManager'} data: None
message: {'type': 'send', 'payload': 'HttpsURLConnection.setDefaultHostnameVerifier invoked'} data: None
Error: Implementation for setDefaultHostnameVerifier expected return value compatible with void
    at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:621)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/class-factory.js:598)
message: {'type': 'send', 'payload': 'Overriding SSLContext.init() with the custom TrustManager'} data: None
message: {'type': 'send', 'payload': 'OkHTTP 3.x check() called. Not throwing an exception.'} data: None
message: {'type': 'send', 'payload': 'OkHTTP 3.x check() called. Not throwing an exception.'} data: None
message: {'type': 'send', 'payload': 'OkHTTP 3.x check() called. Not throwing an exception.'} data: None
message: {'type': 'send', 'payload': 'OkHTTP 3.x check() called. Not throwing an exception.'} data: None
message: {'type': 'send', 'payload': 'TrustManagerImpl verifyChain called'} data: None
message: {'type': 'send', 'payload': 'OkHTTP 3.x check() called. Not throwing an exception.'} data: None
message: {'type': 'send', 'payload': 'OkHTTP 3.x check() called. Not throwing an exception.'} data: None

请问一下我运行hooks.js出现以下错误应该如何解决

E:\pychram\FridaProject>frida -U com.amahua.ompimdrt --no-pause -l hooks.js
____
/ _ | Frida 12.2.26 - A world-class dynamic instrumentation toolkit
| (| |
> _ | Commands:
/
/ |_| help -> Displays the help system
. . . . object? -> Display information about 'object'
. . . . exit/quit -> Exit
. . . .
. . . . More info at http://www.frida.re/docs/home/
Attaching...
OkHTTP 3.x Found
com.squareup.okhttp not found
Xutils hooks not Found
httpclientandroidlib Hooks not found
TrustManagerImpl verifyChain nout found below 7.0
message: {'type': 'send', 'payload': 'Custom, Empty TrustManager ready'} data: None
[Xiaomi MI 3W::com.amahua.ompimdrt]->

我安装的是你目录下的just trust me
小白不太懂 望解答

大佬,frida怎么使用getDeclaredMethod

例如有个java函数是:

public byte[] aesEncrypt(String plaintext)

我想在frida上面用js反射调用,那么

var class_name1 = "com.example.cryptutils.util.CryptoUtils";
var Platform1  = Java.use(class_name1);
var t=Java.use("java.lang.String");
var method = Platform1.class.getDeclaredMethod("aesEncrypt",XXXX);

我想问一下,xxxx这里的参数类型该如何填写呢,在java下调用我知道直接填写String.class就好了,但是在frida下各种姿势都试过了,没搞掂。

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.