Skip to main content

Posts

Showing posts from April, 2013

Nmap technique for remote scan

Here are some really cool scanning techniques using Nmap
1) Get info about remote host ports and OS detection

nmap -sS -P0 -sV -O <target>

Where < target > may be a single IP, a hostname or a subnet

-sS TCP SYN scanning (also known as half-open, or stealth scanning)

-P0 option allows you to switch off ICMP pings.

-sV option enables version detection

-O flag attempt to identify the remote operating system

Other option:

-A option enables both OS fingerprinting and version detection

-v use -v twice for more verbosity.
nmap -sS -P0 -A -v < target >
2) Get list of servers with a specific port open

nmap -sT -p 80 -oG – 192.168.1.* | grep open

Change the -p argument for the port number. See “man nmap” for different ways to specify address ranges.
3) Find all active IP addresses in a network

nmap -sP 192.168.0.*

There are several other options. This one is plain and simple.

Another option is:

nmap -sP 192.168.0.0/24

for specific  subnets
4)  Ping a range of IP addresses

nmap -sP…

rsync trick to save sar log files in RedHat 5

rsync trick to save sar log files in RedHat 5
I have faced the problem while managing the log files of RHEL5. By default RHEL5 does not support to save the log more then 28 days.
What will you do if you need sar log file for making monthly report of server  activity? Solution: To Keep sysstat log files longer than 28 days limition, i use the following method with rsync to save the log file with monthly folder.its very easy to maintain the log file, just simply add the crontab in the /etc/cron.d/sysstat in the end of file#echo "55 11 * * * root /usr/bin/rsync /var/log/sa/sar`date +\%d` /var/log/sa/sar-`date +\%b\%Y`" >> /etc/cron.d/sysstatthis command will sync the file sar[two digit date] in the folder (if not exist then it will create it month and year wise"  at 11.55pm every night just after the sar file created on 11.53pm.--Rakesh