홈 디렉토리에 Typescript라는 이상한 파일이 있습니다.

홈 디렉토리에 Typescript라는 이상한 파일이 있습니다.

갑자기 내 사용자 홈 디렉터리에 이 "Typescript" 파일이 보이기 시작했고 호기심이 생겨서 열어보니 다음과 같습니다.

Script started on 2020-04-11 20:59:06+0600
]0;root@abar: /home/abartoharoot@abar:/home/abartoha# i a

Command 'i' not found, but can be installed with:

apt install iprint

]0;root@abar: /home/abartoharoot@abar:/home/abartoha# iprint

Command 'iprint' not found, did you mean:

  command 'qprint' from deb qprint
  command 'print' from deb mime-support

Try: apt install <deb name>

]0;root@abar: /home/abartoharoot@abar:/home/abartoha# list

Command 'list' not found, did you mean:

  command 'hist' from deb loki
  command 'bist' from deb bist
  command 'klist' from deb heimdal-clients
  command 'klist' from deb krb5-user
  command 'flist' from deb mmh
  command 'flist' from deb nmh
  command 'mlist' from deb mblaze
  command 'last' from deb util-linux
  command 'dist' from deb mmh
  command 'dist' from deb nmh
  command 'lift' from deb lift
  command 'gist' from deb yorick

Try: apt install <deb name>

]0;root@abar: /home/abartoharoot@abar:/home/abartoha# kclose

Command 'kclose' not found, did you mean:

  command 'gclose' from deb gnustep-gui-runtime

Try: apt install <deb name>

]0;root@abar: /home/abartoharoot@abar:/home/abartoha# close

Command 'close' not found, did you mean:

  command 'gclose' from deb gnustep-gui-runtime

