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

Check if binary has capabilities set #566

Closed
wants to merge 1 commit into from

Conversation

NicolaiSoeborg
Copy link

Spend ages trying to figure out why proxychains python ... didn't work, turns out I had given python the cap_net_bind_service capability (useful, but breaks proxychains due to LD_PRELOAD no longer working [1])

This hopefully fixes a bunch of hard to debug issues (like here). Could be extended to check for suid binaries, etc

[1] https://stackoverflow.com/questions/18058426/does-using-linux-capabilities-disable-ld-preload

Spend ages trying to figure out why `proxychains python ...` didn't
work, turns out I had given python the `cap_net_bind_service` capability
(useful, but breaks proxychains due to LD_PRELOAD no longer working [1])

[1] <https://stackoverflow.com/questions/18058426/does-using-linux-capabilities-disable-ld-preload>
@rofl0r
Copy link
Owner

rofl0r commented May 28, 2024

your PR has several issues - for one it breaks build for everyone without libcap - since you only check whether the lib is there for the makefile, but not for main.c. next it has mixed tabs and spaces. then it probably only works if the full binary path is used, not when it's only in PATH. and finally, it opens a can of worms:

if we check for caps, then we should also check for setuid binaries, and for static linked binaries, and for binaries using a sandbox, etc etc. where do we draw the line ?

imo it makes more sense to write a troubleshooting guide for common reasons why proxychains can fail to work as expected. the wiki which is publicly editable would be a good place for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants