Linux Unix help !!

"Give respect to Time, One day at right Time, Time will respect You"
Showing posts with label namp command linxu. Show all posts
Showing posts with label namp command linxu. Show all posts

Thursday, January 27, 2011

nmap command magic linux

nmap : Network exploration tool and security / port scanner
   Display open port number and protocol, service name, and state
  
   Syantax:
   nmap options hostnames/IPaddresses/networks
   -A, to enable OS and version detection(A detailed scan)
   -T4 for faster execuation of cmd
   -iL InputFileName contain list of IPS/hostname etc..
   --excludefile ExcludeFileName
   -sL: List Scan
   -sP: Ping Scan
   -pPortNo  EG: -P22 etc...
   -e eth0 : scan particulat interface
   --packet-trace  IP/Hostname : Show all packets sent and received
   --iflist : list all active links info MAc add etc..
  
If system ports have been changed for a particular application service
and is open then you can trace it
EG:
server1.example.com : vi /etc/ssh/sshd_conf
#Port 22  --> Port 1022 (For ssh changed to 22 to 1022 )

Now scan from system1.example.com:
# nmap -v -A server1.example.com  (An detailed OS scan)

1022/tcp open  ssh         OpenSSH 4.3 (protocol 2.0)
  
OR:
#nmap -T4 -sV server1.example.com (An detailed open port scan)

Examples:  
# nmap -T4 -p22 192.168.8.10          :Scan for port 22
# nmap 192.168.8.10 |grep -i tcp      :Opend TCP ports

# nmap -sP 192.168.8.*                :Which hosts in my subnet
eg. output:
Host ntp.example.com (192.168.8.7) appears to be up.
MAC Address: 00:0C:29:3C:4D:66 (VMware)
Host ns1.example.com (192.168.8.8) appears to be up.
MAC Address: 00:0C:29:3C:4D:66 (VMware)
Host mail.example.com (192.168.8.9) appears to be up.
MAC Address: 00:0C:29:3C:4D:66 (VMware)
Host server.example.com (192.168.8.10) appears to be up.
MAC Address: 00:0C:29:3C:4D:66 (VMware)
Host client.example.com (192.168.8.20) appears to be up.
Nmap finished: 256 IP addresses (5 hosts up) scanned in 9.375 seconds


# Faced any problem Feedback in above contact me
#===============================Scratch===============================#
# AND Many More .....................Linux is Endless                 #
#========================== Hope you Liked IT ========================#
#                                       nmap cmd -- BY Shirish Shukla #
#                                                   RHC Engineer 2010 #
#                                             shirish.linux@gmail.com #
#                                           shirishlinux.blogspot.com #
# "Give Respect To Time One Day At Right Time, Time Will Respect You" #
#=====================================================================#
# TRy Hard theres nothing that are un-achievable by HARDdd-WORKkk     #
#=====================================================================#

Followers

Pls LIKE my Story !!!