News for hackers. Stuff that matters.
Re:Microsoft is phoning home the content of your PowerPoint ... by squarefoot on Monday November 07, 2022 @12:01PM (#33508574)
On Linux there is OpenSnitch that does its job nicely, although I experienced some occasional desktop slowdowns even after training it to open everything for trusted programs.

https://github.com/evilsocket/opensnitch

I still recall the old days of Windows when I tried Kerio Personal Firewall and realized how much software already phoned home two decades ago. That was the last wake up call that pushed me into getting rid of closed source software, possibly also hardware, especially when they connect to the internet.

Re:Microsoft is phoning home the content of your PowerPoint ... by Abishek_Muthian on Monday November 07, 2022 @12:32PM (#33509072)
I second OpenSnitch, I haven't face any shutdowns due to it yet. For those coming from LittleSnitch on macOS might have to look into the finer details of the connection in the Allow/Deny dialog on OS to get the best results.
Re:Microsoft is phoning home the content of your PowerPoint ... by squarefoot on Monday November 07, 2022 @12:52PM (#33509382)
Slowdowns, not shutdowns, luckily:) The desktop (XFCE under Debian if that helps) just hung for a while like it was waiting for me to allow some rules, but didn't show the requester to do so, also the timings were random, could have been from 2 seconds to 5 or more.
Re:Microsoft is phoning home the content of your PowerPoint ... by Abishek_Muthian on Monday November 07, 2022 @09:29PM (#33515269)
Oops; Self-reminder to not comment on HN when half sleep.

But, I haven't noticed slowdown either; I wonder whether its because I always keep the OS window open?

Re:Microsoft is phoning home the content of your PowerPoint ... by egberts1 on Monday November 07, 2022 @12:48PM (#33509320)
Keep in mind, OpenSnitch is Linux-based and none of Linux firewalls can filter incoming packets by process ID like macOS/FreeBSD (Lil'Snitch) can.
Re:Microsoft is phoning home the content of your PowerPoint ... by prmoustache on Monday November 07, 2022 @02:06PM (#33510649)
From what I understand opensnitch use ebpf to match where the exiting packets are going. TCP being TCP, it is easy to know where the incoming answer will be delivered to as well.
Re:Microsoft is phoning home the content of your PowerPoint ... by squarefoot on Monday November 07, 2022 @03:01PM (#33511534)
Not sure if this would work also for connectionless protocols such as UDP. That is, if I open a socket and send some datagrams to an external address:port to exfiltrate users data, then close the socket and exit, I don't think it would be able to tell which program did that, unless it detects it live.
Re:Microsoft is phoning home the content of your PowerPoint ... by prmoustache on Monday November 07, 2022 @03:42PM (#33512121)
I believe opensnitch catches them.
Re:Microsoft is phoning home the content of your PowerPoint ... by doubled112 on Monday November 07, 2022 @02:45PM (#33511296)
I think iptables was supposed to be able to do this, right?

https://linux.die.net/man/8/iptables

    --pid-owner processid
        Matches if the packet was created by a process with the given process id.
But was disappointed by the note:

> NOTE: pid, sid and command matching are broken on SMP

Re:Microsoft is phoning home the content of your PowerPoint ... by yrro on Monday November 07, 2022 @03:14PM (#33511726)
--pid-owner was removed from Linux some time in the 2.4 days IIRC.

That's a really outdated version of the man page. The current one is: https://ipset.netfilter.org/iptables-extensions.man.html

Probably the closest thing these days is to use the cgroup match extension, together with something that makes sure separate apps are moved to their own cgroup. But that cgroup would be under a separate parent cgroup for each user so it's not ideal.

I expect NFQUEUE or some EBPF magic is a better way to do things - you don't want to be constantly adding/removing per-process iptables rules.

Re:Microsoft is phoning home the content of your PowerPoint ... by pvaldes on Monday November 07, 2022 @06:06PM (#33513808)
Iptables is a little old. You may want the newer nftables instead.

The iptables rules can be converted directly to nft with iptables-translate and the syntax is more simple.

Re:Microsoft is phoning home the content of your PowerPoint ... by LinuxBender on Tuesday November 08, 2022 @09:37AM (#33519405)
The owner module can control outbound communication by uid/gid. [1] There are no modules to handle things by PID AFAIK. This can however be accomplished by SELinux and Apparmor custom rules but that is a loaded topic.

Firejail [2] and Bubblewrap [3] can put limits on application capabilities and/or take away network access.

A round-about and heavy handed way to manage communications by PID would be to isolation applications in their own VM or container and map the VM or container to a unique user or group.

[1] - https://ipset.netfilter.org/iptables-extensions.man.html

[2] - https://github.com/netblue30/firejail

[3] - https://github.com/containers/bubblewrap

Re:Microsoft is phoning home the content of your PowerPoint ... by gus_ on Tuesday November 08, 2022 @04:20AM (#33517412)
OoenSnitch can, but it's not implemented O:) (only as a PoC)

But does it have any sense? Usually you block inbound connections, allowing only certain services. If a rogue process starts listening on a local port, you could display a warning alert, and as inbound connections are already blocked you'd be safe (as long as you trust netfilter...) and you wouldn't need to ask the user to perform an action.

Re:Microsoft is phoning home the content of your PowerPoint ... by elesiuta on Thursday November 10, 2022 @06:09PM (#33554960)
The slowdowns are because it still has to hold every connection until it can check which program it is coming from and whether that program is trusted or not, even when the same program creates multiple connections.

To get around the slowdowns, I made an alternative program called picosnitch which only monitors connections since I just stop using anything I don't trust or move it to a sandbox. It also uses BPF, has fairly low CPU usage, and some other features for improved reliability and detection of programs.