0

I can have tcpdump binary installed, but my (android) OS is not rooted.

So if I try to run it on termux:

$tcpdump -ni any tcp and port 12345
tcpdump: wlan0: SIOCETHTOOL(ETHTOOL_GLINK) ioctl failed: Permission denied

The binary owner was root and was located in /data/data/com.termux/files/usr/bin/tcpdump so I decided the root privilege won't be necessary after I mv it to my home directory. After which the owner is me, and the mod of the binary is:

-rwxrwxr-x 1 u0_a236 everybody 836K Feb  8 13:24 tcpdump

but even with the ownership, the same permission error.

So is there a way to bypass permission on not-rooted devices?

OS details:

$uname -a
Linux localhost 4.9.112-perf+ #1 SMP PREEMPT Tue Nov 17 00:51:35 WIB 2020 aarch64 Android

device name: Redmi
device model: Redmi 7
MIUI version: MIUI Global 11.0.11 Stable
Android version: 9 PKQ1.181021.001

EDIT: bypassing does not mean "exploiting". This is not security question. I may be used wrong term, but the intention here is to use tcpdump for diagnostic purposes (see comments). The whole story is that the device is not rooted. The device that I bought, that I own. So even being the owner, I am not able to access the full filesystem (e.g. -> cd /data -> permission denied). So how can a owner (not "hacker"), use binary that requires root privileges? or list root directory? or anything where root privileges are required?

3
  • 1
    For capturing network traffic on every system root permissions are required. "Bypassing" that only means that you use an exploit to temporary gain root permissions (if such a vulnerability exists on your device). But this also means that every installed app could do so which means that your device would be open for every app to access everything no matter what permissions the app has requested (this is usually not what people want). – Robert Feb 8 at 13:19
  • @Robert I am sorry, but I am really not trying to develop any exploit, nor I am trying to do any malicious stuff. I wanted to use tcpdump just to sniff my LAN for ARP packages, because of unable to reach one host. In other words, I wanted to use it for diagnostic purposes. And I am the owner of the device anyway, and since MIUI is not rooted (which means even being the owner, not being able to access the whole filesystem on my device), you are saying that I am not allowed to use my device with root privileges? Am I missing logic here? – milanHrabos Feb 8 at 14:52
  • 1
    You cannot capture network traffic without root / administrator privileges on any OS including Android, Linux and Windows. On mostly stock Android devices apps cannot have root access. So you cannot sniff network traffic using tcpdump. VPN is an option though. Related: Why are superuser permissions needed to acess /data partition? and How is root access restricted on Android? and How to view network traffic requested by a specific app? – Irfan Latif Feb 8 at 15:09

Your Answer

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

Browse other questions tagged or ask your own question.