<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/htb-principal-zkodzkeg6" -->

---
title: HTB: Principal | daily.dev
description: A walkthrough of the HackTheBox machine 'Principal', a Linux box running a Java/Spring Boot web app using pac4j for JWT authentication. The exploit chain...
canonical: https://daily.dev/posts/htb-principal-zkodzkeg6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: HTB: Principal | daily.dev
og:description: A walkthrough of the HackTheBox machine 'Principal', a Linux box running a Java/Spring Boot web app using pac4j for JWT authentication. The exploit chain...
og:url: https://daily.dev/posts/htb-principal-zkodzkeg6
og:image: https://api.daily.dev/og/posts/zkodZkEg6.png
og:image:alt: HTB: Principal
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HTB: Principal

**[0xdf hacks stuff](https://daily.dev/sources/0xdf)** · 17 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of the HackTheBox machine 'Principal', a Linux box running a Java/Spring Boot web app using pac4j for JWT authentication. The exploit chain starts with CVE-2026-29000, a vulnerability in pac4j-jwt that allows forging encrypted JWTs (JWE) using only the server's RSA public key — bypassing signature verification by wrapping a PlainJWT (alg:none) inside a JWE. This grants admin dashboard access, where credentials are found in settings. Password spraying those credentials against SSH yields a shell as svc-deploy. Privilege escalation to root abuses access to an SSH certificate authority private key in /opt/principal/ssh, allowing signing a certificate for the root principal and SSHing in as root.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://0xdf.gitlab.io/2026/03/30/htb-principal.html>

## Similar posts on daily.dev

- [HTB — Strutted Writeup: Linux Machine](https://daily.dev/posts/htb-strutted-writeup-linux-machine-x6cn8azui) · InfoSec Write-ups · 1 upvotes · 0 comments
- [HTB: Barrier](https://daily.dev/posts/htb-barrier-5m5e3sa5g) · 0xdf hacks stuff · 0 upvotes · 0 comments
- [CVE-2026-29000](https://daily.dev/posts/cve-2026-29000-ac6dexegl) · Arctic Wolf · 0 upvotes · 0 comments
- [CodePartTwo HTB Walkthrough](https://daily.dev/posts/codeparttwo-htb-walkthrough-gzwjbhyde) · InfoSec Write-ups · 1 upvotes · 0 comments
- [HTB: HackNet](https://daily.dev/posts/htb-hacknet-ytv8gsdvp) · 0xdf hacks stuff · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#java](https://daily.dev/tags/java), [#jwt](https://daily.dev/tags/jwt)

[View this post on daily.dev](https://daily.dev/posts/htb-principal-zkodzkeg6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"HTB: Principal","url":"https://daily.dev/posts/htb-principal-zkodzkeg6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/htb-principal-zkodzkeg6"},"datePublished":"2026-03-30T09:17:02.879Z","dateModified":"2026-03-30T09:17:37.307Z","description":"A walkthrough of the HackTheBox machine 'Principal', a Linux box running a Java/Spring Boot web app using pac4j for JWT authentication. The exploit chain...","image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","thumbnailUrl":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","isAccessibleForFree":true,"articleSection":"0xdf hacks stuff","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"0xdf hacks stuff","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/16cdada70d5f4fac8b588c53bcf005ff","url":"https://daily.dev/sources/0xdf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/htb-principal-zkodzkeg6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,java,jwt","timeRequired":"PT17M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"0xdf hacks stuff","item":"https://daily.dev/sources/0xdf"},{"@type":"ListItem","position":3,"name":"HTB: Principal"}]}
```

