1. Matthew Turk
  2. yt.rife

Commits

Matthew Turk  committed f5accdc

Very simple and insecure server for execution

  • Participants
  • Parent commits 43020b0
  • Branches default

Comments (0)

Files changed (3)

File client.py

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

File simple_client.py

View file
+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

View file
+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)