Author: Ruwantha Nissanka

Netstat : Master it with these 6 steps

Netstat is a command line utility that can be used to list out all the network connections on a system. It lists out all the tcp, udp socket connections and the unix socket connections. Netstat also displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc. In this guide, we will see how to use this tool to gather information about network connections and open ports on a system. Step 01 : List all connections with netstat To view all the network connections, simply run the following command #netstat -a Step 02 : View network interfaces with netstat You can view the network interfaces in your system by using the following command #netstat -i To get a more simple and readable output from the above command, use the -e option along with -i #netstat -ie Step 03 : View only active connections You can get the list of already active connections by using the grep along with netstat command. These connections are tagging ”ESTABLISHED” state #netstat -atnp | grep ESTA Step 04 : List only TCP or UDP connections Use the -t option along with netstat command to list only tcp connections. #netstat -at Use the -u option to list only udp connections. #netstat -au Step 05 : Check open ports that are listening to a service In Linux, Services are using...

Read More

Netcat : The swiss Army knife You must have

Netcat (also known as ‘nc’) is a networking tool used for reading or writing from TCP and UDP sockets using an easy interface. It is designed as a dependable ‘back-end’ device that can be used directly or easily driven by other programs and scripts. Therefore, this tool is a treat to network administrators, programmers, and pen-testers as it’s a feature rich network debugging and investigation tool. To open netcat simply go to your shell and enter ‘nc’: #nc Connecting to a host with Netcat Use the -u option to start a TCP connection to a specified host and port: #nc -u <host_ip> <port> Listen to inbound connections You can set nc to listen on a port using -l option #nc -l <port> Scan ports with Netcat This can easily be done using the ‘-z’ flag which instructs netcat not to initiate a connection but just check if the port is open. For example, In the following command we instruct netcat to check which ports are open between 80 and 100 on ‘localhost‘ #nc -z <host_ip> <port_range> Advanced port scan To run an advanced port scan on a target, use the following command #nc -v -n -z -w1 -r <target_ip> This command will attempt to connect to random ports (-r) on the target ip running verbosely (-v) without resolving names (-n). without sending any data (-z) and waiting no more than 1...

Read More

Mtr : Stop using ping and traceroute anymore

In today’s guide, we are going to look at the mtr command and see what it can tells us about network connections.  Mtr is a simple linux command line tool that you can use for network diagnostic and troubleshooting in linux. It comes with the options of both ping and traceroute commands. Just like a typical traceroute query, a query from the MTR command will show the route from a computer to a specified host. The advantage over using the ping and traceroute commands is that Mtr will provide a lot of statistics about each hop, like response time and percentage. This tool comes pre-installed on most of the linux distros. However you can also install it manually using the following command. Step 01 : Installation #sudo apt install mtr Step 02 : Get the basic report To get the basic traceroute report using Mtr, run the following command #sudo mtr <domain_name/ip_address> Step 03 : view the numeric IP addresses You can use the -g option with mtr command to view the numeric IP addresses instead of the hostnames in the traceroute report. #sudo mtr -g < domain_name/ip_address> Step 04 : Manually set the number of pings you can manually set the number of pings that you want to send using -c option #sudo mtr -c <number_of_pings> <domain_name/ip_address> Step 05 : print the output to a text file If you need to...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.