Skip to content

Add Nextcloud AppApi interactive shell module#21246

Open
Chocapikk wants to merge 1 commit intorapid7:masterfrom
Chocapikk:add-nextcloud-appapi-shell
Open

Add Nextcloud AppApi interactive shell module#21246
Chocapikk wants to merge 1 commit intorapid7:masterfrom
Chocapikk:add-nextcloud-appapi-shell

Conversation

@Chocapikk
Copy link
Copy Markdown
Contributor

@Chocapikk Chocapikk commented Apr 7, 2026

Hello Metasploit Team,

This adds an interactive auxiliary module for full Nextcloud takeover via a leaked AppAPI secret.

This is PR 5/5 of the Windfall suite. Depends on #21243 (Nextcloud AppApi Mixin).

What It Does

auxiliary/admin/http/nextcloud_appapi_shell provides an interactive shell for Nextcloud administration using a leaked APP_SECRET. The AppAPI scope system was removed in PR #373, meaning any ExApp secret grants unrestricted access to the entire Nextcloud OCS API.

The typical attack chain:

  1. Leak APP_SECRET from /proc/1/environ via auxiliary/gather/windmill_file_read ((Add Windmill path traversal RCE, SQLi RCE, and auxiliary modules (CVE-2026-29059, CVE-2026-23696) #21245))
  2. Use this shell for full Nextcloud control

Shell Commands

  • users / user <id> - List users, view user details and groups
  • admins - List admin users
  • ls [path] / cat <path> / upload <local> <remote> - Browse and manage files as any user
  • dl <path> - Download files (saved to loot)
  • search <query> - Recursive file search
  • shares - List file shares and public links
  • groups / apps - List groups and installed apps
  • mkadmin <user> <pass> - Create a new admin account
  • su <user> - Switch impersonated user
  • info - Show Nextcloud version and server info

All commands impersonate users via the AUTHORIZATION-APP-API header, bypassing 2FA.

Verification

  • Set up Nextcloud with AppAPI and Flow (see Add Windmill path traversal RCE, SQLi RCE, and auxiliary modules (CVE-2026-29059, CVE-2026-23696) #21245 documentation for lab)
  • Leak APP_SECRET from Flow container: docker exec nc_app_flow env | grep APP_SECRET
  • use auxiliary/admin/http/nextcloud_appapi_shell
  • set RHOSTS localhost.local and set RPORT 443 and set SSL true
  • set APP_SECRET <leaked_secret>
  • run - interactive shell opens
  • users - lists all Nextcloud users
  • su admin and ls / - browse admin's files
  • mkadmin hacker password123 - creates admin account
  • Documentation included

Blog post: https://chocapikk.com/posts/2026/windfall-nextcloud-flow-windmill-rce/

Interactive auxiliary module for full Nextcloud takeover via leaked
AppApi secret. Features user impersonation, file browsing/download/
upload, admin creation, share listing, and tab completion.
@Chocapikk Chocapikk force-pushed the add-nextcloud-appapi-shell branch from 1cccbdd to 5b59477 Compare April 7, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants