fetch ssl keys

This commit is contained in:
iddoeldor 2021-06-19 18:43:37 +03:00 committed by GitHub
parent f7e291649a
commit e627f950c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,40 @@ Java method hook generator using keyboard shortcut
</details>
<hr />
#### Fetch SSL keys
```js
var keylog_callback = new NativeCallback(function(ssl, line) {
send(Memory.readCString(line));
}, 'void', ['pointer', 'pointer']);
if (ObjC.available) {
var CALLBACK_OFFSET = 0x2A8;
if (Memory.readDouble(Module.findExportByName('CoreFoundation', 'kCFCoreFoundationVersionNumber')) >= 1751.108) {
CALLBACK_OFFSET = 0x2B8;
}
Interceptor.attach(Module.findExportByName('libboringssl.dylib', 'SSL_CTX_set_info_callback'), {
onEnter: function (args) {
ptr(args[0]).add(CALLBACK_OFFSET).writePointer(keylog_callback);
}
});
} else if (Java.available) {
var set_keylog_callback = new NativeFunction(Module.findExportByName(Module.findBaseAddress('libssl.so'), 'SSL_CTX_set_keylog_callback'), 'void', ['pointer', 'pointer']);
Interceptor.attach(Module.findExportByName(libSSL, 'SSL_CTX_new'), {
onLeave: function(retval) {
set_keylog_callback(retval, keylog_callback);
}
});
}
```
<br>[⬆ Back to top](#table-of-contents)
#### Load CPP module
```cpp