with this we can login to gitea as rosa did not work and also ssh with axel and user flag
find / -type f -name "*.db" 2>/dev/null
cat.db has the users, the same that we dumped with sqlinjection
now with exploit as gitea is vulnerable to xss and following instructions from exploit
From rosa@cat.htb Sat Sep 28 04:51:50 2024Return-Path: <rosa@cat.htb>Received: from cat.htb (localhost [127.0.0.1]) by cat.htb (8.15.2/8.15.2/Debian-18) with ESMTP id 48S4pnXk001592 for <axel@cat.htb>; Sat, 28 Sep 2024 04:51:50 GMTReceived: (from rosa@localhost) by cat.htb (8.15.2/8.15.2/Submit) id 48S4pnlT001591 for axel@localhost; Sat, 28 Sep 2024 04:51:49 GMTDate: Sat, 28 Sep 2024 04:51:49 GMTFrom: rosa@cat.htbMessage-Id: <202409280451.48S4pnlT001591@cat.htb>Subject: New cat servicesHi Axel,We are planning to launch new cat-related web services, including a cat care website and other projects. Please send an email to jobert@localhost with information about your Gitea repository. Jobert will check if it is a promising service that we can develop.Important note: Be sure to include a clear description of the idea so that I can understand it properly. I will review the whole repository.From rosa@cat.htb Sat Sep 28 05:05:28 2024Return-Path: <rosa@cat.htb>Received: from cat.htb (localhost [127.0.0.1]) by cat.htb (8.15.2/8.15.2/Debian-18) with ESMTP id 48S55SRY002268 for <axel@cat.htb>; Sat, 28 Sep 2024 05:05:28 GMTReceived: (from rosa@localhost) by cat.htb (8.15.2/8.15.2/Submit) id 48S55Sm0002267 for axel@localhost; Sat, 28 Sep 2024 05:05:28 GMTDate: Sat, 28 Sep 2024 05:05:28 GMTFrom: rosa@cat.htbMessage-Id: <202409280505.48S55Sm0002267@cat.htb>Subject: Employee managementWe are currently developing an employee management system. Each sector administrator will be assigned a specific role, while each employee will be able to consult their assigned tasks. The project is still under development and is hosted in our private Gitea. You can visit the repository at: http://localhost:3000/administrator/Employee-management/. In addition, you can consult the README file, highlighting updates and other important details, at: http://localhost:3000/administrator/Employee-management/raw/branch/main/README.md.
ROOT
1. create new repo2. Description contains the payload
3. create a new file in same repo and commit changes
4. send mail to jobert using curl or swaks
5. before that run the python server with port set in payload
swaks --to "jobert@localhost" --from "axel@localhost" --header "Subject: click link" --body "http://localhost:3000/axel/xss" --server localhost --port 25 --timeout 30s