منبع اصلی نوشتار زیر در این لینک قرار دارد

خط فرمان و ضبط آن

امیدواریم این مطلب مفید بوده باشد . از اینکه سایت تبریکس را انتخاب کردید متشکریم .

سلام خدمت دوستان و همراهان گرامی .

در این قسمت به بررسی دستوری خواهیم پرداخت که شما با استفاده از این دستور میتوانید هر آنچه در ترمینال تایپ میکنید را ضبط کرده و در زمان های که مد نظر شماست ببینید . به دوستان بدهید تا از آن استفاده کنند یا یک مفهوم key logger  ایجاد کنید برای سرور خودتان و …

در اینجا به بررسی دستور ttyrec  خواهیم پرداخت . بعد از نصب این دستور دستورات ttyplay,ttytime  نیز اضافه خواهد شد .  حال نحوه نصب این برنامه :

sudo apt-get install ttyrec

بعد از نصب با دستور ttyrec  میتوان اقدام به ضبط کرد .

 

ttyrec test

 

در اینجا ما یک فایل ایجاد کردیم به نام test  اگر نام فایل مورد نظر را ننویسیم به صورت پیش فرض ttyrec  نامگذاری خواهد شد .  و برای اتمام ضبط باید در آخر از کلمه exit  استفاده نمود .

 

با دستور ttyplay  میتوان اقدام به پخش شل ضبط شده پرداخت . و با دستور ttytime  هم میتوان به زمان شل ضبط شده پی برد .

 

 

شکل کلی راهنمای  دستور به صورت زیر است .

 

 

 

TTYREC(1)                                                                                                                                       TTYREC(1)

NAME
       ttyrec – a tty recorder

SYNOPSIS
       ttyrec [-a] [-u] [-e command] [file]

DESCRIPTION
       Ttyrec  is  a  tty  recorder.  It is a derivative of script(1) command for recording timing information with microsecond accuracy as well.  It can
       record emacs -nw, vi, lynx, or any programs running on tty.

       Ttyrec invokes a shell and records the session until the shell exits.  Recorded data can be played back with ttyplay(1).  If the argument file  is
       given, the session will be recorded in that file.  Otherwise, ttyrecord is used as default.

OPTIONS
       -a     Append the output to file or ttyrecord, rather than overwriting it.

       -u     With  this  option, ttyrec automatically calls uudecode(1) and saves its output when uuencoded data appear on the session.  It allow you to
              transfer files from remote host.  You can call ttyrec with this option, login to the remote host and invoke uuencode(1) on it for the  file
              you want to transfer.

       -e command
              Invoke command when ttyrec starts.

ENVIRONMENT
       SHELL  If  the  variable SHELL exists, the shell forked by ttyrec will be that shell.  If it's not set, the Bourne shell is assumed.  (Most shells
              set this variable automatically).

SEE ALSO
       script(1), ttyplay(1), ttytime(1), uuencode(1), uudecode(1)

                                                                                                                                                TTYREC(1)

 

در اینجا به بررسی راهنمای ttyplay  خواهیم پرداخت که میتوان به صورت سریع نیز اقدام به مشاهده شل ضبط شده پرداخت .

 

 

TTYPLAY(1)                                                                                                                                     TTYPLAY(1)

NAME
       ttyplay – player of the tty session recorded by ttyrec

SYNOPSIS
       ttyplay [-s SPEED] [-n] [-p] file

DESCRIPTION
       Ttyplay plays the tty session in file, which was recorded previously by ttyrec(1).

       When -p option is given, ttyplay output the file as it grows.  It means that you can see the "live" shell session running by another user.

       If you hit any key during playback, it will go right to the next character typed.  This is handy when examining sessions where a user spends a lot
       of time at a prompt.

       Additionally, there are some special keys defined:

       + or f
               double the speed of playback.

       – or s
               halve the speed of playback.

       0      set playback speed to 0, pausing playback.

       1      set playback to speed 1.0 again.

OPTIONS
       -s SPEED
              multiple the playing speed by SPEED (default is 1).

       -n     no wait mode.  Ignore the timing information in file.

       -p     peek another person's tty session.

SEE ALSO
       script(1), ttyrec(1), ttytime(1)

                                                                                                                                               TTYPLAY(1)

 

 

 

نوشته خط فرمان و ضبط آن اولین بار در مرجع اپن سورس ، گنو/لینوکس پدیدار شد.



برچسب ها : , , , , , , ,