How to Secure Your Port using Port Forwarding - Kali linux 2016.2
1,625 views · Published 21 February 2017 · 5:52 · Indexed 21 September 2026
Channel: Hacoder · 2017 · Education
How to Secure Your Port using Port Forwarding..... In this tutorial I am going to perform how to use port forwarding in a system which is a process that redirects a communication request from a specific port to another port or host. It is basically allows an outside computer to connect to a computer in a private local area network. Some commonly done port forwarding includes forwarding port 22 for SSH access, forwarding port 80 for web servers and port 21 for FTP. The major advantage is that it provides security to your private network and secure communication Let’s start !!!! *HTTP and HTTPS forwarding Open ports.conf file from inside /etc/apache2 and type following command to read the configuration. cat ports.conf Here you can view the present listening port 80 and 443 for web server. If an attacker wants to send malicious file through web server he will try to connect with target using port 80 send the phishing page to the target. In order to protect you from being targeted through phishing page change the port number from 80 and 443 into other number. If you notice the following screenshot here you will that I have modified port 80 into 8088 and port 443 into 44343. Note: You can change your port number to any no. you wanted to be.... And then save it..... *FTP port forwarding Now open the vsftpd.conf file from inside /etc. Here you can view listen port is 21 by default, to protect yourself from FTP attacks shift the FTP service on other port. You will find that I have change port 21 into 2121. Here also change all the port numbers and save the file..... *SSH port forwarding Open file sshd_config from / etc/ssh/ssh_config Here you will find that by default port 22 is use as listen port which is badly affected by DDOS attack. Here to protect yourself apply port forwarding techniques on port 22. Again you will notice that I have change port 22 into port 2222. Now if you will scan your network with help of NMAP you will find that the services FTP, HTTP and SSH is successfully running on the modified ports. Nmap –p- -sV 192.168.0.10 Thanks for watching.... Like share & subscribe....