Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the port need to be open? #4

Open
Whip opened this issue Jan 11, 2019 · 4 comments
Open

Does the port need to be open? #4

Whip opened this issue Jan 11, 2019 · 4 comments

Comments

@Whip
Copy link

Whip commented Jan 11, 2019

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?

@ankit-kumar-jat
Copy link

you have to put IP of machine in which you start listener. It is just because of wrong IP.
Thank you

@ankit-kumar-jat
Copy link

and you have to start listener first.

@ghost
Copy link

ghost commented Nov 23, 2020

im noob my friend can u tell me where i put the ip ?

@ankit-kumar-jat
Copy link

Line no. 49 in php-reverse-shell.php
And you can change port in line no. 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants