Skip to content

Commit 7d0395f

Browse files
committed
how to enum android contents
1 parent 3f7fa08 commit 7d0395f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

android_content.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Prepare:
4+
# 1. Smartphone or Android Lab
5+
# 2. Install adb tools
6+
# 3. Connect to android lab with adb tools
7+
8+
# ## How to view android content ?
9+
10+
# $ adb install catch.apk
11+
# $ adb shell pm path com.threebanana.notes
12+
# $ adb pull /path/to/catch.apk .
13+
# $ apktool d catch.apk
14+
# $ grep -Rih -o "content://[^\"]*" ./ | sort -u
15+
# $ adb shell content query --uri 'content://xxx/xxx/xxx'
16+
17+
apkfile=$1
18+
19+
if [ -z "$apkfile" ]; then
20+
echo -e "[*] Usage: $0 <apkfile>"
21+
exit 0
22+
fi
23+
24+
echo "[*] apktool decode <$apkfile>"
25+
apktool d "$1" -o output/
26+
27+
echo "[*] enum all content strings"
28+
contents=$(grep -Rih -o "content://[^\"]*" ./output/ | sort -u)
29+
for content in $contents; do
30+
echo -e "\n[*] Enum <$content>"
31+
adb shell content query --uri "$content"
32+
done

0 commit comments

Comments
 (0)