yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] osd_daedalus:
AFAIK bcmon is to switch internal wifi in monitor mode if it features one of the two chipsets mentioned above.

In theory you can install a full chrooted linux distro (see Kali via Linux Deploy) and install packages to support your usb wifi device (much likely you need a POWERED usb-otg cable).

Check google about that...

"In theory" because I was working about this as I have either a powered Y usb-otg cable and a Alfa awus036nha wifi device, but I stopped for two reasons:

- I don't know which specific package to install, it is reported if you do "apt-get install kali-linux-full" will work but it's a lot of GBs and I don't have a DSL connection

- If you do that, your image file goes over 4 GB which is the limit for a file on a FAT32 filesystem, so some work must be done to create a new ext2/3/4 filesystem which is readable by device.

Tell me if this can be helpful!

Returning to bcmon:

I have downloaded the sources from google code, but.... in my coding ignorance I sense they are not completed. Is that me or effectively the GUI part is missing?
[Android Apps and Games] ruleh:
You can get the gui part by decompiling (or extracting) the .apk

It has rather interisting stuff in it.

Also I wouldn't say you need many packages for the external usb.

The most important thing you need would be a driver (preferably as a module) for the said usb chip.

Also normal usb otg cables seem to work as well.

I'm gonna give this a try soon with a rt73usb.

Also does anyone know how to get direct usb access from chroot?
[Android Apps and Games] osd_daedalus:
Many thanks! I'll check this as I can

So should be... in my case I tried to install all of Atheros firmware and driver packages, but when I try to insmod ath9k and similar, I got errors.

I have read (forgot where...) about installing thr metapackage kali-linux-full doing the trick... it is clear we would need only firmware and driver packages and maybe something little more... but I failed to indentify which packages.

That's why I raised the warning about the FAT32 limitation of 4 GB.

For little USB wifi dongles, yes. But powered cable is anyway safer to avoid excessive phone battery drain.

For what I knew (could be wrong), the distro in Linux Deploy has access to USB, as the usb device is recognized from dmesg. It should be just a matter of mount points to set for usb disks, and of firmware/driver for wifi usb devices.

Keep us updated with your experience!
[Android Apps and Games] ruleh:
I would be very interested in the error message of the ath9k.

AFAIK dmesg prints the stuff that the kernel has stored. So the kernel might know that a usb is connected (and so does android and chroot linux) but chroot has no access to it and can't modify stuff (since it[or me] just doesn't know how)

I think i have been doing this wrong the whole time but for usb drives I first mounted the usb drive in android and then mounted that path into chroot.

However I don't know how this would affect other devices such as mice and usb wfi dongles.

Also the /dev folder seems interisting.
[Android Apps and Games] sagar27691:
Where to save that 3 script files?
[Android Apps and Games] garabadz:
So pissed off

why are you all asking same questions ? here are 60 pages of the same problem .. neether one slution is not given to noone, is it so HARD TO UNDERSTAND THAT ONLY 2 CHIPSETS ARE COMAPTIBILE for now , when it grows up, it will be given to all a+of us .. is this so f*** hard to understand .. i readed all of these pages ... only 10% of all are concrete answer .. rest of is just repeating one after another mine is not working . mine is not working ... why are u even trieing to find out why is it not working ... can not elive nooone whants to write STOP ASKING QUESTIONS ALREADY ASKED .. :confused::confused::confused::confused::confused::confused::confused:
[Android Apps and Games] osd_daedalus:
I managed to rebuild a Kali chrooted distro via Linux Deploy...

This time I made a 12 GB ext2 partition on external sdcard (recognized as /dev/block/mmcblk1p2), set that as install path. I had some issues about that partition being already mounted, but I set Linux Deploy as Installation Type --> Custom and all went well: the /data/data/ru.[IdontRemember].LinuxDeploy folder was mounted in /dev/block/mmcblk1p2.

We can work again on it...

Just "no such file or directory". (insmod ath9k_htc)

lsusb seems not to see my usb device.

Many instructions are about the Alfa AWUS036H and similar (which uses RTL8187L chipsets),but mine is AWUS036NHA (AR9271), so the driver I need is ath9k_htc.

I have installed: wireless-tools, firmware-atheros.

