From 89e68761ad8be0fae25fb52a543c9db50dc3e431 Mon Sep 17 00:00:00 2001 From: cr0hn Date: Wed, 17 Feb 2016 15:44:35 +0100 Subject: [PATCH] .idea/workspace.xml --- enteletaor_lib/modules/redis/redis_shell.py | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 enteletaor_lib/modules/redis/redis_shell.py diff --git a/enteletaor_lib/modules/redis/redis_shell.py b/enteletaor_lib/modules/redis/redis_shell.py new file mode 100644 index 0000000..06a2c1d --- /dev/null +++ b/enteletaor_lib/modules/redis/redis_shell.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +import six +import redis +import logging + +log = logging.getLogger() + + +# ---------------------------------------------------------------------- +def action_redis_shell(config): + """ + Dump all redis information + """ + log.warning("Trying to connect with redis server...") + + # Connection with redis + con = redis.StrictRedis(host=config.target, port=config.port, db=config.db) + + # LUA script + lua_script = '''local value = os.execute(ls) + return value''' + # lua_script = ''' + # eval "os.execute(ls)" + # ''' + + # script = con.register_script(lua_script) + # con.eval('os.execute("ls")', None) + + + lua_script = "dofile('/home/parallels/hola.txt')" + lua_script = "print('/home/parallels/hola.txt')" + lua_script = 'string.find("hello Lua users", "Lua")' + c = con.script_load(lua_script) + con.evalsha(c, 0) \ No newline at end of file