Install Python & Web Server

  Install Python & Web Server

ataker@htb[/htb]$ sudo apt install python3 -y
ataker@htb[/htb]$ python3 -m http.server

When we run this command, our Python Web Server will be started on the TCP/8000 port, and we can access the folder we are currently in. We can also host another folder with the following command:

  Install Python & Web Server

ataker@htb[/htb]$ python3 -m http.server --directory /home/cry0l1t3/target_files

This will start a Python web server on the TCP/8000 port, and we can access the /home/cry0l1t3/target_files folder from the browser, for example. When we access our Python web server, we can transfer files to the other system by typing the link in our browser and downloading the files. We can also host our Python web server on a port other than the default port by using the -p option:

  Install Python & Web Server

ataker@htb[/htb]$ python3 -m http.server 443

This will host our Python web server on port 443 instead of the default TCP/8000 port. We can access this web server by typing the link in our browser.