Commits

Matthew Turk  committed f5accdc

Very simple and insecure server for execution

  • Participants
  • Parent commits 43020b0

Comments (0)

Files changed (3)

 uri = raw_input("URI? ").strip()
 Pyro4.config.HMAC_KEY = hmac_key
 VRH = Pyro4.Proxy(uri)
-insert_ipython()
+

File simple_client.py

+import Pyro4
+
+hmac_key = raw_input("HMAC_KEY? ").strip()
+uri = raw_input("URI? ").strip()
+Pyro4.config.HMAC_KEY = hmac_key
+executor = Pyro4.Proxy(uri)
+

File simple_server.py

+import Pyro4
+import uuid
+
+class Executor(object):
+    def execute(self, code):
+        print "EXECUTING", code
+        return eval(code)
+
+executor = Executor()
+
+Pyro4.config.HMAC_KEY = uuid.uuid4().hex
+print "HMAC KEY", Pyro4.config.HMAC_KEY
+Pyro4.Daemon.serveSimple(
+      {executor: "yt.executor"},
+      ns=False)