Match by full command by default for high-risk executables#1513
Match by full command by default for high-risk executables#1513blaccod wants to merge 3 commits intoevilsocket:masterfrom
Conversation
|
hi @blaccod ! I agree that allowing interpreters can be dangerous. But we cannot hard-code the list of commands without giving the user the ability to configure it. In any case, I'd not include in that list curl, wget or ssh. If we include those binaries, we should also include bash, awk, rsync, smbclient, ftp, etc, etc. (or the whole gtfobin list). What if we add this PR, and allow users to configure the list of commands that will preselect path + cmdline? |
That sounds good, I can add it under Preferences > Rules (or Prefereces > Popup > More) and note that it is an advanced settings, and have a small hover tooltip to explain what that is.
The reason this PR has to do the
I can't think of any time when allowing curl and wget to indiscriminately connect to the Internet is a good thing, that's why they're there. ssh is there because |
perfect 👍 All the pop-ups related configuration is under the Pop-up tab. Maybe it'd be better to add it there, for consistency.
I'd go for this. It's what you already did, and it's configurable. If someone has other necessity they can open a feature request explaining their need. The list should be saved/loaded using the load_ui_settings() and save_ui_settings().
Bear in mind that users can create rules to filter by multiple fields, so for example you can create a rule to allow Filtering by default by cmdline can cause "pop-ups fatigue", as someone has already defined it. If it's a server, honestly I'd not even install wget or curl if I don't explicitly need it, given how commonly they're used in attacks. |
For commands that should not be blanket-allowed like curl or wget, set the "this command line only" as default target for rules
8fa298e to
64afcbf
Compare
The default behavior when creating a rule using UI popup is matching by executables. This, however, is too broad for apps and scripts built with Python and node, or programs like
curlandwget, because allowingpython3to access a website means every scripts ran usingpython3 script.pywill have access to that website.This problem is discussed previously and included in Wiki, but is not widely known. This PR fixes that by setting the rule to match the entire command line by default, including all arguments, for such high-risk executable.
Currently, the matched executables are
curl,wget,python,node,java,sshPrograms that fall into this bucket are much more common than people actually expect, even if they do not frequently program in those languages and/or use the command line. For example, this includes Lutris, Bottles, Anki, Claude Code, any
curl | bashinstallation process, and Git over SSH.