Author Topic: [WIP] Enabling Wireless Driver Modules for an Android Device via USB OTG  (Read 4312 times)

0 Members and 1 Guest are viewing this topic.

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Preface:

This guide is by no means all inclusive or for experienced developers. Anyone with the capacity to read and learn can accomplish this. However you will need to know basic linux commands and syntax. I also did a few weeks of research on this topic, not just for Android development but linux in general.

Disclaimer:

I am not responsible for any damage you may or may not do with your device. You will be compiling and flashing your own created kernel, you accept any risks. This can also be done with any device, not just the one that I will be listing, but use your common sense.

Sources:

There are many sources that I used to learn this knowledge, and I recommend you reading through it all as well. it will give you a better understanding + good reads to increase your knowledge

maxters (maxters.net)
http://www.maxters.net

thewadegeek (XDA-Developers):
http://forum-xda-developers.com/showthread.php?t=1748297

nixCraft (cyberciti.biz)
http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html
http://www.cyberciti.biz/faq/add-remove-list-linux-kernel-modules/

linuxtopia (linuxtopia.com)
http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch08.html

XDA University (xda-university.com)
http://xda-university.com/as-a-developer/getting-started-building-a-kernel-from-source (Droidzone)
http://xda-university.com/as-a-developer/adding-features-to-your-kernel

Kernel Modules and Device Drivers
www.intellimetrix.us/download/Abbott_Book_CH7.pdf‎

Google (source.android.com)
http://source.android.com/source/building-kernels.html

Introduction:

In order to get your Android Smartphone into a wireless pentesting device the easiest route would be to enable a USB OTG cable to work with your favorite wireless USB device. To accomplish this we need to compile and enable the driver in the kernel, and then flash your new kernel with the module of the compiled wireless drivers. For this demonstration I will be using a Verizon Variant Samsung Galaxy S4 with the Stock "TouchWiz" kernel. However instead of using the stock, I will be using a developed kernel that is already auto "loki'd" which is how it bypasses the locked bootloader. You can start with whichever kernel you would like.

Prerequisites:

  • Kernel
  • Android NDK (or a linux ARM toolchain, Linearo offers a good one)
  • Linux Operating system (For this guide I will be using Ubuntu 12.04 LTS)
Ok so now you have your Operating system, your kernel and your toolchain, so now lets get everything you need to config and compile.

Dependencies (Ubuntu 12.04 LTS Specific):

Code: [Select]
sudo add-apt-repository ppa:nilarimogard/webupd8
Code: [Select]
sudo apt-get update
Code: [Select]
sudo apt-get install git android-tools-adb android-tools-fastboot build-essential gnupg flex bison gperf zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev gcc-multilib libx11-dev:i386 libreadline6-dev:i386 libglapi-mesa:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev libgl1-mesa-dri:i386 g++-multilib tofrodos libxml2-utils xsltproc zlib1g-dev:i386
Code: [Select]
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Congrats! Your build environment is now set up and you can work on adding the wireless driver to your kernel that you choose. In my case I will be doing ath9k.

Compiling Your Module:

....to be continue
« Last Edit: June 03, 2013, 05:03:03 am by DeepCopy »
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
reserved for future possible future updates
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
https://github.com/TheMuppets/ Most useful thing i ever needed in my build environment :P because when i extracted the propretary blobs from the GS3 myself the baseband/ril did not work.
~Factionwars

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
https://github.com/TheMuppets/ Most useful thing i ever needed in my build environment :P because when i extracted the propretary blobs from the GS3 myself the baseband/ril did not work.


thanks ;-)


I ran into an issue trying to compile the wifi module, couldnt get it to build... I'll post up my makefile because I cant figure out what im doing wrong...


Reminder to self: add qdevelop to dependencies (make xconfig)


btw this post is a learning experiance for myself as well ^_^
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry