chattr被篡改

sudo apt-get upgrade 报错:

Reading package lists... Done                           
Building dependency tree                                
Reading state information... Done                       
You might want to run 'apt --fix-broken install' to corr
ect these.                                              
The following packages have unmet dependencies:          binutils : Depends: binutils-common (= 2.30-21ubuntu1~1
8.04.7) but 2.30-21ubuntu1~18.04.9 is installed                     Depends: libbinutils (= 2.30-21ubuntu1~18.04
.7) but 2.30-21ubuntu1~18.04.9 is installed             
            Depends: binutils-x86-64-linux-gnu (= 2.30-2
1ubuntu1~18.04.7)                                       
E: Unmet dependencies. Try 'apt --fix-broken install' wi
th no packages (or specify a solution).  

sudo apt --fix-broken install 报错:

dpkg: error processing archive /var/cache/apt/archives/b
inutils_2.30-21ubuntu1~18.04.9_amd64.deb (--unpack):    
 unable to make backup link of './usr/bin/strings' befor
e installing new version: Operation not permitted       
Errors were encountered while processing:               
 /var/cache/apt/archives/binutils_2.30-21ubuntu1~18.04.9
_amd64.deb                                              
E: Sub-process /usr/bin/dpkg returned an error code (1) 

原因:
之前挖矿病毒把chattr改了

解决:

nano chattr.c 
# 把源码粘进去
# https://github.com/posborne/linux-programming-interface-exercises/blob/master/15-file-attributes/chattr.c
cc chattr.c
mv a.out chattr
sudo ./chattr -ia /usr/bin/chattr
sudo mv ./chattr /usr/bin/chattr
sudo chattr -ia /usr/bin/strings
sudo apt --fix-broken install
sudo apt-get update && sudo apt-get upgrade

posted on 2023-12-03 21:30  HolaWorld  阅读(74)  评论(0编辑  收藏  举报

导航