Try: apt install <deb name>

]0;root@abar: /home/abartoharoot@abar:/home/abartoha# help
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                            history [-c] [-d offset] [n] or hist>
 (( expression ))                        if COMMANDS; then COMMANDS; [ elif C>
 . filename [arguments]                  jobs [-lnprs] [jobspec ...] or jobs >
 :                                       kill [-s sigspec | -n signum | -sigs>
 [ arg... ]                              let arg [arg ...]
 [[ expression ]]                        local [option] name[=value] ...
 alias [-p] [name[=value] ... ]          logout [n]
 bg [job_spec ...]                       mapfile [-d delim] [-n count] [-O or>
 bind [-lpsvPSVX] [-m keymap] [-f file>  popd [-n] [+N | -N]
 break [n]                               printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]       pushd [-n] [+N | -N | dir]
 caller [expr]                           pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...)>  read [-ers] [-a array] [-d delim] [->
 cd [-L|[-P [-e]] [-@]] [dir]            readarray [-n count] [-O origin] [-s>
 command [-pVv] command [arg ...]        readonly [-aAf] [name[=value] ...] o>
 compgen [-abcdefgjksuv] [-o option] [>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DE] >  select NAME [in WORDS ... ;] do COMM>
 compopt [-o|+o option] [-DE] [name ..>  set [-abefhkmnptuvxBCHP] [-o option->
 continue [n]                            shift [n]
 coproc [NAME] command [redirections]    shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFgilnrtux] [-p] [name[=v>  source filename [arguments]
 dirs [-clpv] [+N] [-N]                  suspend [-f]
 disown [-h] [-ar] [jobspec ... | pid >  test [expr]
 echo [-neE] [arg ...]                   time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [na>  times
 eval [arg ...]                          trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [argume>  true
 exit [n]                                type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or ex>  typeset [-aAfFgilnrtux] [-p] name[=v>
 false                                   ulimit [-SHabcdefiklmnpqrstuvxPT] [l>
 fc [-e ename] [-lnr] [first] [last] o>  umask [-p] [-S] [mode]
 fg [job_spec]                           unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMAND>  unset [-f] [-v] [-n] [name ...]
 for (( exp1; exp2; exp3 )); do COMMAN>  until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name >  variables - Names and meanings of so>
 getopts optstring name [arg]            wait [-n] [id ...]
 hash [-lr] [-p pathname] [-dt] [name >  while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]               { COMMANDS ; }
]0;root@abar: /home/abartoharoot@abar:/home/abartoha# helpclosekclose[2Plistiprint[3P aclear[3Pfgclearfgclea[1Pclear[3Pfgclearwifiteeifite[4Psuunsuputhon ./home/abartoha/script.py
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cclear[Kpython[1Pclearpythonscript.py[6Pdirclearscript.pyu --loginh[Kclearsuundo --loginabartoha[6Pclearsu abartoha[1PCOMMAND[5Pclearsu -shclearclear[6Phelp[1P--h[1Ph-help[4Pfgwifiteexit()[Kwifite[4Pjjwifite clee[Kar

[32m  .;'                     `;,    
[32m .;'  ,;'             `;,  `;,   [0mWiFite v2 (r87)
[32m.;'  ,;'  ,;'     `;,  `;,  `;,  
[32m::   ::   :   [37m( )[32m   :   ::   ::  [37mautomated wireless auditor
[32m':.  ':.  ':. [37m/_\[32m ,:'  ,:'  ,:'  
[32m ':.  ':.    [37m/___\[32m    ,:'  ,:'   [37mdesigned for Linux
[32m  ':.       [37m/_____\[32m      ,:'     
[32m           [37m/       \[32m             
[0m
usage: wifite [-h] [--check CHECK] [--cracked] [--recrack] [--all]
              [-i INTERFACE] [--mac] [--mon-iface MONITOR_INTERFACE]
              [-c CHANNEL] [-e ESSID] [-b BSSID] [--showb] [--nodeauth]
              [--power POWER] [--tx TX] [--quiet] [--wpa] [--wpat WPAT]
              [--wpadt WPADT] [--strip] [--crack] [--dict DIC] [--aircrack]
              [--pyrit] [--tshark] [--cowpatty] [--wep] [--pps PPS]
              [--wept WEPT] [--chopchop] [--arpreplay] [--fragment]
              [--caffelatte] [--p0841] [--hirte] [--nofakeauth]
              [--wepca WEPCA] [--wepsave WEPSAVE] [--wps] [--pixie]
              [--wpst WPST] [--wpsratio WPSRATIO] [--wpsretry WPSRETRY]
wifite: error: unrecognized arguments: clear
]0;root@abar: /home/abartoharoot@abar:/home/abartoha# clear
[3J[H[2J]0;root@abar: /home/abartoharoot@abar:/home/abartoha# history 0c
bash: history: 0c: numeric argument required
]0;root@abar: /home/abartoharoot@abar:/home/abartoha# clear
[3J[H[2J]0;root@abar: /home/abartoharoot@abar:/home/abartoha# help\[K
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                            history [-c] [-d offset] [n] or hist>
 (( expression ))                        if COMMANDS; then COMMANDS; [ elif C>
 . filename [arguments]                  jobs [-lnprs] [jobspec ...] or jobs >
 :                                       kill [-s sigspec | -n signum | -sigs>
 [ arg... ]                              let arg [arg ...]
 [[ expression ]]                        local [option] name[=value] ...
 alias [-p] [name[=value] ... ]          logout [n]
 bg [job_spec ...]                       mapfile [-d delim] [-n count] [-O or>
 bind [-lpsvPSVX] [-m keymap] [-f file>  popd [-n] [+N | -N]
 break [n]                               printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]       pushd [-n] [+N | -N | dir]
 caller [expr]                           pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...)>  read [-ers] [-a array] [-d delim] [->
 cd [-L|[-P [-e]] [-@]] [dir]            readarray [-n count] [-O origin] [-s>
 command [-pVv] command [arg ...]        readonly [-aAf] [name[=value] ...] o>
 compgen [-abcdefgjksuv] [-o option] [>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DE] >  select NAME [in WORDS ... ;] do COMM>
 compopt [-o|+o option] [-DE] [name ..>  set [-abefhkmnptuvxBCHP] [-o option->
 continue [n]                            shift [n]
 coproc [NAME] command [redirections]    shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFgilnrtux] [-p] [name[=v>  source filename [arguments]
 dirs [-clpv] [+N] [-N]                  suspend [-f]
 disown [-h] [-ar] [jobspec ... | pid >  test [expr]
 echo [-neE] [arg ...]                   time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [na>  times
 eval [arg ...]                          trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [argume>  true
 exit [n]                                type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or ex>  typeset [-aAfFgilnrtux] [-p] name[=v>
 false                                   ulimit [-SHabcdefiklmnpqrstuvxPT] [l>
 fc [-e ename] [-lnr] [first] [last] o>  umask [-p] [-S] [mode]
 fg [job_spec]                           unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMAND>  unset [-f] [-v] [-n] [name ...]
 for (( exp1; exp2; exp3 )); do COMMAN>  until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name >  variables - Names and meanings of so>
 getopts optstring name [arg]            wait [-n] [id ...]
 hash [-lr] [-p pathname] [-dt] [name >  while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]               { COMMANDS ; }
]0;root@abar: /home/abartoharoot@abar:/home/abartoha# helpclearhistory 0c[5Pclearwifite clear[8Phelpclosekclose[2Plistiprint[3P aclear[3Pfgclearfgclea[1Pclear[3Pfgclearwifiteeifite[4Psuunsuputhon ./home/abartoha/script.py
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cclear[Kpython[1Pclearpythonscript.py[6Pdirclearscript.pyu --loginh[Kclearsuundo --loginabartoha[6Pclearsu abartoha[1PCOMMAND[5Pclearsu -shclearclear[6Phelp[1P--h[1Ph-help[4Pfgwifiteexit()[Kwifite[4Pjjwifite jj[Kwifite[2Pexit()wifite[4Pfg--help[Kh-hhelpclearclear[Ksu -hsclearsu COMMANDabartoha[6Pclearsu abartoha[1P--login[4Pundo[1Pclearsu -h-login[1Pcript.py[4Pclear[2Pdirscript.py[3Ppython[1Pclearpython[1Pclearputhon ./home/abartoha/script.py
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cunsu[K[2Psueifitewifite[1Pclear[3Pfgclearfgclea[1Pclear[3Pfgclear[2Pi aprint[2Plistkclose[1Pclose[1Phelpwifite clear[7Pclearhistory 0c[5Pclear[1Phelp[Khistory -c
]0;root@abar: /home/abartoharoot@abar:/home/abartoha# e[Kexit

모르겠어요. 추측이 좀 있지만 좋은 사람이 현실을 제공할 수 있었으면 좋겠어요. 저는 Linux Mint, Windows on SSD, Linux on HDD를 사용합니다. 여기까지 머물러 주셔서 감사합니다.

답변1

작년(2020년) 4월 11일에 이 script명령을 실행했습니다( 참조 man script). 실행되면 터미널의 모든 입력과 출력을 캡처하여 로그 파일에 기록합니다. 기본적으로 이 파일은 호출되어 typescript현재 디렉터리에 기록됩니다.

세션 로그 캡처

script
Script started, file is typescript
~$ date
19 Feb 2021 10:07:29
~$ exit
exit
Script done, file is typescript

로그 파일 보기

cat typescript
Script started on 2021-02-19 10:07:27+00:00 [TERM="xterm" TTY="/dev/pty0" COLUMNS="112" LINES="24"]
~$ date
19 Feb 2021 10:07:29
~$ exit
exit

Script done on 2021-02-19 10:07:31+00:00 [COMMAND_EXIT_CODE="0"]

쉘 프롬프트, 이스케이프 코드 시퀀스, 잘못된 입력에서 제거된 콘텐츠를 포함하여 거의 모든 것이 캡처되는 것을 확인할 수 있습니다. (이와 같은 로그 파일을 연구할 때 단순히 이해하지 않는 한 전체 화면 편집 세션을 이해하는 것은 거의 불가능합니다 cat.)

관련 정보