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

termshark doesn't give sufficient error for non-root users #4

Closed
sagis-tikal opened this issue Apr 23, 2019 · 7 comments
Closed

termshark doesn't give sufficient error for non-root users #4

sagis-tikal opened this issue Apr 23, 2019 · 7 comments
Labels
need info Potentially a bug but we need more data

Comments

@sagis-tikal
Copy link

sagis-tikal commented Apr 23, 2019

When termshark is executed with no parameters and not as root it will print the following error:
"INFO[0004] tshark: Couldn't run /usr/bin/dumpcap in child process: Permission denied"

Tried to use both the pre-compiled version and to compile it using the with GO111MODULE=on
termshark version: 1.0.0
tshark version: TShark (Wireshark) 3.0.1 (Git)
OS version: 4.19.35-1-MANJARO (inside of a VirtualBox VM)

@gcla
Copy link
Owner

gcla commented Apr 23, 2019

Thanks for the report, I'll try to improve that.

@pocc
Copy link
Collaborator

pocc commented Apr 23, 2019

termshark is relaying the permissions issue that dumpcap ran into. termshark could ask for sudo privileges, but tshark/dumpcap fail on permission error, so termshark should mimic behavior.

@sagis-tikal This is an issue if capturing with command dumpcap does not produce this error but capturing with termshark does. Otherwise, please close this issue.

@mr-sour
Copy link

mr-sour commented May 9, 2019

I ran into this to I got "Could not find network interface vcan0" but the problem was my permissions a more descriptive error or just adding the age ol "Are you root?" to the existing error message would be an improvement. running with sudo fixed it.

@pocc
Copy link
Collaborator

pocc commented May 9, 2019

Permission Errors

This is tshark's permission error:

tshark: Couldn't run /usr/bin/dumpcap in child process: Permission denied

Checking in an Ubuntu VM, this is what I get for termshark without sudo:

Cannot capture on interface ciscodump: fork/exec /usr/bin/dumpcap: permission denied (exit code -1)
See https://wiki.wireshark.org/CaptureSetup/CapturePrivileges for more info.

Which is plenty informative, and better than tshark's error message.

Need Info

Can users experiencing this issue please post

  • tshark -v
  • the error text that termshark gives without sudo?

@pocc pocc added the need info Potentially a bug but we need more data label May 9, 2019
@gcla
Copy link
Owner

gcla commented Dec 7, 2019

I think I have introduced a regression in termshark v2. I'll look at making this more informative.

@gcla
Copy link
Owner

gcla commented Dec 7, 2019

I added a more useful comment - to run a setcap command, and as @mr-sour suggested, the good old-fashioned "use root" ;-)

If you want to try it, the latest can be installed with

go get github.com/gcla/termshark/v2/cmd/termshark@master

@gcla
Copy link
Owner

gcla commented Dec 8, 2019

I added this link too: https://termshark.io/no-root

I'll close this issue now.

@gcla gcla closed this as completed Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Potentially a bug but we need more data
Projects
None yet
Development

No branches or pull requests

4 participants