- This topic has 3 replies, 2 voices, and was last updated 6 months, 1 week ago by Diego Pérez.
- AuthorPosts
- June 4, 2024 at 8:09 pm #157039icare90Participant
Hello,
Could you please share the codes for the listener and the reverse backdoor for PYTHON 3. Despite many attempts, I don’t manage to make it work.
oot@kali:~/Documents/python-projects# python listener.py
(+) Waiting for incoming cnnection
(+) Got a connection from (‘192.168.193.128’, 54317)
>> dir
Traceback (most recent call last):
File “/root/Documents/python-projects/listener.py”, line 34, in <module>
my_listener.run()
File “/root/Documents/python-projects/listener.py”, line 30, in run
result = self.execute_remotely(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/root/Documents/python-projects/listener.py”, line 24, in execute_remotely
self.reliable_send(command)
File “/root/Documents/python-projects/listener.py”, line 16, in reliable_send
json_data = json.dumps(data)
^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/json/__init__.py”, line 231, in dumps
return _default_encoder.encode(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/json/encoder.py”, line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/json/encoder.py”, line 258, in iterencode
return _iterencode(o, 0)
^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/json/encoder.py”, line 180, in default
raise TypeError(f’Object of type {o.__class__.__name__} ‘
TypeError: Object of type bytes is not JSON serializableJune 5, 2024 at 9:24 pm #157394Diego PérezModeratorHi!
I don’t have the codes, just follow the instructions in the course to be able to make it work with python 3, the error you are getting is covered in the lecture.Greetings!
DiegoJune 16, 2024 at 6:20 pm #160839icare90ParticipantHello Diego,
The full lecture is based on python2.
I didn’t manage to fix the code to make it work with python3.
Still this object type issue for the serialization.Your help would be welcome.
And more generally speaking, a course updated for python3 would be a plus.def reliable_send(self, data):
json_data = json.dumps(data).encode()
self.connection.send(json_data)def reliable_receive(self):
json_data =””
while True:
try:
json_data = json_data + self.connection.recv(1024).decode()
return json.loads(json_data)
except ValueError:
continuedef execute_remotely(self, command):
self.reliable_send(command)
return self.reliable_receive()June 17, 2024 at 10:43 pm #161229Diego PérezModeratorHi!
Where is the error being showed? In the listener or backdoor? Can you share a screenshot of it? Also share some screenshots of the code because it doesn’t have any indentation.Greetings!
Diego - AuthorPosts
- You must be logged in to reply to this topic.