Android reinforcement identification list: from so naming to dex features, judge first and then decide on the shelling route

Identify ZiZi/AiCrypto/360/LeGu/Yidun and other reinforcements based on observable characteristics, and then select the unpacking route based on encryption type, VM type, and extraction type, including the point of repairing dex after dumping.

After getting an APK, first determine which company is used for reinforcement, and then decide on the unshelling route. The following is organized according to "observable characteristics".

1. First look at the directory structure

Read after unpacking lib/arm64-v8a/ and assets/, most manufacturers’ so naming has strong characteristics:

Manufacturertypical so/resources
bang banglibsecexe.so、libsecmain.so、libDexHelper.so
love encryptionlibexec.so、libexecmain.so、ijiami.dat
360 reinforcementlibjiagu.so、libjiagu_art.so、libprotectClass.so
Tencent Legulibshell.so、libshella.so、libtosprotection*.so
NetEase Yidunlibnesec.so、libdk*.so
top elephantlibx3g.so、libDingXiang*.so
Alibaba Securitylibmobisec*.so、aliprotect.dat
Baidulibbaiduprotect.so、libbdprotect.so

assets/ appear in *.dat、*.bin、*.enc And the volume is close to the total amount of dex. It can basically be confirmed that dex is encrypted as a whole and external.

2. Look at dex and manifest again

bash
unzip -l app.apk | grep -E "\.dex|lib/|assets/"
aapt dump xmltree app.apk AndroidManifest.xml | grep -A2 application

feature:

  • classes.dex The size is unusually small (tens of KB), and Application points to the shell entrance (e.g. com.stub.StubApp)
  • The number of dex does not match the amount of code, or there is only a shell loader
  • extractNativeLibs、useEmbeddedDex Wait for the field to be changed

3. Runtime characteristics

bash
adb shell "cat /proc/<pid>/maps | grep -E 'rwx|anon'"
adb shell "cat /proc/<pid>/maps | grep '\.so' | awk '{print \$6}' | sort -u"
  • Big chunks appear rwx Anonymous map, usually a VM shell's interpreter
  • libart.so Relevant symbols are replaced, explained in hook DefineClass / OpenMemory
  • Thread names for shells are common JDWP、shell、protect prefix

4. Select the shelling route according to type

1. Overall encryption type (DEX external + so decryption)

Preferred memory dump: in InMemoryDexClassLoader or DefineClass Next, dump the decrypted dex starting address and length. Scan the disk to find .dat Reliable, many shells are only kept in memory.

2. VM type (instruction extraction)

The extracted method is in dex nop Or exception instructions, the real logic is explained and executed in so. This type can only be traced dynamically: break at the dispatch point of the interpreter, record the handler sequence and then restore the semantics.

3. Function extraction + anti-debugging combination

Go through anti-debugging first, and then JNI_OnLoad After grabbing the method registry, you can usually get a batch of restored function pointers.

5. Repair after dump

  • Bad checksum: Recalculate adler32 and write back header offset 8
  • map_list Offsets are messed up: Reorder by section, or use dex repair tool
  • Multi-dex merge: Note classes2.dex Reference relationship, do not decompile alone

Identifying the hardening type is only the first step. What is really time-consuming is anti-debugging and command restoration. The above only involves the structural judgment of the protection mechanism.

Yehe's avatar
野鹤Lv2UID 762778
Thanks for sharing, reply with experience
Marco's avatar
MarcoLv1UID 216006
Thanks for sharing, reply with experience

please Log in or Register an account Participate in discussions, download exclusive add-ons or unlock level posts.