Command Line Firewall
There is, and it comes with macOS by default.

Little Snitch is an application firewall, that's a whole different story. It blocks applications from accessing the network.

Assuming you want to block ports and servers, just configure pf from the command line to do what you want. Start by reading through "man pfctl", or e.g. How to block abusive IP addresses with pf in OpenBSD?

If you want to have a GUI after all, you might want to check out the (free) IceFloor to configure pf.

To determine the ports yourself and preferably the server address that is sending or receiving data from your computer use the build in command "nettop".