Using NMAP for Ping Sweep and OS Detection August 30, 2010
Posted by networknuts in Uncategorized.Tags: alok srivastava, best training institute, linux blog, linux delhi, linux training, linux videos, networknuts, nmap, nmap tutorial, redhat, redhat india, rhce, rhce delhi, rhce india, rhcss, rhcss delhi, rhcss india, using nmap
2 comments
Ping Sweeping is the process of pinging numerous hosts. In the case of a large set of target IP addresses, one must perform a ping sweep to determine alive hosts that respond to ICMP echo requests. This information can be very useful for a administrator checking his network status.
We can use “nmap” for this purpose.
Step #1. Install NMAP
You can either use the Internet repositories for this purpose and use:
yum install nmap
or you can manuall download the nmap package from this link – http://nmap.org/download.html
Step #2.Use nmap for Ping Sweep
nmap -sP 172.24.0.*
In this case I am trying to use ping-sweep to scan my whole network to find out which machines are LIVE and KICKING right now.
Here is what I get from this simple command. :P
NMAP is so wonderful tool in your hands that it can be used for many purposes.
One more very simple, very interesting and very important job that nmap can perform is that it can also give you the OS details of your machines running within your domain.
Using nmap for OS detection:
nmap -O 172.24.0.*
Just give this command and see ALL your machines telling their OS’s to you.
Below is what I get !!
To watch the video of this post on Network NUTS YouTube channel – http://www.youtube.com/watch?v=WMPr4dvdo74
God Bless !!
Enjoy your EDGE !!
Bash Shell script to check the existence of a file under your linux filesystem August 3, 2010
Posted by networknuts in Uncategorized.Tags: bash shell scripting, delhi linux, linux delhi, linux training, Network NUTS, redhat, redhat linux, rhce, rhce delhi, rhce india, rhcss, rhcss delhi, rhcss india, rhcva, shell scripting, training
1 comment so far
Here is a very small but useful shell script that will check the existence of a file and report accordingly.
#!/bin/bash
#by alok srivastava
#check the existence of a file under your filesystem
#this bash shell script use "positional parameters"file=$1
[ $# -eq 0 ] && { echo "Usage: $0 filename"; exit 999; }
if [ -f $file ];
then
echo "YES - File $file exists."
else
echo "NO - File $file does NOT exists."
fi
It can be very useful while creating more complex bash shell scripts.
Here is a sample execution shown for your reference:




