6

During the security assessment of Android applications, I have encountered multiple instances where .so (Shared Objects) files are present in lib directory. What can be possible security test cases for the same.

I have one test case, i.e. Insecure Compilation Options of ELF file. But I have no idea how to check the compilation options of the same, for example missing -fstack-protector, PIE etc.

Thanks in advance!

Shiv Sahni
  • 921
  • 8
  • 16

2 Answers2

1

To determine if stack-smashing detection has been compiled into the binary, after decompilation with apktool, your shared object libraries as you know can be located in <apktool_outdir>/lib/<arch>

cd <lib_dir>

for o in $(ls); do echo -e "\n\n$o:" && strings $o | grep stack_chk; done

  • Thanks for the comment. Can you please elaborate what this command is doing or share a good read regarding the same. – Shiv Sahni Oct 06 '17 at 12:36
0

After a good research on Android Internals and Secure Code Development, I have identified the answer to this question.

We can use checksec.sh script to check the compilation options of an executable file. The script can be easily found from the following github repo: https://github.com/slimm609/checksec.sh

Shiv Sahni
  • 921
  • 8
  • 16