The ss command. A very useful way to find open and listening ports on a Linux system.

The ss command for Linux allows a user to list all listening ports on a Linux system. This command lists all listening TCP ports. homer@deusexmachina ~ $ ss -l -t State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 1 127.0.0.1:4101 *:* LISTEN 0 50 *:netbios-ssn *:* LISTEN 0 128 *:sunrpc *:* LISTEN 0 128 … Read more

How to use ipgrab to capture TCP packets that are travelling through a network interface.

How to use ipgrab to capture TCP packets. The ipgrab command when run as root is very useful for capturing information about network packets that are traveling through your network interfaces. In this example I am capturing packets from my wlan0 interface. ubuntu ~ $ sudo ipgrab -i eth0 > capture.log ipgrab 0.9.10 Listening on … Read more

How to use the hping3 command on Linux to ping websites with TCP SYN packets instead of ICMP.

This posting will explain the workings of the hping3 command. This is a command that may be run as the superuser to ping a website with TCP packets instead of the default ICMP packets used by the ping command. This is an example; I am sending some TCP SYN packets to the http://hackthissite.com to ping … Read more

Useful code snippets and commands for Linux.

Ralph using a computer.

Alternatives to the ping and traceroute commands on a Linux system There are many alternatives to the ping and traceroute commands on a Linux system. The mtr command is one of them. This command will trace the route the network packets are taking to the target IP address. bash 06:42:02 Mon Jul 22 [homer@deep-thought $ … Read more

A script I wrote that checks whether a host is reachable by various protocols like ICMP & TCP.

A nice script that will check if a host is up or not. #!/usr/bin/perl   use warnings; use strict;   use Net::Ping;   # code source: http://www.perlmonks.org/?node_id=943892 # More: http://stackoverflow.com/questions/3960595/how-can-i-ping-a-host-with-a-perl-one-liner-with-netping   #$| = 1; print "Please type a host to check: -:\n"; my $host = <>; #Reading input from STDIN.   if (length($host) < 3) … Read more