What I think is I have only the firmware and I miss the module (ath9k_htc.ko), and I can't find instructions about. It's not also clear to me if I have to get a working module IN the chrooted environment OR outside it, in the main Android device... but then will the chrooted environment handle it changing wifi mode from managed to monitor?

edit: on a side note, I was able to deassemble the bcmon.apk, it's really interesting, much complex than I have thought, but now I can have an idea about how it works. Thanks again!

[MENTION=2936476]garabadz[/MENTION] : thanks to point that out so clearly :D

Let's say once for all, as bcmon authors said:

bcmon works ONLY for 2 chipsets because they were hardly studied and reverse engineered to run the wifi device in monitor mode

If bcmon says "cannot find firmware" "firmware value 0" or similar, your device is 99,9% of cases uncompatible

Before asking "can you support"... consider that what you ask requires knowledge in crosscompiling and reverse engineering linux kernel modules

forgetting...

if bcmon can install firmware and tools but behaves strangely, it can be due to ROM you use. It works flawlessly in my N7000 with CM 10.1, won't work in CM11 but works with some freezes on Dirty Unicorns 8.2
[Android Apps and Games] ruleh:
Progress

goal: RfA on external wifi

current state: meh

I tried compiling the module for the rt73usb which simply doesn't work with my kernel sources.

