Sunday, January 30, 2011

KEYLOGGER

KEYLOGGER _A software that is a hacker's best friend


Keystroke logging or commonly called Keylogger is a software thats serve the purpose of tracking (or logging) the keys struck on a keyboard, typically in a covert manner so that the person using the keyboard is unaware that their actions are being monitored. There are numerous keylogging methods, ranging from hardware and software-based approaches to electromagnetic and acoustic analysis.For more info on this topic plz visit the wikipedia link below:
http://en.wikipedia.org/wiki/Keylogger

This is a grt software and a small one too.Just use it for the purpose of knowledge and be aware of its misuse against you.
 you can download this software for the sites below:
http://www.keylogger.in/

http://www.brothersoft.com/downloads/key-logger.html

http://www.filebuzz.com/findsoftware/Keylogger_Home_Key_Logger_V1_70_Freeware/1.html

http://www.spyarsenal.com/

Saturday, January 8, 2011

How to backup data on UNIX ?

Hi All,
Backups are one of the major tasks that a Systems Administrator do. Here are few hints for the beginners. You will have to replace the tape device name with the one you are using. See some scripts here.
If you are in hurry and want to use ufsdump and ufsrestore, see example below.

Using cpio

Using cpio to create a file archive on a tape device:
   # find . -print |cpio -ocBv  /dev/rmt0
  Using cpio to list the entries in a file archive on a tape device:
   # cpio -itcvB < /dev/rmt0
  Using cpio to retrieve a file from a tape device:
   # cpio -icvdBum file.name < /dev/rmt0
  You can also use cpio to copy directory structure. For example copy
  Directory structure from current path to /export/home/tariq

   # find . -print|cpio -pmdv /export/home/tariq

Using tar


Using tar to create a file archive on a tape device:
   # tar -cvf /dev/rmt0 file.name   or
   # tar -cvf /dev/rmt0 .  
  or for multiple directory hierarchies
   # tar -crvf my.tar  `find /tmp/junk -type f` `find /var/tmp -type f`
  using tar to list the entries in a file archive on a tape device:
   # tar -tvf /dev/rmt0
  using tar to retrieve a file from a tape device:
   # tar -xvf /dev/rmt0 file.name
  there is more than one way to skin these cats, this being no comprehensive
  look at these utilities.

Using dump and restore (ufsdump, ufsrestore)

dump ( in solaris and others called ufsdump )is said to be the most reliable
  way to backup the whole   filesystem. restore is the utility for restoring 
  data from a dump. We can use restore interactively to restore certain files
  or directories.

  To make a dump of root filesystem on tape device /dev/nrsa0. Note
  that this is a non-rewinding device. See example below.
   # /sbin/dump -0ua -f /dev/nrsa0 /   
   or for solaris
  
   # /usr/sbin/ufsdump 0f /dev/rmt/0cn /
   To interactively restore a backup

   # /sbin/restore -i -f /dev/nrsa0  

   or for solaris

   # /usr/sbin/ufsrestore -xvf /dev/rmt/0cn

   Every thing will be restored in current directory.

Using mt command with dump and restore


mt (magnetic tape manipulating program) is a very useful command
  specialy if you are using dump and restore combination. 

  
  Following are some useful options of mt command.

  # mt status    Print status information about the tape unit.

  # mt rewind    Rewind the tape.

  # mt erase     Erase the tape.

  # mt retension Re-tension the tape (one full wind forth and back.

  # mt fsf 1     Forward space count by one file. One can be any number.

  -f option can be used with mt to specify the different device. For
  solaris /dev/rmt/0 is the default device.

  # mt -f /dev/rmt/1n fsf 3


Example

If you are backing up three filesystems /, /var and /usr on a solaris
    Box to a tape device:
    
     # /usr/sbin/ufsdump 0uf /dev/rmt/0n /      # /usr/sbin/ufsdump 0uf /dev/rmt/0n /var      # /usr/sbin/ufsdump 0uf /dev/rmt/0n /usr 
    This will take three file spaces, one for each filesystem. Filesystem / will
    be on file count 0 of tape and /var will be on file count 1 and /usr will be
    on file space 2. Option 0 specify full backup,u will update the dump record in
    /etc/dumpdates file and f to specify file or device. You can use following 
    command sequence to restore /var filesystem.

    # mt status
    This will show you the current status of tape. After the backup
    on a non-rewinding device, tape will show file number 2
   
    # mt rewind   
    This will rewind the tape to beginning.

    # mt status    
    Tape will be on file count 0

    # mt fsf 1 
    Tape will move to file count number 1 where /var is dumped.

    # /usr/sbin/ufsrestore -xvf /dev/rmt/0n
    /var will be restored in current. This will over-write the current contents.
    Use /dev/rmt/0cn for compression, no rewind device.

