You have something else running on port 80. You can see ports in use with netstat -tuln , and try to kill or remove whatever is currently using the port if you don’t want it.
Changing the port 80 to something else is the correct way around this if you don’t want to kill what is currently on port 80, the reason it did not connect is probably because you did not change the port in the payload to be the new value instead of 80 (and keep in mind, something like http[://]example[.]com is still requesting port 80, because 80 is the default http port)
i tried kill process for python2.7 which is at 80 port but the HTB virtual machine disconnects after that. Maybe I should try to connect through my VM?
Tue Jan 9 20:57:12 2024] 141.98.11.44:62680 Accepted
┌─[eu-academy-2]─[10.10.14.212]─[htb-ac-681954@htb-9u585mnssj]─[/tmp/tmpserver]
└──╼ [★]$ sudo php -S 0.0.0.0:8080
[Tue Jan 9 20:51:48 2024] PHP 7.4.33 Development Server (http://0.0.0.0:8080) started
[Tue Jan 9 20:57:12 2024] 141.98.11.44:62680 Closed without sending a request; it was probably just an unused speculative preconnection
[Tue Jan 9 20:57:12 2024] 141.98.11.44:62680 Closing
[Tue Jan 9 20:57:12 2024] 141.98.11.44:62814 Accepted
[Tue Jan 9 20:57:12 2024] 141.98.11.44:62814 [404]: (null) / - No such file or directory
[Tue Jan 9 20:57:12 2024] 141.98.11.44:62814 Closing
Six minutes after sending the request, I got this message from a listener. Now, is the request successfully sent or is it just a notification that no request has been sent?
I finally solved the problem, probably the php listener didn’t work because I didn’t create the script.js to which the call would be attached even though I specified 10.10.14.212:8080 in the payload.