
To fix this issue, run the following command: In the top example (see above), the error effects the “pcaprub” Gem.

Note, ~/git/metasploit-framework/ is my locally defined directory for my Github repository in Kali Linux. This occurs during the installation process for Bundled Gems in Metasploit and within its local Git repository, e.g.: Make sure that `gem install pcaprub -v '0.12.4'` succeeds before bundling. We can see that the system user now has root access, denoted from the above by euid=0(root) and root identified from whoami command.Īn error occurred while installing pcaprub (0.12.4), and Bundler cannot This should result in the system permitting root access, and this can be seen from the following commands: This command will get a TTY shell after a reverse shell connection using Python2.7. usr/bin/python2.7 -c ‘import pty pty.spawn(“/bin/sh”)’ We can use the following command to achieve this in using our above example: As given from the above example, we could look to use Python2.7 binary in an attempt to gain root access using a privilege escalation exploit. Note that if redirect to stdout (>) or (1>) was used instead of stderr (2>), we would see a list of permission denied errors.

The result of this search, will be redirected to standard error and use a null device to suppress output (2>/dev/null). Here, the find command will search from root (/) looking for user SUID permissions configured to execute (-perm -u=s), and to find directories (-type f). Then we can use the following command, to find a list of executable file SUID permissions on the system:

We can verify the system identification of the user by using the following command to ascertain SUID permissions: During the attacking phase of a pen test once access has been gained to a shell, we can try to own the system through a privilege escalation exploit in order to obtain root access.