Commands for remote tape backup
It is often neccesary to backup into a remote machine's tape drive. Here are the commands that can be used to achieve this. Execute this command on the machine you want to backup.
$ tar cvf - $DIRNAME | rsh $SYS dd of=$TAPEDEV
Substitute
$DIRNAME with the directory to backup,
$SYS with the machine name with the tape drive,
$TAPEDEV with the tape device.
Note: You must be able to rlogin into the remote machine without a password. To do this add the name of your local machine with your user name in the .rhost file in your home directory on the remote machine.
To retrieve the backed up info...
rsh $REM dd if=$TAPEDEV | tar xvf -

Now some small scripts



#!/bin/sh
tar -cvf my.tar $(for i in `cat list`
   do
       echo $i
   done)
exit

This script is backing up to tape using dump command. Logging date and all the messages 
to a log file. 

#!/bin/sh
#
echo "$DATE"backup.log
filenumber=`/usr/bin/mt stat|/usr/bin/grep "File Number"|/usr/bin/awk '{print $3}'`
echo "Backing up / to tape location: $filenumber"backup.log
/sbin/dump -0ua -f /dev/nrsa0 / &2backup.log
if [ $? -eq 0 ];then
   echo "/ backup successful"$HOME/log/backup.log
fi

Copy files ( even complete filesystem) from remote to local system

Note: You must be able to rlogin into the remote machine without a password. To do this add the name of your local machine with your user name in the .rhost file in your home directory on the remote machine.


#!/bin/sh                                                       
#                                                              
# Copies files from Remote System to the local current directory 
#       
name=`basename $0`                  
if [ $# -ne 2 ];then
echo "Usage: $name <remote-system> <dir-to-copy>"
exit                                                            
fi                                                               
system=$1                                                   
dir_to_cp=$2                                                 
rsh $system "cd $dir_to_cp; find . -print|cpio -ocB"|dd ibs=5k obs=5k|cpio -iducmvB

Wednesday, January 5, 2011

Solaris Backup and Restore with ufsdump :- Some useful options

Hi All,

1. Backing up to a file:

root@host #  ufsdump -0f /admin/backup/etc.dump /etc
  DUMP: Date of this level 0 dump: Mon Jul 05 16:41:36 2010
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c1t0d0s0 (cat:/) to /admin/backup/etc.dump.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Writing 32 Kilobyte records
  DUMP: Estimated 148290 blocks (72.41MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: 147902 blocks (72.22MB) on 1 volume at 8136 KB/sec
  DUMP: DUMP IS DONE


2. Restoring data from backup file.

For non interactive (this will restore everything) restore:-

ufsrestore -xvf /admin/backup/etc.dump
for interactive restore:-
ufsrestore -ivf /admin/backup/etc.dump
Here is the proceedure to restore single file named hosts.090610 only.
 ufsrestore -ivf /admin/backup/etc.dump

root@host # ufsrestore -ivf etc.dump
Verify volume and initialize maps
Media block size is 126
Dump   date: Mon Jul 05 16:41:36 2010
Dumped from: the epoch
Level 0 dump of a partial file system on cat:/etc
Label: none
Extract directories from tape
Initialize symbol table.
ufsrestore >
ufsrestore > cd /etc
ufsrestore > ls hosts*
   1378  hosts
   5795  hosts.090610
ufsrestore >
ufsrestore > add hosts.090610
Warning: ./etc: File exists
ufsrestore > extract
Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
extract file ./etc/hosts.090610
Add links
Set directory mode, owner, and times.
set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y

3. Copying the contents of a directory to another directory including symbolic links. This is useful when you want to migrate data to new mount point or different path.

Here, all the data /etc will be copied to /admin/backup/etc.

root@host #mkdir /admin/backup/etc
root@host# ufsdump -0f  - /etc|(cd /admin/backup/etc;ufsrestore -xvf -).

Just before this command finish, it may prompt for setting ownership, it must be answered as yes.

After complete above command, if  you found that its restored using relative path, you can just use mv command to move the data.

For instance, if the restoration happend /admin/backup/etc/etc, you do a mv *  /admin/backup/etc/etc/* /admin/backup/etc.

Popular Posts

Followers

Disclaimer

All Data and Information Provided on This BLOG is only for Education purposes only.If you done any thing else these in real time the blog is not Responsible.Try all those on your own risk.
IF you find any thing else here as per in violation of copyright law .mail me on srinathceh@gmail.com as soon as possible action will be taken.