Launching tcpdump on Android 6.0.1 - IDEs, Libraries, & Programming Tools

Hi!!
I´m trying to run tcpdump on some android devices (nexus 6 with android 6.0.1 and nexus 4 with android 5.1.1) and I´m having some troubles with it. I´m working on /data/local/tmp to run the executable (using adb), but I keep having this problem when I run the executable: "tmp-mksh: tcpdump: not found".
NOTE: I´m using this command in adb as root: "tcpdump -l -i wlan0 > /data/local/tmp/out.pcap"
I have read some others questions about this, even I have compiled myself tcpdump code, but I have the same problem with that executable and the one I can download at the site of tcpdump android. Also, I have tried it on a Samsung S4 with android 4, and it works fine. Is it some known issue about tcpdump an last version of android?
Thanks a lot!

Related

[KERNEL] adb "cannot run as root in production builds" fix

Discovering "adb shell" gave joy, experiencing the shell as minimal bash with awful line handling (backspace and command recall) gave annoyance, experiencing "adb root" refusing access gave frustration.
After some tracking, it turns out that adbd behaviour is determined by the property "ro.debuggable" which is set during system init. The initial value is located in the file "/default.prop". In JP6 it is set to 0 resulting is adbd refusing access. However, set to 1, "adbd root" will give the much better response of "restarting adbd as root".
Once set, the property value cannot be changed. To get this fixed you need to change the contents of the file default.prop which is located in the initial ramdisk image.
Optionally, you can put a replacement shell in /sbin of in ramdisk image so that when connected "exec bash" will make things more relaxing. I attached the version I am using, which is statically linked with ncurses/readline.
There is also a simple patch to unlock adbd if you dislike opening and rebuilding the ramdisk image. However, you do need binoffset which is located in the scripts directory of the linux source tree.
Code:
ofs=`scripts/binoffset initramfs.cpio \`echo -n 'debuggable=0' | od -t u1 -An\` 2>/dev/null`
echo 'debuggable=1' | dd bs=1 seek=$ofs conv=notrunc of=initramfs.cpio
Thanks...any help though?
Hi....thanks for the fix....could you point me to a decent howto on editting the initial ramdisk?
Thanks
M
it doesn't sound simple
i will try to figure that one out ...
Dear Hexabit,
I know it's an old topic.
But do you know how can I use this Fix on a windows 7?
tried searching for binoffset software/script..couldn't find anything
I have a Flytouch 3 tablet, rooted(Z4) with terminal emulator and root explorer.
is there a way to use you bash.rar to unlock adb access?
thanks for the help
doekoe87 said:
Dear Hexabit,
I know it's an old topic.
But do you know how can I use this Fix on a windows 7?
tried searching for binoffset software/script..couldn't find anything
I have a Flytouch 3 tablet, rooted(Z4) with terminal emulator and root explorer.
is there a way to use you bash.rar to unlock adb access?
thanks for the help
Click to expand...
Click to collapse
you have to split the kernel, then decompile the ramdisk and edit default.prop and change ro.debuggable to 1, then recompile and flash
confuse but giving me a clue
I use unpackbootimg in my ubuntu pc.
The adb root works not properly after set debuggable=1.
When I saw your thread that told the adbd should be unlocked too, then I replace the adbd with a unlocked one. It works!
Thanks for your help.
I am sorry but I don't understand how to use the file.
teoking said:
I use unpackbootimg in my ubuntu pc.
The adb root works not properly after set debuggable=1.
When I saw your thread that told the adbd should be unlocked too, then I replace the adbd with a unlocked one. It works!
Thanks for your help.
Click to expand...
Click to collapse
Hi,
I can upload nothing to my root catalog of my phone.
So how could I use the adbd file in this case?
Phone is rooted but I have a problem with adb root command like subject of this topic is.
Can u help me with the process because I kept the file in /sbin but still it's not working.
Active system
Sent from my SM-G900T3 using Tapatalk

[Q] Rooting my T-Mobile G2 with Ubuntu

