• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Bypass module checking with insmod

Hi once again,

Sorry if this is an inappropriate area to ask my question but anyway here goes:

So, i'm a computer forensics student who's trying to explore android forensic possibilities. I have compiled a module for testing devices (i have access to a Samsung S2 and a Galaxy Nexus running 4.1 and 4.0 respectively) in which i want to insert the module into the phone (i.e. insmod module.ko).

My problem is, i'm always faced with the problem of "insmod invalid module format" everytime i try to insert the module into the phone. I know that i can correct this by reflecting the appropriate kernel version in the vermagic string when i compile my module but i wanna find a generic way to do this; in other words, i wanna find a way to bypass this kernel version checking everytime i try to insert the module.

I've come across insmod having the -f flag as stated here (this would theoretically bypass the kernel version checking and i wanna verify this theory) insmod
and i was wondering if anybody has been able to compile an android version of this executable and is kind enough to share it :D

Thank you very much for taking your time of to read this

Best Regards,
A Singaporean Student
 
The various API's and data structures used in the kernel aren't fixed. They often change from one kernel version to the next. The whole reason the version string exists is to ensure that you don't end up in a situation where the kernel thinks some data structure is 40 bytes big, but a module thinks it is 44 bytes big. In this example the module could well write beyond the end of the allocated structure and trash someone elses memory.

You are best off making sure your module is built from the correct kernel source.
 
Yes that is true; one should definitely build the module from the correct kernel source but i just want to test out this concept and see how much data am i actually losing on an average if i just "tried my luck" with a module that isn't compiled from the correct kernel source. That's part of my research; to see the feasibility of using a module that isn't compiled from a correct kernel source :)
 
Back
Top Bottom