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!


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 6 '17 at 12:36

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.