Everything is hacked.

There is no 100 % security.

Tools/Frida

Frida SSL Pinning

Kai_HT 2023. 8. 24. 09:21

 

https://blog.ctdefense.com/ca-and-bypass-ssl-pinning-protection/

BYPASS js 파일 주소 (iOS 12, iOS 13, Android) :

 

Frida CodeShare

 

codeshare.frida.re

 

Frida CodeShare

 

codeshare.frida.re

 

Frida CodeShare

 

codeshare.frida.re


  1. 해당 파일 다운로드
try {
	Module.ensureInitialized("libboringssl.dylib");
} catch(err) {
	console.log("libboringssl.dylib module not loaded. Trying to manually load it.")
	Module.load("libboringssl.dylib");	
}

var SSL_VERIFY_NONE = 0;
var ssl_set_custom_verify;
var ssl_get_psk_identity;	

ssl_set_custom_verify = new NativeFunction(
	Module.findExportByName("libboringssl.dylib", "SSL_set_custom_verify"),
	'void', ['pointer', 'int', 'pointer']
);

/* Create SSL_get_psk_identity NativeFunction 
* Function signature https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#SSL_get_psk_identity
*/
ssl_get_psk_identity = new NativeFunction(
	Module.findExportByName("libboringssl.dylib", "SSL_get_psk_identity"),
	'pointer', ['pointer']
);

/** Custom callback passed to SSL_CTX_set_custom_verify */
function custom_verify_callback_that_does_not_validate(ssl, out_alert){
	return SSL_VERIFY_NONE;
}

/** Wrap callback in NativeCallback for frida */
var ssl_verify_result_t = new NativeCallback(function (ssl, out_alert){
	custom_verify_callback_that_does_not_validate(ssl, out_alert);
},'int',['pointer','pointer']);

Interceptor.replace(ssl_set_custom_verify, new NativeCallback(function(ssl, mode, callback) {
	//  |callback| performs the certificate verification. Replace this with our custom callback
	ssl_set_custom_verify(ssl, mode, ssl_verify_result_t);
}, 'void', ['pointer', 'int', 'pointer']));

Interceptor.replace(ssl_get_psk_identity, new NativeCallback(function(ssl) {
	return "notarealPSKidentity";
}, 'pointer', ['pointer']));
	
console.log("[+] Bypass successfully loaded ");

2. frida-ps -Uai 로 디바이스 내 해당 앱의 패키지명 확인

Untitled.png

3. frida를 이용, 디바이스 버전에 맞는 js 파일을 호출하여 SSL Pinning 실행

Untitled.png

4. 해당 어플 실행 확인

Untitled.png

'Tools > Frida' 카테고리의 다른 글

FridaLab - Challenge  (0) 2023.08.30
Frida - Application Dump  (0) 2023.08.22
Frida-iOS-DUMP IPA  (0) 2023.08.22
Frida BASIC  (0) 2023.08.22
Frida ERROR - SyntaxError: unexpected character  (0) 2022.08.25