Apr-10-2019, 10:17 AM
Hey all,
I'm trying to convert a script written in python2.7 to python3.
The first hurdle is how byte strings are handled between the two, which I believe I've worked around.
The next issue seems to be around the implementation of sockets.
Specifically line 11 above:
Throws the error "Traceback (most recent call last):
File "rdp_check_ciphers.py", line 81, in <module>
response = s.recv(1024)
ConnectionResetError: [Errno 104] Connection reset by peer"
I'm just after some pointers as to what is likely the problem if anyone has experienced this sort of issue themselves.
The script I'm looking at is this one: https://labs.mwrinfosecurity.com/tools/r...r-checker/
Thanks in advance,
Pumpernickel
I'm trying to convert a script written in python2.7 to python3.
The first hurdle is how byte strings are handled between the two, which I believe I've worked around.
1 2 3 4 |
#python3 s.send(packet.encode( 'utf-8' )) #python2.7 s.send(packet) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
for n in list (enc_protocols.keys()): packet = X224_CONNECTION_REQUEST % n #TODO: need to convert to bytes-like object here print (binascii.hexlify(n.encode( 'utf-8' ))) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) #s.sendall(packet.encode('utf-8')) s.send(packet.encode( 'utf-8' )) #s.send(packet) response = s.recv( 1024 ) #response = s.recv(4096) if (response[ 3 ] = = "\x0b" ): enc_protocols[ "\x00" ][ 1 ] = True break else : if (response[ 11 ] = = "\x02" ): enc_protocols[n][ 1 ] = True else : errors[response[ 15 ]] = True #print binascii.hexlify(response) s.close() |
1 |
response = s.recv( 1024 ) |
File "rdp_check_ciphers.py", line 81, in <module>
response = s.recv(1024)
ConnectionResetError: [Errno 104] Connection reset by peer"
I'm just after some pointers as to what is likely the problem if anyone has experienced this sort of issue themselves.
The script I'm looking at is this one: https://labs.mwrinfosecurity.com/tools/r...r-checker/
Thanks in advance,
Pumpernickel