forked from CreditTone/hooker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooker
executable file
·45 lines (44 loc) · 1.75 KB
/
hooker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
HOOKER_DRIVER=$(cat .hooker_driver)
while :
do
frida-ps $HOOKER_DRIVER -ai | grep -v '@' | grep -v ' - '
echo "Enter the need to attach package."
read -p ": " package
if [[ $package = ex ]] || [[ $package = exit ]] || [[ $package = quit ]] || [[ $package = q ]]; then
break
fi
echo "It's $package that you have attached app."
python3 hooker.py -p $package -g true
echo "--------------------------------------------------"
while :
do
echo "Please enter e, s, j, c or ex command."
echo "a: Discovering activities."
echo "b: Discovering services."
echo "c: Discovering object. eg:'c {objectId}'"
echo "d: Object2Explain. eg:'d {objectId}'"
echo "v: Discovering view. eg:'v {viewId}'"
echo "e: Determines whether a class exists. eg:'e android.app.Application'"
echo "s: Discovering classes by a class'regex. eg:'s com.tencent.mm.Message.*'"
echo "t: Discovering offspring classes by a class'name. eg:'t com.tencent.mm.BasicActivity'"
echo "j: Generating hooked js. eg:'j okhttp3.Request\$Builder:build'"
echo "k: Generating hooked the string generation js with a keyword. eg:'k {YourKeyword}'"
echo "l: Generating hooked the param generation js with a param keyword. eg:'l {YourKeyword}'"
echo "m: Discovering so module."
echo "ex: Exit to the upper layer. eg:'ex'"
read -p ": " op
if [[ $op = ex ]] || [[ $op = exit ]]; then
break
fi
if [[ $op = a ]] || [[ $op = b ]]; then
python3 hooker.py -p $package -$op true
continue
fi
if [[ $op =~ ^v ]] || [[ $op =~ ^l ]] || [[ $op =~ ^c ]] || [[ $op =~ ^d ]] || [[ $op =~ ^s ]] || [[ $op =~ ^t ]] || [[ $op =~ ^e ]] || [[ $op =~ ^j ]] || [[ $op =~ ^k ]] || [[ $op =~ ^m ]] ;then
python3 hooker.py -p $package -$op
continue
fi
echo "Wronging command!"
done
done