How to Secure Your Port using Port Forwarding

In this article, 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 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 Forwarding

Open ports.conf file from inside /etc/apache2 and type following command to read the configuration.

 From the screenshot,t you can view the present listening port 80 and 443 for the web server.

If an attacker wants to send a malicious file through web server he will try to connect with the 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.

FTP Port Forwarding

Now open the vsftpd.conf file from inside /etc.

From screenshots,t you can view listen port is 21 by default, to protect yourself from FTP attacks shift the FTP service on other port.

From given below screenshot you will find that I have change port21 into 2121

SSH Port Forwarding

 Open file sshd_config from / etc/ssh/ssd_config

From the screenshot, you will find that by default port 22 is use as listen port which is badly affected by a DDOS attack. Here to protect yourself apply port forwarding techniques on port 22.

From the below image, 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.

Author: AArti Singh is a Researcher and Technical Writer at Hacking Articles an Information Security Consultant Social Media Lover and Gadgets. Contact here

Leave a Reply

Your email address will not be published. Required fields are marked *