Created
November 27, 2015 13:10
-
-
Save 0xbb/4be8f69412751abe8db0 to your computer and use it in GitHub Desktop.
Sends a SSH 2.0 message to steal the entropy from your server
This file contains 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
#!/usr/bin/env python3 | |
# Usage : ./sshrand.py server port | |
import socket | |
import sys | |
s = socket.socket() | |
s.connect((sys.argv[1], int(sys.argv[2]))) | |
version = s.recv(4096) | |
s.sendall(b'SSH-2.0-sshrand_0.1.0 just_stealing_your_entropy\r\n') | |
msg = s.recv(4096) | |
# check if Message Code: Key Exchange (20) | |
if msg[5] == 20: | |
sys.stdout.buffer.write(msg[6:6+16]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment