OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Rpyc dosen't transfer any methods or libraries to client

  • Thread starter Thread starter erik
  • Start date Start date
E

erik

Guest
So I wanted to make a C2 server that transfers methods and libraries to its clients but because of some reason it just dosen't want to. I have checked the version and it's 6.0.0 and there is no firewalls on pc. Code dosen't spit out any erros except; AttributeError: 'SlaveService' object has no attribute exposed_add, so I assume it's some kind of bug in my code. Here is my C2:

Code:
import rpyc
conn = rpyc.classic.connect("localhost", 18812)
while True:
   class MyService(rpyc.Service):
        def on_connect(self, conn):
            print("connection made")
        def on_disconnect(self, conn):
            print("connection closed")
        def exposed_add(self, x, y):
            resukt = x + y
            print(resukt)
            print("jesus")
if __name__ == "__main__":
    from rpyc.utils.server import ThreadedServer
    server = ThreadedServer(Myservice, port=18812,protocol_config = {"allow_public_attrs" : True} )
    server.start()

There is right identations on the code above I just don't know how to put it here(this is my first post ever)

I have tried transfering the libraries to the client but either it spits out the error I mentioned above or it just says welcome and goodbye. When client asks for an import it dosen't work but when I do the conn.execute('for loop') it works perfectly and even gives me the result back. I tried importing the libraries through the conn.execute method but it still gives me the same error from above Here is my client:

Code:
import rpyc

conn = rpyc.connect("localhost", 18812)
rez = conn.root.exposed_add(5, 6)
print(rez)

I'm a begginer at this but I'm trying to learn so go easy on me if there is a big mistake somewhere
<p>So I wanted to make a C2 server that transfers methods and libraries to its clients but because of some reason it just dosen't want to. I have checked the version and it's 6.0.0 and there is no firewalls on pc. Code dosen't spit out any erros except; AttributeError: 'SlaveService' object has no attribute exposed_add, so I assume it's some kind of bug in my code.
Here is my C2:</p>
<pre><code>import rpyc
conn = rpyc.classic.connect("localhost", 18812)
while True:
class MyService(rpyc.Service):
def on_connect(self, conn):
print("connection made")
def on_disconnect(self, conn):
print("connection closed")
def exposed_add(self, x, y):
resukt = x + y
print(resukt)
print("jesus")
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
server = ThreadedServer(Myservice, port=18812,protocol_config = {"allow_public_attrs" : True} )
server.start()

</code></pre>
<p>There is right identations on the code above I just don't know how to put it here(this is my first post ever)</p>
<p>I have tried transfering the libraries to the client but either it spits out the error I mentioned above or it just says welcome and goodbye. When client asks for an import it dosen't work but when I do the conn.execute('for loop') it works perfectly and even gives me the result back. I tried importing the libraries through the conn.execute method but it still gives me the same error from above
Here is my client:</p>
<pre><code>import rpyc

conn = rpyc.connect("localhost", 18812)
rez = conn.root.exposed_add(5, 6)
print(rez)
</code></pre>
<p>I'm a begginer at this but I'm trying to learn so go easy on me if there is a big mistake somewhere</p>
 
Top