Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why strace dumpcap fail? #221

Closed
leveryd opened this issue Aug 25, 2022 · 2 comments
Closed

why strace dumpcap fail? #221

leveryd opened this issue Aug 25, 2022 · 2 comments
Labels

Comments

@leveryd
Copy link

leveryd commented Aug 25, 2022

[test@instance-h9w7mlyv ~]$ dumpcap
Capturing on 'eth0'
File: /var/tmp/wireshark_eth0_20220822114539_BK9d9l.pcapng
Packets captured: 12
Packets received/dropped on interface 'eth0': 12/0 (pcap:0/dumpcap:0/flushed:0/ps_ifdrop:0) (100.0%)
[test@instance-h9w7mlyv ~]$
[test@instance-h9w7mlyv ~]$ strace dumpcap
...
socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)) = -1 EPERM (Operation not permitted)
stat(0x55fb3851ea20, 0x7ffe66fa24f0)    = -1 ENOENT (No such file or directory)
write(2, 0x55fb372c18e5, 9dumpcap: )             = 9
write(2, 0x7ffe66f9fd10, 117The capture session could not be initiated on interface 'eth0' (You don't have permission to capture on that device).)           = 117
write(2, 0x7f4107b52683, 1
)             = 1
write(2, 0x7ffe66f9fd40, 466Please check to make sure you have sufficient permissions.

On Debian and Debian derivatives such as Ubuntu, if you have installed Wireshark from a package, try running

    sudo dpkg-reconfigure wireshark-common

selecting "<Yes>" in response to the question

    Should non-superusers be able to capture packets?

adding yourself to the "wireshark" group by running

    sudo usermod -a -G wireshark {your username}

and then logging out and logging back in again.)           = 466
write(2, 0x7f4107b52683, 1
)             = 1
exit_group(1)                           = ?

non-root user run dumpcap looks good, but run strace dumpcap looks bad. WHY?

dumpcap can be installed by yum install wireshark.

@leveryd
Copy link
Author

leveryd commented Aug 25, 2022

run strace lsstrace cat looks good too.

[test@instance-h9w7mlyv tmp]$ strace ls
...
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x2), ...}) = 0
write(1, "1  1234  1.c  1.php  2.c  a  a.c"..., 1931  1234  1.c  1.php  2.c  a  a.c  a.out  b  b.c  c.c  e.c  f.c	lcap.c	Makefile  q.c  redis-server  systemd-private-cadce8b6014e4053aa540e5af070d6f9-chronyd.service-IcLArj  x.conf  x.php  y.php
) = 193
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

@esyr
Copy link
Member

esyr commented Aug 29, 2022 via email

@esyr esyr added the question label Aug 29, 2022
@ldv-alt ldv-alt closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants