Overview
Theconfluence attach command allows you to upload and attach files to Confluence pages. This command is particularly useful for offensive security operations involving social engineering, credential farming, and establishing trust with target users by sharing seemingly legitimate files.
The command can attach new files or reference existing attachments, optionally adding context text and mentioning specific users to increase engagement.
Syntax
Required Parameters
The base URL of the Confluence instance (e.g.,
https://example.atlassian.net)The page ID where the file will be attached. Page IDs can be discovered using the
confluence listpages commandOptional Parameters
Authentication cookie (
cloud.session.token or tenant.session.token). If omitted, the command will attempt anonymous access (if enabled on the target)Local file path to upload and attach to the page
Attachment ID to attach to the page if the attachment already exists in Confluence
Custom name for the file attachment. Defaults to the filename provided with
--fileComment associated with the uploaded file
Additional text to add to the page providing context (e.g., “I uploaded this file, please take a look”)
User ID to mention (@) on the page. User IDs can be obtained using the
jira listusers commandSave command output to a specified file
Examples
- Basic File Attachment
- With Context and Mention
- Malicious Executable
- Existing Attachment
Use Cases
Red Team Perspectives
Red Team Perspectives
Social Engineering Operations
- Deliver malicious payloads disguised as legitimate documents (policies, forms, reports)
- Build trust by sharing seemingly helpful files before escalating to malicious content
- Impersonate IT/Security teams requesting users to execute “patches” or “updates”
- Upload documents that link to credential phishing pages
- Attach files containing macros that connect to attacker infrastructure
- Distribute files that establish persistence when executed
- Upload “trojan” documents that beacon when opened to identify active targets
- Share files that exploit zero-days or known vulnerabilities in document readers
- Attach files with embedded tracking pixels (used with external image loading)
- Plant backdoored tools that targets might download and execute
- Share “helpful” scripts that contain malicious payloads
- Establish recurring access by providing “utilities” that maintain C2 connections
Blue Team Perspectives
Blue Team Perspectives
Threat Detection Indicators
- Monitor for executable attachments (.exe, .bat, .ps1, .vbs, .hta) uploaded to Confluence
- Alert on attachments with double extensions or suspicious naming patterns
- Track unusual attachment activity from compromised accounts
- Review audit logs for file attachments added outside business hours
- Identify pages with attachments that have high download counts but low page views
- Correlate attachment uploads with subsequent security events (malware alerts, unusual authentication)
- Implement file type restrictions to prevent executable uploads
- Enable attachment scanning with antivirus/sandbox solutions
- Configure DLP rules to detect sensitive data exfiltration via attachments
- Restrict who can upload attachments to sensitive spaces
- Investigate the source and contents of suspicious attachments
- Identify all users who downloaded potentially malicious files
- Check if uploaded files match known malware signatures or IOCs
- Review the uploader’s account for signs of compromise
Output
The command returns information about the attachment operation, including:- Attachment ID
- File name and size
- Page ID where the file was attached
- Status of the upload operation
- Any errors or warnings encountered
Detection Considerations
Audit Logs- Confluence maintains detailed audit logs of all attachment operations
- Logs include: uploader username, timestamp, page ID, filename, and IP address
- Attachment events are typically logged as “ATTACHMENT_CREATED” or similar event types
- Unusual attachment patterns (volume, timing, file types) can trigger alerts
- UEBA solutions may flag accounts uploading executables or suspicious file types
- Anomalous behavior: uploading files to many pages or mentioning many users
- Organizations may scan attachments with EDR/AV solutions
- Sandbox analysis of executables and Office documents with macros
- Hash-based reputation checking against threat intelligence feeds
- Web proxy logs will show upload traffic to Confluence
- DLP solutions may inspect attachment content for sensitive data or malicious patterns
OPSEC Considerations
-
File Selection
- Avoid obviously malicious filenames or extensions
- Use file types expected in the target environment (.pdf, .docx, .xlsx)
- Consider the context of the page when choosing file types
-
Timing and Volume
- Upload files during business hours to blend with normal activity
- Avoid bulk uploads that could trigger rate-limiting or anomaly detection
- Space out operations across multiple sessions
-
Account Behavior
- Ensure the compromised account normally has permissions to upload files
- Match the user’s typical behavior patterns (spaces they access, file types they share)
- Avoid actions the real user would never perform
-
Social Engineering Quality
- Use convincing context text that matches organizational communication style
- Reference real projects, teams, or initiatives when possible
- Ensure the page context makes sense for the file attachment
-
Cleanup Considerations
- Be aware that Confluence retains attachment history even after deletion
- Deleted attachments may still be recoverable by administrators
- Consider using existing pages rather than creating obvious test pages
-
Attribution Avoidance
- Remember that the username associated with the session token will be logged
- Anonymous uploads (if enabled) may be more suspicious
- Consider the digital forensics trail left by the operation
Related Commands
- confluence embed - Embed a 1x1 pixel image for credential farming attacks
- confluence link - Add a hyperlink to a Confluence page
- confluence listattachments - Enumerate attachments for reconnaissance
- confluence listpages - Identify target pages for attachment operations
- jira listusers - Obtain user IDs for the
--atparameter - jira attach - Similar functionality for Jira issues