Skip to content

Commit

Permalink
Merge pull request #2 from noobpk/dev
Browse files Browse the repository at this point in the history
update 24-01-2022
  • Loading branch information
noobpk authored Jan 24, 2022
2 parents d768b3f + f7d3f92 commit dec0d30
Show file tree
Hide file tree
Showing 22 changed files with 992 additions and 22 deletions.
2 changes: 1 addition & 1 deletion frida-android-hook/core/hook.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "noobpk",
"license": "LICENSE",
"requirements": "requirements.txt",
"fristRun": true,
"fristRun": false,
"packages": {
"windows": {
"Android Debug Bridge": "https://dl.google.com/android/repository/platform-tools-latest-windows.zip"
Expand Down
22 changes: 20 additions & 2 deletions frida-android-hook/core/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,29 @@ def main():

elif options.listscripts:
path = APP_FRIDA_SCRIPTS
description_pattern = " * Description:"
mode_pattern = " * Mode:"
version_pattern = " * Version:"

if os.path.exists(path):
logger.info('[*] List All Scripts: ')
for file_name in os.listdir(path):
print("# Frida scripts for Android app testing")
print(" ")
files = os.listdir(path)
sorted_files = sorted(files)
i = 0
for file_name in sorted_files:
if fnmatch.fnmatch(file_name, '*.js'):
print('[*] ' + file_name)
i +=1
f = open(path+file_name, "r")
for line in f:
if re.search(description_pattern, line):
description = re.sub(r'\n', '', line[16:])
if re.search(mode_pattern, line):
mode = re.sub('\s+', '', line[9:])
if re.search(version_pattern, line):
version = re.sub('\s+', '', line[12:])
print('|%d|%s|%s|%s|%s|' % (i, mode, file_name, description, version))
else:
logger.error('[?] Path frida-script not exists!')

Expand Down
39 changes: 21 additions & 18 deletions frida-android-hook/frida-scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# Frida scripts for Android app testing

|N|Spawn/Attach|Script Name| Script Description|
|:---|:---|:---|:---|
|1|S+A|android-logcat.js||
|2|S+A|call-method-of-class.js||
|3|S+A|hook-method-of-class.js||
|4|S+A|show-all-classes-methods.js||
|5|S+A|show-all-classes.js||
|6|S+A|show-specific-class-methods.js||
|7|S+A|raptor_frida_android_bypass.js||
|8|S+A|raptor_frida_android_debug.js||
|9|S+A|raptor_frida_android_findClass1.js||
|10|S+A|raptor_frida_android_findClass2.js||
|11|S+A|raptor_frida_android_lowlevel.js||
|12|S+A|raptor_frida_android_enum.js||
|13|S+A|raptor_frida_android_trace.js||
|14|S+A|show-module-exported-functions.js||
|15|S+A|show-module-exports.js||
|16|S+A|android-intercrpts-crypto.js||
|N|Spawn/Attach|Script Name| Script Description|Script Version|
|:---|:---|:---|:---|:---|
|1|S+A|android-intercepts-crypto.js|Android Intercepts Crypto Operations|1.0|
|2|S+A|android-logcat.js|Android logcat capture|1.0|
|3|S+A|call-method-of-class.js|Call method of class|1.0|
|4|S+A|dupDex.js|dupDex|1.0|
|5|S+A|fingerprint-bypass-via-exception-handling.js|Fingerprint bypass via Exception Handling.|1.0|
|6|S+A|fingerprint-bypass.js|Fingerprint bypass|1.0|
|7|S+A|hook-method-of-class.js|Hook method of class|1.0|
|8|S|raptor_frida_android_bypass.js|Raptor frida android bypass|1.0|
|9|S|raptor_frida_android_debug.js|Raptor frida android debug|1.0|
|10|S|raptor_frida_android_enum.js|Raptor frida android enum|1.0|
|11|S|raptor_frida_android_findClass1.js|Raptor frida android findclass 1|1.0|
|12|S|raptor_frida_android_findClass2.js|Raptor frida android findclass 2|1.0|
|13|S|raptor_frida_android_lowlevel.js|Raptor frida android low level |1.0|
|14|S|raptor_frida_android_trace.js|Raptor frida android trace|1.0|
|15|S+A|show-all-classes-methods.js|Show all class name and method|1.0|
|16|S+A|show-all-classes.js|Show all class name|1.0|
|17|S+A|show-module-exported-functions.js|Show module exported function|1.0|
|18|S+A|show-modules-exports.js|Show modules exports|1.0|
|19|S+A|show-specific-class-methods.js|Show specific class and method|1.0|

## Credit

Expand Down
6 changes: 6 additions & 0 deletions frida-android-hook/frida-scripts/android-intercepts-crypto.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* Description: Android Intercepts Crypto Operations
* Mode: S+A
* Version: 1.0
* Credit: https://codeshare.frida.re/@fadeevab/intercept-android-apk-crypto-operations/
* Author: @fadeevab
*/
/*************************************************************************************
* Name: Intercepts Crypto Operations
* OS: Android
Expand Down
142 changes: 142 additions & 0 deletions frida-android-hook/frida-scripts/android-logcat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/* Description: Android logcat capture
* Mode: S+A
* Version: 1.0
* Credit: https://github.com/interference-security/frida-scripts/tree/master/android
* Author: @interference-security
*/
Java.perform(function() {
var class_name = Java.use("android.util.Log");
//isLoggable
class_name.isLoggable.overload("java.lang.String", "int").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " isLoggable was called:")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
//DEBUG
class_name.d.overload("java.lang.String", "java.lang.String").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " DEBUG (d):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.d.overload("java.lang.String", "java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2, arg3) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " DEBUG (d):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
console.log("\targ3 : " + arg3.toString())
return true;
}
//ERROR
class_name.e.overload("java.lang.String", "java.lang.String").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " ERROR (e):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.e.overload("java.lang.String", "java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2, arg3) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " ERROR (e):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
console.log("\targ3 : " + arg3.toString())
return true;
}
//INFO
class_name.i.overload("java.lang.String", "java.lang.String").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " INFO (i):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.i.overload("java.lang.String", "java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2, arg3) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " INFO (i):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
console.log("\targ3 : " + arg3.toString())
return true;
}
//VERBOSE
class_name.v.overload("java.lang.String", "java.lang.String").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " VERBOSE (v):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.v.overload("java.lang.String", "java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2, arg3) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " VERBOSE (v):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
console.log("\targ3 : " + arg3.toString())
return true;
}
//WARNING
class_name.w.overload("java.lang.String", "java.lang.String").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " WARNING (w):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.w.overload("java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " WARNING (w):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.w.overload("java.lang.String", "java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2, arg3) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " WARNING (w):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
console.log("\targ3 : " + arg3.toString())
return true;
}
//What a Terrible Failure (WTF)
class_name.wtf.overload("java.lang.String", "java.lang.String").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " WTF (wtf):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.wtf.overload("java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " WTF (wtf):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
return true;
}
class_name.wtf.overload("java.lang.String", "java.lang.String", "java.lang.Throwable").implementation = function (arg1, arg2, arg3) {
var today = new Date()
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
console.log("[*] " + time + " WTF (wtf):")
console.log("\targ1 : " + arg1.toString())
console.log("\targ2 : " + arg2.toString())
console.log("\targ3 : " + arg3.toString())
return true;
}
});
7 changes: 6 additions & 1 deletion frida-android-hook/frida-scripts/call-method-of-class.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//Source: https://11x256.github.io/Frida-hooking-android-part-2/
/* Description: Call method of class
* Mode: S+A
* Version: 1.0
* Credit: https://11x256.github.io/Frida-hooking-android-part-2/ & https://github.com/interference-security/frida-scripts/tree/master/android
* Author: @interference-security
*/

//Update fully qualified activity class name here
Java.choose("com.example.app.activity_class_name" , {
Expand Down
6 changes: 6 additions & 0 deletions frida-android-hook/frida-scripts/dupDex.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* Description: dupDex
* Mode: S+A
* Version: 1.0
* Credit:
* Author:
*/
'use strict';
//Android O:
//ARM32/64: _ZN3art7DexFile10OpenCommonEPKhjRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEjPKNS_10OatDexFileEbbPS9_PNS0_12VerifyResultE
Expand Down
Loading

0 comments on commit dec0d30

Please sign in to comment.