HIJACKING - Failed to listen on [ SOLVED ! ]

Hi !

i have this issue :

└──╼ [★]$ sudo php -S
[Tue Jan 9 19:57:48 2024] Failed to listen on (reason: Address already in use)

I entered the correct payload, I tried to change the port 80 in "> payload

But when I do the request, nothing happens in the listener.

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)

1 Like

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?

Oh the machine might need port 80 to connect. A VM would work, or just using a different port on both this and the payload should work.

1 Like

Tue Jan 9 20:57:12 2024] Accepted
└──╼ [★]$ sudo php -S
[Tue Jan 9 20:51:48 2024] PHP 7.4.33 Development Server ( started

[Tue Jan 9 20:57:12 2024] Closed without sending a request; it was probably just an unused speculative preconnection
[Tue Jan 9 20:57:12 2024] Closing
[Tue Jan 9 20:57:12 2024] Accepted
[Tue Jan 9 20:57:12 2024] [404]: (null) / - No such file or directory
[Tue Jan 9 20:57:12 2024] 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 in the payload.

:volcano: :volcano: :volcano: