问题描述
请注意:要查看对此的评论以及对此的扩展讨论(其中包括所有已尝试过的内容),请查看 this chat room 。
今天,当我运行 cat
命令时,我得到的不是文件内容,而是:
Hello, nothing to see here! Move along!
我已经检查以确保 cat
文件在上次使用后没有被更改,所以我确信 /bin
中的 cat 文件没有被更改,所以当我输入 cat
时必须运行其他东西,而不是正确的 cat
程序…但我不明白这是如何发生的…
所以我想我应该在这里问一下,为什么会发生这种情况以及如何解决它?
信息更新:
我已检查我的 .bash_aliases
文件,并且没有 cat
别名,我的 .bashrc
文件中也没有指向正确别名的别名。
strings $(command -v cat)
的输出是:
#!/bin/bash
echo "Hello, nothing to see here! Move along!"
type cat
的输出是:
cat is /bin/cat
文件cat
的sha256sum
是:
a80c46f9c73190d6b46bdf444ade76d05ce113a21dbab7b805dde5027816aa48
strace cat
的输出是:
execve("/bin/cat", ["cat"], [/* 61 vars */]) = 0
brk(0) = 0x1833000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b44e000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=122452, ...}) = 0
mmap(NULL, 122452, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0f0b430000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\v\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1869392, ...}) = 0
mmap(NULL, 3972864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0f0ae63000
mprotect(0x7f0f0b023000, 2097152, PROT_NONE) = 0
mmap(0x7f0f0b223000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f0f0b223000
mmap(0x7f0f0b229000, 16128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b229000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b42f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b42e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b42d000
arch_prctl(ARCH_SET_FS, 0x7f0f0b42e700) = 0
mprotect(0x7f0f0b223000, 16384, PROT_READ) = 0
mprotect(0x60b000, 4096, PROT_READ) = 0
mprotect(0x7f0f0b450000, 4096, PROT_READ) = 0
munmap(0x7f0f0b430000, 122452) = 0
brk(0) = 0x1833000
brk(0x1854000) = 0x1854000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=5418528, ...}) = 0
mmap(NULL, 5418528, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0f0a938000
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
fadvise64(0, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
mmap(NULL, 139264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b40b000
read(0,
我注意到的另一件事是这个问题不会影响系统上的其他用户。
echo $PATH
输出:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/neo/jdk1.8.0_45/bin
printenv
的输出是:
XDG_VTNR=7
XDG_SESSION_ID=c2
CLUTTER_IM_MODULE=xim
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/neo
SESSION=ubuntu
GPG_AGENT_INFO=/run/user/1000/keyring/gpg:0:1
TERM=xterm
SHELL=/bin/bash
VTE_VERSION=3803
WINDOWID=81788939
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1640
GNOME_KEYRING_CONTROL=
GTK_MODULES=overlay-scrollbar:unity-gtk-module
USER=neo
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/neo/jdk1.8.0_45/bin
DESKTOP_SESSION=ubuntu
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=appmenu-qt5
XDG_SESSION_TYPE=x11
JOB=unity-settings-daemon
PWD=/home/neo
XMODIFIERS=@im=ibus
GNOME_KEYRING_PID=
LANG=en_GB.UTF-8
GDM_LANG=en_GB
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
IM_CONFIG_PHASE=1
COMPIZ_CONFIG_PROFILE=ubuntu
JAVA_TOOL_OPTIONS=-javaagent:/usr/share/java/jayatanaag.jar
GDMSESSION=ubuntu
SESSIONTYPE=gnome-session
XDG_SEAT=seat0
HOME=/home/neo
SHLVL=1
LANGUAGE=en_GB:en
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
UPSTART_INSTANCE=
UPSTART_EVENTS=xsession started
XDG_SESSION_DESKTOP=ubuntu
LOGNAME=neo
COMPIZ_BIN_PATH=/usr/bin/
QT4_IM_MODULE=xim
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9BqFSNNHkf
LESSOPEN=| /usr/bin/lesspipe %s
INSTANCE=
UPSTART_JOB=unity7
XDG_RUNTIME_DIR=/run/user/1000
DISPLAY=:0
XDG_CURRENT_DESKTOP=Unity
GTK_IM_MODULE=ibus
LESSCLOSE=/usr/bin/lesspipe %s %s
HISTTIMEFORMAT=%d/%m/%y %T
XAUTHORITY=/home/neo/.Xauthority
_=/usr/bin/printenv
操作系统信息:
Description: Ubuntu 15.04
Release: 15.04
套餐信息:
coreutils:
Installed: 8.23-3ubuntu1
Candidate: 8.23-3ubuntu1
Version table:
*** 8.23-3ubuntu1 0
500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
100 /var/lib/dpkg/status
最佳方法
好吧,所以聊天会话中指示的所有内容似乎都表明您的计算机被黑客入侵了。\n不幸的是,我们无法查明是谁,最重要的是,如何查明。\n无论如何,无论是谁做了这件事,似乎都厌倦了游戏并放弃了。\n在此之后,可以使用 sudo rm /usr/local/bin/cat2
解决 cat
问题(注意,潜在危险的命令!)
您现在应该格式化硬盘并从头开始重新安装 Ubuntu。\n我认为您在这方面遇到的问题是另一个 “Ask Ubuntu” 问题的内容,比我更有知识的人将能够帮助您。
祝您重新安装好运。