First of all, I have the T-Mobile G2 with the Gingerbread OTA update. I am running Ubuntu 11.10 on a netbook. I have tried to follow the instructions for rooting my phone, but I am getting stuck trying to install the Google USB driver in the SDK manager. Any suggestions on how to get past this roadblock?
mrfilbert said:
First of all, I have the T-Mobile G2 with the Gingerbread OTA update. I am running Ubuntu 11.10 on a netbook. I have tried to follow the instructions for rooting my phone, but I am getting stuck trying to install the Google USB driver in the SDK manager. Any suggestions on how to get past this roadblock?
Click to expand...
Click to collapse
no need for usb drivers in linux
you have to be sure that you are su on your pc... (i have fedora)
i think ubunto it´s sudo, isn´t it?
and before you can see your device through adb you have to type "./adb kill-server" and then "./adb start-server"
... then "./adb devices" and so on
Thanks. I tried ./adb devices and it gave me the following:
List of devices attached
???????????? no permissions
???????????? no permissions
Since I do not see a serial number, do I need to re-install something?
mrfilbert said:
Thanks. I tried ./adb devices and it gave me the following:
List of devices attached
???????????? no permissions
???????????? no permissions
Since I do not see a serial number, do I need to re-install something?
Click to expand...
Click to collapse
no that happens because you are not root on your pc...
in fedora i have to do the following to see my device:
su (enter)
then enter password
i get this symbol: # = means i´m root on my pc
then i go to my platform-tools directory (cd whatever)
./adb kill-server
./adb start-server
./adb devices ...now you should see your device
then start the rooting procedure, good luck
Use 'sudo su' in ubuntu to get a root prompt.
otherwise you have to set a 51-android.rules file (instructions here http://developer.android.com/guide/developing/device.html)
-Nipqer

[MODDING] [TOOL] Fastboot binary for ARM machines (root required)

Following the "if you didn't make it, it doesn't belong here (in the development section)" guideline, I'm posting this in General. If a mod thinks this fits better in development, feel free to move it.
What this is: A fastboot executable binary for using the fastboot protocol to control other devices which supports fastboot, like the Galaxy Nexus or other Nexus-phones.
What this isn't: Fastboot bootloader-support for the transformer.
What this doesn't come with: Any sort of warranties. You take this as is. If your fastboot-capable device explodes when using it, I take no responsibility.
With that said:
This is a seemingly fully functional fastboot binary, so that you can mod your Nexus phone from the transformer (you did know it ships with adb out of the box, right? )
Usage:
To use it simply open a console and root up:
Code:
$ su
#
Ensure adb runs as root: (without root, adb wont be able to use the USB ports)
Code:
# adb kill-server
# adb start-server
Boot into bootloader:
Code:
# adb devices
-- your device here
# adb reboot bootloader
Still as root, run fastbootarm: (without root, fastboot wont be able to use the USB ports)
Code:
# fastbootarm devices
-- voila. your device here. mod along
# fastbootarm boot recovery-mylittlepony.img
-- etc
So far this thing has been confirmed working on the Asus Transformer TF101, Raspberry Pi and Nexus 7. Chances are it will work on any armel7 (or better) target.
Installation:
Fastboot arm is attached to this post. Download, unpack and copy to your transformer:
Code:
$ adb devices
-- your transformer here
$ adb push fastbootarm /sdcard/
$ adb shell
android$ su
# mount -o remount,rw /system
# cp /sdcard/fastbootarm /system/xbin/
# chmod 755 /system/xbin/fastbootarm
# mount -o remount,ro /system
# exit
android$ exit
$
All credit to IEF on #asus-transformer / Freenode. It was compiled by him (since I tried and failed and asked super-duper-nicely) from the Android source using "general" build-target. As such, it might be useful on other Android-devices which also supports USB host mode.
One-time-bump for the European daytime crew.
josteink said:
One-time-bump for the European daytime crew.
Click to expand...
Click to collapse
Thanks for the bump
I just saw this and will download as soon as i get to my pc this is awesome!!!!
Sent from my tf Enigmatic V2 beta 1.65Ghz Panda.test cust kernel settings
Could this binary be run on a desktop linux distro such as Debian running on an ARM-based chip? Specifically I am wondering if I could use it to control my Nexus one from my Raspberry Pi which uses a Broadcom BCM2835 SoC containing a ARM1176JZFS CPU.
I'm still not 100% familiar with the Raspberry Pi and wat Arm-type CPU it is, and if it's armel7 or whatever. Iirc this binary was compiled using an armel7 toolchain, so it should probably work on armel7 or better systems.
If the raspberry pi is same or better though, I don't know. I would hazard a guess to "maybe".
One thing is sure: It doesn't link to Android itself, so it should be able to run in any normal Linux-environment.
Try it, and report back?
josteink said:
I'm still not 100% familiar with the Raspberry Pi and wat Arm-type CPU it is, and if it's armel7 or whatever. Iirc this binary was compiled using an armel7 toolchain, so it should probably work on armel7 or better systems.
If the raspberry pi is same or better though, I don't know. I would hazard a guess to "maybe".
One thing is sure: It doesn't link to Android itself, so it should be able to run in any normal Linux-environment.
Try it, and report back?
Click to expand...
Click to collapse
I've given it a quick test and a can happily report that it works! Thanks a lot for compiling this. Do you mind if I link to this thread from the Raspberry Pi forums? I know many Pi owners are Android users and so would probably be interested.
wollac11 said:
I've given it a quick test and a can happily report that it works! Thanks a lot for compiling this. Do you mind if I link to this thread from the Raspberry Pi forums? I know many Pi owners are Android users and so would probably be interested.
Click to expand...
Click to collapse
Feel free
Sent from my Galaxy Nexus using Tapatalk 2
Sweet! This works on my nexus 7 and my galaxy nexus!
Buddy, still i cant get it. You meant if i use the binary i can modd my nexus through my tf101?
or can you simply tell me what does it do ?
frost866 said:
You meant if i use the binary i can modd my nexus through my tf101?
Click to expand...
Click to collapse
Yes. Just that.
It means you don't need to dig out a PC when you want to do things which requires that you have fastboot host. You can do it on your TF101, Raspberry Pi, Nexus 7, etc.
josteink said:
Following the "if you didn't make it, it doesn't belong here (in the development section)" guideline, I'm posting this in General. If a mod thinks this fits better in development, feel free to move it.
What this is: A fastboot executable binary for using the fastboot protocol to control other devices which supports fastboot, like the Galaxy Nexus or other Nexus-phones.
What this isn't: Fastboot bootloader-support for the transformer.
What this doesn't come with: Any sort of warranties. You take this as is. If your fastboot-capable device explodes when using it, I take no responsibility.
With that said:
This is a seemingly fully functional fastboot binary, so that you can mod your Nexus phone from the transformer (you did know it ships with adb out of the box, right? )
Usage:
To use it simply open a console and root up:
Code:
$ su
#
Ensure adb runs as root: (without root, adb wont be able to use the USB ports)
Code:
# adb kill-server
# adb start-server
Boot into bootloader:
Code:
# adb devices
-- your device here
# adb reboot bootloader
Still as root, run fastbootarm: (without root, fastboot wont be able to use the USB ports)
Code:
# fastbootarm devices
-- voila. your device here. mod along
# fastbootarm boot recovery-mylittlepony.img
-- etc
So far this thing has been confirmed working on the Asus Transformer TF101, Raspberry Pi and Nexus 7. Chances are it will work on any armel7 (or better) target.
Installation:
Fastboot arm is attached to this post. Download, unpack and copy to your transformer:
Code:
$ adb devices
-- your transformer here
$ adb push fastbootarm /sdcard/
$ adb shell
android$ su
# mount -o remount,rw /system
# cp /sdcard/fastbootarm /system/xbin/
# chmod 755 /system/xbin/fastbootarm
# mount -o remount,ro /system
# exit
android$ exit
$
All credit to IEF on #asus-transformer / Freenode. It was compiled by him (since I tried and failed and asked super-duper-nicely) from the Android source using "general" build-target. As such, it might be useful on other Android-devices which also supports USB host mode.
Click to expand...
Click to collapse
With this can i use the command fastboot oem unlock??
Sent from my nexus s using xda app
Spidergio said:
With this can i use the command fastboot oem unlock??
Sent from my nexus s using xda app
Click to expand...
Click to collapse
That would be "fastbootarm oem unlock", but yes.
This is fantastic! Been looking for this ability ever since February when I realized I owned 2 fantastic Android devices, a Galaxy Nexus and a tf201, but did not have a reliable PC to mod them with and was sick of borrowing my roommates... Thanks!
Anyone have fastbootarm working on JellyBean?
I wonder if OP could update the binary for JellyBean...
(I'm running stock tf201) (Do i maybe need busybox?)
Doesn't it work on jellybean? News to me.
Care to print the output when you attempt to run it?
I was glad to see this. I am running Ubuntu on my Nexus 7, and already had found an arm port for adb, so this was next on my list. Working great, but i renamed the binary to just fastboot. I would love to have the entire android sdk running, but cannot get past the swt.jar problem, and have no clue how to convert it to arm. Thanks for this share. If anyone needs the adb arm binary, just let me know and I will post it here.
Skyrocket on AOKP by R4ins
Finally the N7 shines and that PC is less of a requirement, now only need a portable nuclear powerplant with 230 mains out that can be tucked into my backpack... :thumbup:
Tapatalked from my h4x0r3d up Nexus 7.
I would love to see that ADB port in this thread.
Also, this is amazing. I have fastboot on my n7, hooked up to my gnex. Its like heaven. -- I am going to have to find that ADB port now (not that I ever use ADB myself). Eventually I may want to move to Ubuntu (once it is a bit further along), and it'd be nice to see both together.
Here is the adb for arm.
http://db.tt/aTKpVYx8
Sent from my Nexus 7 using xda premium
rebel1699 said:
Here is the adb for arm.
http://db.tt/aTKpVYx8
Sent from my Nexus 7 using xda premium
Click to expand...
Click to collapse
Awesome.. !!
Now I make myself feel dumb: This is installed in xbin just as fastboot, correct? And it is acceptable to remove .bin from the file, correct?
Also -- Gave fastboot a try on Galaxy Nexus and while I didn't get any errors spit back at me, it failed to find any devices attached to it, unlike the Nexus 7 which found anything I plugged into it. It is running v2.54 of paranoid android with the latest glados kernel (which is pretty old but I like it). Later I might try swapping through a few kernels, but unlikely any time soon (it can't take/make calls while flashing).
Now this whole thing has me thinking, could we just strip clean a copy of Ubuntu for ARM (ya know, the one they are building specifically for the Nexus 7 might work) and toss that stuff into android? I mean, after all, the most useful things there are going to be command line tools that android is missing. I don't know what kind of dependency issues might arise.
EDIT: after some quick looking - it turns out busybox comes with adb and quite a few other things. Always interested in expanding that further of course.

(help) kali linux on galaxy s5 sm-g900f

hello guys sorry for my english, but at the time is possibile to have kali linux on android 4.4.2 of galaxy s5??? i try a lot of guide but nothing, thanks
Yes there is a way. I am running Kali Linux on my Galaxy s5 now!!
Download linux deploy and install Kali linux from there.
GL!
la2o said:
Yes there is a way. I am running Kali Linux on my Galaxy s5 now!!
Download linux deploy and install Kali linux from there.
GL!
Click to expand...
Click to collapse
i've already tried but nothing , maybe can you send me a pvt message with a little guide for the installation?? p.s. i have a sdcard of 8 gb
I tried Linux on Android but it gives invalid argument mounting the loop device. Linux Deploy has an option to not use a loop device and install to a folder I think. Not positive. Try Advanced Linux Installer. That might work. It costs but it's way better than the free version. Try Standard Linux Installer first if you like.
Could you please add some note on how you managed to install?
I am trying with several options, but always get stuck on a "dd: permission denied" creating the volume
Z
I'll try to provide that info. What you're seeing likely means where it's trying to write isn't allowed. Try changing the install location to somewhere safe like /data/kali or something. Also I just found out the S5 won't do ext2 so if you're trying to do a loop device use ext4 if possible. Sorry I don't have more info at the moment.
I am having the same issue. What SU app are you using? I am using SuperSU, I read that SuperSU might be the problem but I do not know the conditions on how to switch SU apps. Hopefully we can find a solution.
Just got running.
use a terminal emulator as root
cd /data/data/ru.meefik.linuxdeploy/linux/bin
rm sh chroot
ln -s /system/bin/mksh sh
ln -s /system/xbin/busybox chroot
make sure your file location is on your sd card
change image size to appropriate size.
also change to ext4 file system
DipSprayArc said:
Just got running.
use a terminal emulator as root
cd /data/data/ru.meefik.linuxdeploy/linux/bin
rm sh chroot
ln -s /system/bin/mksh sh
ln -s /system/xbin/busybox chroot
make sure your file location is on your sd card
change image size to appropriate size.
also change to ext4 file system
Click to expand...
Click to collapse
Can you explain this deeper? I typed that in an emulater but no luck
DipSprayArc said:
Just got running.
use a terminal emulator as root
cd /data/data/ru.meefik.linuxdeploy/linux/bin
rm sh chroot
ln -s /system/bin/mksh sh
ln -s /system/xbin/busybox chroot
make sure your file location is on your sd card
change image size to appropriate size.
also change to ext4 file system
Click to expand...
Click to collapse
Also here are screen shots of my errors, settings, and anything else I figured might be useful to you. Thanks for help in advance.
I think it's long overdue for a Galaxy S4/5 guide. I know tinkering must be done and there are several issues to negotiate. I've found scattered info here and there but nothing definitive. Complete Linux Installer or Linux Deploy. Either/or. The only way I've ever got Linux to work is by installing to a directory and doing a chroot into it and doing a debootstrap.
Please&ty.
Is the stock WiFi radio compatible with packet injection or monitor mode on the S5 that you know of? I never put much effort into the install after I had such as hard time initially, attempting to install it to my extSdCard.
Solution
Hi there, I tried to install the kali distro in a s5 (g900f) with de Linux Deploy v 1.5.5 and I couldnt, i downloaded the 1.4 and neither but with de v 1.3 I could make it!
So if you are having any troubles with the installation, just download a previous version from the project's github (here)
Hope it helps!
su error
[email protected]:~$ su
Password:
su: Authentication failure
[email protected]:~$ sudo -i
sudo: PERM_ROOT: setresuid(0, -1, -1): Permission denied
[email protected]:~$
And now ?
plz help bro

Attempt to get root on Android 5 with locked bootloader

Hello everyone. I'm owner of Verizon version of Note 4 - N910V. Unfortunately, I've found that it has locked bootloader after I've bought it. It's even impossible to get root on Android 5.
I don't want to accept it, and going to try to get at least temporary root on that smartphone.
Why it is possible:
- it's matter of vulnerability. KingRoot is able to root latest Android 4.4, even with locked bootloader
- Android 5 was released more than 2 years ago, there was enough time to reveal some vulnerabilities, that we have in our ROMs
- Linux kernel we use is pretty old too: linux 3.10.40 was released in May 2014
- VTS for Android shows several existing vulnerabilities, that gives system-level privileges
Plan:
- Get system-level privileges
- Get root level privileges
- Get permanent root (bypass write protection)
Progress:
- How to run busybox through adb shell:
Download busybox executive from https://busybox.net/downloads/binaries/latest/
copy it to phone: adb push busybox-armv7l /data/local/tmp/
Run adb shell and execute commands
Code:
cd /data/local/tmp/
chmod 755 busybox-armv7l
mkdir busybox
for app in $(../busybox-armv7l --list); do ln -s ../busybox-armv7l $app; done
export PATH=$PATH:/data/local/tmp/busybox
Enjoy
Repeat last command on every adb shell session
Current:
I'm going to use CVE-2015-1528 vulnerability to try to get system-level privileges
This thread I'm opening to share my progress and to get any advices/help with this.
Sounds interesting. Keep us informed!
Sent from my SM-N910F using Tapatalk
Quick update. I switched to CVE-2015-3825 vulnerability. I should work on any Android by 5.1, it seems easier because you need to exploit only one service, and there is good documentation: https://www.usenix.org/system/files/conference/woot15/woot15-paper-peles.pdf.
Despite I understand how to use this vulnerability, unfortunately, I'm not Android developer, nor low-level hacker, so it may takes sometime for me to implement them all.
I've started work on this exploit already. Any help is appreciated.
Has somebody done successfully temporary root his retail edition Android 5 Note 4 with KingRoot 4.8.1? One guy from sibling thread said that he did it successfully on 5.1.1 android

Categories

Resources