So instead i tried to compile the module (and other needed modules) using 4.0 mainline kernel sources (couldn't find better ones) which actually worked.

So here begin the first few problems

-rt73usb.ko has a few dependencies mainly narrowing down to the general networking stack (mac80211)

-mac80211.ko doesn't load because it needs somethings (symbols or functions) related to cfg80211 which are not fully present in my kernel.

-so i tried compiling cfg80211.ko which won't load (cause 4.0 mainline). Dmesg show that it is missing 2 symbols

__genl_register_family
get_net_ns_by_fd

Both are not present in my kernel (well 1 of them is but its just a dummy entry).

On top of that, since cfg80211 is directly implemented in the kernel, I suspect I will mess things up in the insertion process and get tons of segmentation faults.

Obviously I should not compile my modules using completely different source code (not because magicversion but because of what happend above)

What to do now

So there are 2 options here that I can see very clearly (some please tell me more)

--recompile the kernel to add those 2 missing symbols and maybe some other stuff that's missing

--add everything needed to the current kernel source and try to survive on modules only

Currently none of the needed modules compile on the current kernel sources (not mac80211 neither rt73usb nor any of its dependencies)

To be honest, I can't compile kernels. Every single time something fails, though mostly I am just too stupid to flash the zImages or do something with them so I want to stay away from them.

The second option seems like it will not work. I can't implement every single missing kernel feature (or even a symbol) as a module. However I will try it until someone gives me a better idea.

I could also try different kernels however or try the impossible task of running android on the 4.0 kernel.

So until I see some direction, I am sure that this will fail (at least for me)

---------- Post added at 04:46 PM ---------- Previous post was at 04:44 PM ----------

I think loading the modules from inside or outside doesn't make a difference (i always try both never noticed anything)

For the ath9k module, you need to compile it from your kernel sources. I can't do it with mine cause errors everywhere.
[Android Apps and Games] ruleh:
More progress and a few steps backwards

Seems like for some kernels the source code is perfect for compiling the modules needed for an external wifi card to work.

(Whereas for some other it is a matter of looking through 651 lines of errors just to see 5 more pop up for every 1 you get rid of)

Just enable the modules in the config files (or use menuconfig) and

make modules

so easy.

And they also load.

Problems (again):

-The only kernel for my phone for which this works is 2 years old

-The kernel for my I9100G allows this and its a new kernel (for 5.0) However my S2G has a broken screen.

-Also I can't find my OTG cable

-Looking at my now ancient wifi dongle, it seems like it will turn to dust the next time I use it

So if anyone wants to help

--name the wifi chipset you wanna use

--name the required modules (mac80211.ko is nearly always required. The rest should be dependent on the wifi chip)

--look if you need any firmwares

--get kernel source code

--enable the modules in your kernel source configs

--try to compile the modules with "make modules" (or tell me to do...I might, if you give me the kernel sources)

--insmod "name_of_module" fw_path="path_to_firmware" etc....

--try determining the wifi interface and make use of it (chroot linux could be helpfull here)

--tell us if it works (and also if it doesn't and at what stage you fail)

It is likely that you won't be able to compile the modules just like that and will get tons of errors. Then just try it with different sources.
[Android Apps and Games] ruleh:
If its undeclared functions, using another kernel or declaring them yourself are the best (and only?) options.

you might want to take a look at this http://dox.ipxe.org/structath__common.html

Another helpfull trick would be to look at kernels where the atk module compiles correctly (mainline 4.0? lol) and then just look at the differences in the source code for the module in your kernel and the working one.

From there you can just copy paste stuff over into your files. I would pay close attention to the header files because on some android kernels they are a complete mess.

As for me I finally managed to get the modules compile on a recent kernel (cm12 kernel)

However me being me, and as incompetent as always, I can't compile the kernel itself. Which is needed considering the modifications I made.

Also I need to get a new OTG cable.

Until then I will try find out what exactly is needed to get the damn mac80211.ko module working on EVERY kernel.
[Android Apps and Games] gustarballs1983:
So Finally some of You guys decided to talk about arm kali here...

I'm kind of curious because You say that after installing kali in chroot one "could" run wifi tools from inside.

I personaly was always led to belive that One needs to put some sort of drivers on the android side and crosscompile them and slipstream them into the android kernel.., but from what I understud from all of the posts above is that one can actualy use wifi tools without doing so just need to do the "install kali linux full" command in the shell. is this true?? Is all what You fight for is to fit in the 4gb limit size?! or are You trying to actually slipstream those drivers into android?

Please answer...

GusT

P.S. Oh and btw, some time ago i managed to bypass that 4GB limit size. All i did was to format the external sdcard to NTFS file system plus the chainfire's hack in the android system(this needs root) to enable write acces to external sdcard and all worked flawlessly.. Unfortuneatly likely I was too dumb to know kow to run bully or aircrack from arm kali it said something about wifi tools missing (after "install kali linux full" or whatever) and i couldn't activate monitor mode on my internal wifi card (it's chipset is detected as unknown but uses RTL8192cu driver) if You have any tips or suggestions what i should do to enable monitor mode or how to install the -ng tools or other arcrack suite tools and or reaver/bully on arm kali Your kindly asked to share the knowledge if it would indeed run without messing with kernel/rom on the android side..

regards

EDIT: typo fixes
[Android Apps and Games] ruleh:
To run the aircrack tools on a non-bcmon compatible chipset (preferably external usb), you need the firmware and a driver

Sadly the driver is bound to the kernel code.

This is a problem because most android kernels have messed up everything except what they need to function "as intended"

So what we are trying to do, is compiling the drivers and load them to make the wifi chips behave like they would do on a normal linux pc.

Maybe someone with enough time and skill could write an userspace driver, that way we would not need to mess with the kernel (well maybe a little bit).

From there you should be able to run airmon-ng to set it to monitor (cause why not) IF everything behaves like it should.

The only problem I see with chroot is access to usb devices. I never actually looked too much into it.

If your kernel is a "complete" one you might be able to compile the modules only and load them without recompiling the kernel. [VERY RARE]
[Android Apps and Games] gustarballs1983:
about the kernel I'm not so sure and i do not intend to mess with it (my manufacturer does not give out sources of the kernels)

my device came with stock root acces and it's a low end chineese brand tablet for around ~50$ so it's likely "abandon all hope"..

anyway thanks for such a quick reply.

I was looking for someone who might have time and skill for the user space driver however I failed at finding such a person mainly because of lack of free time issuses, and another guy did not even wrote me back..

so It's back to nothing.

I hope that one day such a brave finds him/herself and that he/she succeds to create such a driver.

regards

GusT
[Android Apps and Games] ruleh:
Could you explain for a sec what "THIS_MODULE" is?

But it seems like you're really close to getting the modules finished.

I think at this point we can safely ignore those warnings, just this one error needs a simple fix.

I am also really close, I should be able to compile the kernel soon and I already ordered a bunch of new OTG cables (just in case I lose 1 or 5).

I just hope that airmon-ng knows how to set that stuff into monitor mode
[Android Apps and Games] osd_daedalus:
For what I have understood, that "THIS_MODULE" is something required to build a module (don't ask me more, I'm really bad in coding :D)

I was reading here:

xdaforums.com/galaxy-note-10-1/help/problems-compiling-stock-kernel-t2899550

the OP says "To get rid off include/linux/device.h:722:38: error: 'THIS_MODULE' undeclared (first use in this function) i inserted my kernel export.h in the compat include."

And effectively, the THIS_MODULE #define thing is in include/linux/export.h.

I don't understand what that guy means for "inserted my kernel export.h in the compat include".

I have put #include <linux/export.h> in every file my compiler complains about (dmaengine.h, skbuff.h if_ether.h, netdevice.h, the compat files compat-2.6.29.h and compat-2.6.h, and the main.c in ath9k folder) but the error is always the same.

From one side I feel really close, from the other I feel android kernels have bugs left for dead in there :/

And anyway, I can't find anything else on the web, so I feel lost :(
[Android Apps and Games] ruleh:
Is "THIS_MODULE" actually declared in export.h?

If not, I think you need to get one from whereever (in this case compat?) and insert that everywhere where it is needed.

Just to add a few more bad news. Several kernel sources I had became corrupted because my laptop crashed and now I have no idea where I changed what and what is working and what isn't.

Also none of my kernels compiled the last hour before my system dropped dead. All failed at nl80211 even UNMODIFIED cm kernel.

I think my toolchains kinda died as well.

EDIT: I looked at my export.h and.....I don't even know what that is supposed to be.

#ifdef MODULE
extern struct module __this_module;
#define THIS_MODULE (&__this_module)
#else
#define THIS_MODULE ((struct module *)0)
#endif
[Android Apps and Games] ruleh:
Early Victory Cry

Sooooooo

Goal: RfA and Monitor for external Wifi cips

Current State: Promising

Well more or less.

I finally managed to compile a decent kernel with the required modules.

The most important thing is the mac80211.ko module because nearly every other module needs this.

The modules themselves seem fine.

The kernel? Lets hope for the best

If it works I should be able to boot into android as usual and load the modules at least.

I have also aquired the needed firmware (though I think it seems a bit "unusual")

So the problems

--I STILL can't find my usb otg cable (new ones on order)

--I think the kernel won't boot (cause I compiled it)

--kernel+ramdisk+me-->fail+blackscreen+redo (meaning I need to add the ramdisk somewhere)

--my usb dongle (rt73) seems like it died after I accidently stepped on it (and I don't want to find out if it actually died so I won't insert it into anything)

What now?

--wait for otg cables to arrive

--test usb wifi

--test monitor

--[if it works] make some kind of patchsets to make most kernels support mac80211 and usb wifi

--[if it does not work] cry, then continue looking at a wall of errors

Some questions from me

--how does android 5.0/5.1 behave with aircrack tools?

--Chroot usb access: Is it posible? How does it work?

--Why does my compiler just give up on stuff when I use more than one thread (aka not using -j1 everytime)

--How does android react to mac80211?

How to help

--compile compile compile->take your kernel sources (and a big chunk of your time) and compile mac80211.ko(by enabling it in configs or "make menuconfig"). Then also compile the kernel to make sure that nothing else got screwed up

--On every kernel for which it works instantly without much moddification, TELL ME and give me link to the source code.

--If it works with modification, still tell me, and also tell me the moddifications you made and why

--If it doesn't work at all, STILL tell me, and where it failed

EDIT:

THE MODULE LOADS

Yes, android booted and I could load mac80211.ko without any problems.!!!!!

So all that's left for me is to wait for the cables and try the functionality of the drivers. Scrap that, delivery will take end of next month

Instead if someone wants to try it, send me your kernel sources, a comiled kernel (such as from a rom), and some device information (of your phone and wifi chip).

I will

TRY

to make it work.
[Android Apps and Games] tommyzat:
S6 supported?

Is the S6/S6 edge supported?
[Android Apps and Games] ruleh:
No.

Only devices with the bcm4330 or bcm4329 chipset are supported.

Generally if you device is made later than 2012 don't have the said chipset.
[Android Apps and Games] edrianosantos:
my device is xt1097 of september 2014....
[Android Apps and Games] Saquib Saifee:
List of suitable devices

Can anybody me list of all bcmon suitable devices

So I can brought than one.
[Android Apps and Games] m1trand1r:
S-2 aka i9100 is one of 'em....tested by myself :)

>LG-G3<>d-855<>16Gb<>Titanium Black<
[Android Apps and Games] Saquib Saifee:
Need more devices.

Guys it's is two or there devices I need more .
[Android Apps and Games] Moon83:
AT&T S2 skyrocket I727 confirmed working.
[Android Apps and Games] vatosmacht:
Nexus 7 2012 3G tilapia 32GB 4.4.4

When some one can help me out please do.

becouse i searched the whole net 1 week long :( for CyanoGen 9 for my device but didn't find a download.

Nexus 7 2012 3g 32GB Nakasig tilapia android 4.4.4

i searched on the official site too but no luck

download.cyanogenmod.org/?device=tilapia&type=stable

Please help me here to get a download of CyanoGen 9 for my device to get it work
[Android Apps and Games] osd_daedalus:
I do not understand... are you really off topic or are you trying to male bcmon work?

Cm9 is quite old...

Besides, nexus7 should support Kali Nethunter
[Android Apps and Games] vatosmacht:
thanx for ur reply buddy :good:

but i tested Kali Nethunter and it always change Wlan to Wlan1 but i don't have an external Wlan i wan't to stay on Wlan0

thats why i search for a 100% working system for my nexus 7

when u know how to fix that problem i will flash Kali Nethunter again

or when some buddy know with which firmware rfa works perfectly for

nexus 7 3G 2012 and have a link to that firmware it will help me so much
[Android Apps and Games] Lrs121:
Kali nethunter was designed to work with an external ath9k_htc wireless card. All the tools and scripts are centered around one of those cards being connected via otg
[Android Apps and Games] ruleh:
What changes to wlan1? Your integrated wifi? Your external wifi ?

If you want it to change to wlan0 you could turn off normal wifi (from android) and see if it helps.

If you're phone is bcmon compatible (which I think it is) you could simply use the bcmon.apk to enable monitor on wlan0.

Or if you are a masochist, take the bcmon sources and compile the kernel module.
[Android Apps and Games] osd_daedalus:
I have not returned news so far... so here it is.

Thanks to the exceptional help from [MENTION=6324821]ruleh[/MENTION] I was able to compile a kernel with ath9k_htc & other modules for CM 10.1.3. They loaded, although I was not able to make my Alfa device to run.

Nothing in dmesg, nothing in iwconfig... much likely something was still missing.

Now I installed CM 12.1 (I have not waited to make the Alfa thing working because CM10.1.3 was giving me problems in the daily phone use).

What I have noticed so far is:

- the bcmon app runs but can only activate/deactivate monitor mode. Every other option will cause crash. This, IIRC, is related to the apk to be properly compiled for Lollipop, but bcmon devs never released source of the apk (maybe asking politely they could release them or compile again for android 5.x)

- Anyway, I'm quite sure if one follows the bcmon instructons "before the apk", so to recompile kernel and to use the modified firmware, it is possible to put the internal wifi in monitor mode.

-About the external wifi support, now just compiling mac80211.ko returns errors. (Personal rant: is that possible android kernels are released with errors which make module compiling such a hassle?)

Let me get used to Lollipop and I'll return investigating on this (with limitations from my little coding knowledge)
[Android Apps and Games] ruleh:
try this to get monitor mode working on lolipop

export PATH=$PATH:/data/data/com.bcmon.bcmon/files/tools
svc wifi disable
rmmod dhd
insmod /system/lib/modules/dhd.ko iface_name=wlan0 firmware_path=/data/data/com.bcmon.bcmon/files/bcm4330_sta.bcmon.bin nvram_path=/etc/wifi/nvram_cfg.txt
export LD_LIBRARY_PATH=/data/data/com.bcmon.bcmon/files/libs:$LD_LIBRARY_PATH
export LD_PRELOAD=/data/data/com.bcmon.bcmon/files/libs/libfake_driver.so
enable_bcmon

run them one by one or source it (source <filename>)

though the binaries themselves might be incompatible in which case we would have to recompile them if possible (unlikely).

[if it's PIE binary incompatibility, there is a workaround for that]

Also why are we doing modules?

I think we would have more success if we compiled the drivers inside the kernel since we need to flash new kernels anyways with all those changes to the network structure.

That way we wouldn't need to load the modules in any weird order because we won't have module dependencies.

The only use of modules would be to avoid recompiling everything while trying to get parts of driver to work.

Also cm12 kernel......it hurts.

I can't see why they did things the way they did it. It has stuff from 3 different kernel versions (which don't agree with each other) in the same stack.

Maybe for compatibility (between network stack and bcmdhd)? I don't know.