-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
some strange connections (seems like eBPF don't return the original PID of the connection) #736
Comments
thank you @NRGLine4Sec . We need at least another log line to log the PID of the connection (tcp.* and udp.* hooks) as seen via ebpf, because right now it's not logged. It should appear after/before "new connection udp". Did you compile the daemon or are you using it from the packages? I can add a couple of new log lines to further debug this problem, but you would have to compile the daemon. |
I installed OpenSnitch from deb packages. I don't know if this is important, but this is the third time this has happened with the package update. |
do you mean that this is the third time that this problem occurs only after update the package? or does it occur on a regular basis/from time to time? I'll compile the daemon with new debug logs. |
What I mean is that so far I've seen it most often while I'm updating packages, but it occur ramdomly. |
ok. Could you test this daemon (v1.6.0 master branch)? opensnitchd.gz These are the added DEBUG log lines: [eBPF exit event] |
Thanks @gustavo-iniguez-goya |
The oddities I mentioned are caused by not intercepting fork/clone syscalls. On my system after download updates, apt executes apt-listbugs using sh -c:
then apt-litsbugs opens a new connection, we intercept it, we get the pid of the connection (967913) but we don't have the process path in cache (because we haven't received it via events, 967913 see above ^):
After the log "not in cache nor in execevents", we extract the information from /proc/967913/, which is slightly different from the one reported via ebpf (in some cases only). sh -c foks the process to execute a new process:
I added a hook to intercept fork syscalls, but I removed it, don't remember why. Now that I know how to reproduce this case I can reenable it again and see what happens. |
Nice finding @gustavo-iniguez-goya !
|
This is a different problem. In this case we're not getting the path of the process, so instead of the path we're using the comm name (/proc/$pid/comm). |
OK, thank you for the clarification 👍 |
hey @NRGLine4Sec , any news about this problem? did you see again connections from wrong processes? I've released a version: https://github.com/evilsocket/opensnitch/releases/tag/v1.6.0-rc.3 I think that it should fix this problem. |
Hi @gustavo-iniguez-goya |
There are some strange connections that seem not to be initiated by the processes that make the connection.
These strange connections force me to add new rules that allow the connection so that the package update can be done without problems.
Useful debug logs :
In this case it appears after an update of my packages (
apt-get upgrade -y
). Therefore the binary that makes the connection is certainly :/usr/lib/apt/methods/https
This issue is maybe related to #735.
My configuration :
Distrib : Debian 11
Kernel : 5.18.0-0.bpo.1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.2-1~bpo11+1 (2022-06-14) x86_64 GNU/Linux
Opensnitch version : 1.6.0rc2
Process Monitor Method : eBPF
The text was updated successfully, but these errors were encountered: