Tcpdump trace on android - could not load library "libssl.so" needed by "/system/bin/tcpdump"
Asked Answered
B

3

6

I need to do tcpdump trace on my android devices.


My setup:

Push tcpdump file to sdcard

adb push filepath/tcpdump /sdcard/tcpdump

Copy file to /system/bin

Give root privileges to tcpdump file

adb shell
cd /system/bin
su
chmod 777 tcpdump

Install BUSYBOX from Google Play

Run tcpdump trace

tcpdump -vv -s 0 -w /sdcard/filename.pcap

I have already managed to do that on Samsung Galaxy S4 - it works fine. However, it doesn't work on my Samsung Galaxy Tab. After tcpdump command I got error:

tcpdump
soinfo_link_image(linker.cpp:1635): could not load library "libssl.so" needed by
 "/system/bin/tcpdump"; caused by load_library(linker.cpp:761): not a valid ELF
executable: libssl.soCANNOT LINK EXECUTABLE

Both devices are rooted and they have the same tcpdump configuration. I have libssl.so in /system/lib/

Samsung Galaxy S4

C:\Windows\System32>adb shell
shell@android:/ $ su
su
root@android:/ # cd system/bin
cd system/bin
root@android:/system/bin # tcpdump
tcpdump
tcpdump: WARNING: arptype 530 not supported by libpcap - falling back to cooked
socket
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on rmnet_usb0, link-type LINUX_SLL (Linux cooked), capture size 96 byt
es

Samsung Galaxy Tab

C:\Windows\System32>adb shell
root@android:/ # su
su
root@android:/ # cd system/bin
cd system/bin
root@android:/system/bin # tcpdump
tcpdump
soinfo_link_image(linker.cpp:1635): could not load library "libssl.so" needed by
 "/system/bin/tcpdump"; caused by load_library(linker.cpp:761): not a valid ELF
executable: libssl.soCANNOT LINK EXECUTABLE
 255|root@android:/system/bin #
Beeck answered 18/10, 2013 at 12:26 Comment(0)
T
5

http://www.kandroid.org/online-pdk/guide/tcpdump.html

it may useful.

adb shell tcpdump -i any -p -s 0 -w /sdcard/capture.pcap

# "-i any": listen on any network interface
# "-p": disable promiscuous mode (doesn't work anyway)
# "-s 0": capture the entire packet
# "-w": write packets to a file (rather than printing to stdout)

... do whatever you want to capture, then ^C to stop it ...

adb pull /sdcard/capture.pcap .

sudo apt-get install wireshark  # or ethereal, if you're still on dapper
wireshark capture.pcap          # or ethereal
Tris answered 23/5, 2014 at 6:46 Comment(0)
B
0

SOLUTION

I solved my problem by copying 'libssl.so' and 'libcrypto.so' from Samsung Galaxy S4 to Samsung Galaxy Tab. It seems to work fine. I have no idea about the possible negative impact of that change.

Beeck answered 21/10, 2013 at 13:16 Comment(0)
M
0

Samsung Galaxy Discover SGH-S730M *#9900# TCP Dump requires OTP Authentication, so I would assume TCP dump won't work on any Android device without a password.

Melanochroi answered 8/3, 2014 at 3:46 Comment(1)
I'm working on rooted devices and I use this: tcpdump.org . It works fineBeeck

© 2022 - 2024 — McMap. All rights reserved.